lianetm commented on code in PR #21457:
URL: https://github.com/apache/kafka/pull/21457#discussion_r2813326035


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcher.java:
##########
@@ -153,11 +169,17 @@ public void onSuccess(ListOffsetResult value) {
                         
remainingToSearch.keySet().retainAll(value.partitionsToRetry);
 
                         
offsetFetcherUtils.updateSubscriptionState(value.fetchedOffsets, 
isolationLevel);
+
+                        if (isZeroTimestamp && shouldClearPartitionEndOffsets)

Review Comment:
   ack, makes sense that we cannot consolidate on the time check because it 
depends on the caller. 
   
   But then, shouldn't we consolidate on the `shouldClearPartitionEndOffsets`? 
Why do we need to check `isZeroTimestamp` here? vs simply `if 
shouldClearPartitionEndOffsets then clear`



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcher.java:
##########
@@ -181,27 +203,43 @@ public void onFailure(RuntimeException e) {
             }
         } while (timer.notExpired());
 
+        if (shouldClearPartitionEndOffsets) {

Review Comment:
   isn't this going to be always false here? (so unneeded?)
   `shouldClearPartitionEndOffsets` is true for currentLag only, so time=0 
which always early returns above, right?



-- 
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]

Reply via email to