Skip to content

Commit

Permalink
fix for message loss for issue 826 (#827)
Browse files Browse the repository at this point in the history
* use offsetHighestSucceeded instead of offsetHighestSeen to fix issue #826

* update readme

* add ut

* add comments

* remove ut

---------

Co-authored-by: Roman Kolesnev <romankolesnev@gmail.com>
  • Loading branch information
sangreal and rkolesnev authored Sep 23, 2024
1 parent 734d54b commit ffcafda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ endif::[]

=== Fixes

* fix: message loss on closing or partitions revoked (#826)
* fix: ConcurrentModificationException Happened while high load and draining (#822) fixes (#821)
* fix: safely completing doClose() (#818) partially fixes (#809)
* Improved offset commit retry. Add support for SaslAuthenticationException retry timeout (#819), partially fixes (#809) in Commit_Sync mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public boolean isRecordPreviouslyCompleted(final ConsumerRecord<K, V> rec) {
return false;
} else {
// if within the range of tracked offsets, must have been previously completed, as it's not in the incomplete set
return recOffset <= offsetHighestSeen;
return recOffset <= offsetHighestSucceeded;
}
}

Expand Down Expand Up @@ -459,7 +459,8 @@ public long getOffsetHighestSequentialSucceeded() {
*
* See #200 for the complete correct solution.
*/
long currentOffsetHighestSeen = offsetHighestSeen;
// use offsetHighestSucceeded instead of offsetHighestSeen to fix issue #826
long currentOffsetHighestSeen = offsetHighestSucceeded;
Long firstIncompleteOffset = incompleteOffsets.keySet().ceiling(KAFKA_OFFSET_ABSENCE);
boolean incompleteOffsetsWasEmpty = firstIncompleteOffset == null;

Expand Down

0 comments on commit ffcafda

Please sign in to comment.