BewareMyPower opened a new pull request #11802:
URL: https://github.com/apache/pulsar/pull/11802


   ### Motivation
   
   https://github.com/apache/pulsar/pull/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.
   
   After https://github.com/apache/pulsar/pull/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
   
   - [ ] 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:


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