majialoong commented on code in PR #20739:
URL: https://github.com/apache/kafka/pull/20739#discussion_r2450249209
##########
coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:
##########
@@ -833,7 +833,7 @@ private void flushCurrentBatch() {
*/
private void maybeFlushCurrentBatch(long currentTimeMs) {
if (currentBatch != null) {
- if (currentBatch.builder.isTransactional() ||
(currentBatch.appendTimeMs - currentTimeMs) >= appendLingerMs ||
!currentBatch.builder.hasRoomFor(0)) {
+ if (currentBatch.builder.isTransactional() || (currentTimeMs -
currentBatch.appendTimeMs) >= appendLingerMs ||
!currentBatch.builder.hasRoomFor(0)) {
Review Comment:
As you mentioned, time-based scheduled tasks will ensure that the current
batch is flushed to the log once it has passed the append linger time.
Perhaps performing a conditional check here is intended to detect as
promptly as possible when the current batch has passed the append linger time,
so that flushing to the log can be carried out more promptly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]