HQebupt opened a new pull request, #16546: URL: https://github.com/apache/pulsar/pull/16546
Fixes #14559 ### Motivation `Reader` belongs to exclusive subscription type, and it uses `nonDurable` cursor. After receiving messages, `Reader` will ack cumulatively immediately. `FlowPermits` are triggered in multiple scenarios from the client side and it is isolated from `seek` of `Consumer`. Therefore, it is possibile that `flowPermits` will execute after `seek` from the client side, like the following flow chart. <img width="613" alt="image" src="https://user-images.githubusercontent.com/4970972/178506611-b02a1127-c8d8-40df-be61-7645deb5f48e.png"> When `handleSeek` processing is delay from the server side, the `MarkDelete position` is modified in a wrong way. The expected result is that `Reader`can re-consume messages from `mark delete:(1,1)` after `seek`. But it doesn't work. ### Modifications It is necessary to check the current cursor status when handling `flowPermits` from the server side. ### Verifying this change - [x] Make sure that the change passes the CI checks. This change is a trivial rework / code cleanup without any test coverage. ### Does this pull request potentially affect one of the following parts: If `yes` was chosen, please highlight the changes - Dependencies (does it add or upgrade a dependency): (no) - The public API: (no) - The schema: (no) - The default values of configurations: (no) - The wire protocol: (no) - The rest endpoints: (no) - The admin cli options: (no) - Anything that affects deployment: (no) ### Documentation Check the box below and label this PR (if you have committer privilege). Need to update docs? - [x] `doc-not-needed` -- 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]
