Skip to content

Conversation

@chia7712
Copy link
Member

@chia7712 chia7712 commented Jul 2, 2021

issue: https://issues.apache.org/jira/browse/KAFKA-13030

related: #10743

https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java#L888

            if (e instanceof NoBatchedFindCoordinatorsException) {
                batchFindCoordinator = false;
                clearFindCoordinatorFuture();
                lookupCoordinator();
                return;
            } 

The current request future is NOT updated so it can't be completed until timeout. It causes a slow poll when user poll data from older broker the first time.

Broken Behavior

  var consumer = new KafkaConsumer<>();
  var records = consumer.poll(Duration.ofSeconds(30));
  // there are producers which are pushing data to topic.
  // [BEFORE PR-10743] the return data from fist poll could NOT be empty
  // [AFTER PR-10743] the return data from first poll is always empty. To make matters worst, it returns only if duration is expired (if users set a large duration ...)
  assert records.count() > 0;

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@chia7712 chia7712 requested review from ijuma and mimaison July 2, 2021 22:13
Copy link
Member

@showuon showuon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chia7712 , nice find! Could we add tests for it?

@chia7712
Copy link
Member Author

chia7712 commented Jul 4, 2021

nice find! Could we add tests for it?

done

@mimaison
Copy link
Member

mimaison commented Jul 4, 2021

Thanks @chia7712. This if statement is being removed in #10965 so I think it should address this issue

@chia7712
Copy link
Member Author

chia7712 commented Jul 4, 2021

This if statement is being removed in #10965 so I think it should address this issue

you are right. close this as duplicate :)

@chia7712 chia7712 closed this Jul 4, 2021
@chia7712 chia7712 deleted the KAFKA-13030 branch March 25, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants