-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce redundant FLOW requests for non-durable multi-topics consumer (#…
…11802) ### Motivation #3960 fixed the bug that reader will get stuck if it's reading a partition of a partitioned topic. The fix is using `isDurable` to check whether the consumer is a reader's internal consumer because it used `partitionIndex` to check whether the target topic is a partition while reader's `partitionIndex` is already set. However, for a non-durable multi-topics consumer, `isDurable` is false and each internal consumer will send FLOW request once the connection is established, which is unnecessary because `MultiTopicsConsumerImpl#startReceivingMessages` will send FLOW requests for each internal consumer after all internal consumers are connected. After #4591 introduced `hasParentConsumer` field, the check works for even a reader without the `isDurable` check. ### Modifications - Remove the check for `isDurable` before sending FLOW request and update the related comment. - Add a test for non-durable multi-topics consumer to verify the number of FLOW requests is the topics number, not the twice the topics number. ### Verifying this change - [x] Make sure that the change passes the CI checks. This change added `NonDurableSubscriptionTest#testFlowCountForMultiTopics` and the existing test `ReaderTest#testReadFromPartition` added in #3960 can also pass after this change. This change added tests and can be verified as follows:
- Loading branch information
1 parent
d0e5d96
commit 1303e7d
Showing
2 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters