Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding comments for kafka 2.4 functionality changes #884

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ protected void updateConsumerAssignment(Collection<TopicPartition> partitions) {
public void onPartitionsRevoked(Collection<TopicPartition> topicPartitions) {
_logger.info("Partition ownership revoked for {}, checkpointing.", topicPartitions);
_kafkaTopicPartitionTracker.onPartitionsRevoked(topicPartitions);
//_failure flag is used to address 2.4 kafka version behavior changes for onPartitionRevoked calls.
//Prior to this version, consumer close was not calling onPartitionsRevoked.
if (!_shutdown && !topicPartitions.isEmpty() && !_failure) { // there is a commit at the end of the run method, skip extra commit in shouldDie mode.
try {
maybeCommitOffsets(_consumer, true); // happens inline as part of poll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ public void stop() {

@Override
public void onPartitionsRevoked(Collection<TopicPartition> partitions) {
//Do not remove super.onPartitionsRevoked call or refactor the code to take care of the kafka 2.4 changes.
//Prior to this version, consumer close was not calling onPartitionsRevoked.
super.onPartitionsRevoked(partitions);
_topicManager.onPartitionsRevoked(partitions);
}
Expand Down