congbobo184 opened a new pull request #14286:
URL: https://github.com/apache/pulsar/pull/14286
### Motivation
Now we don't check `OpAddEntry` can read entry is smaller than
maxReadPosition, if readPosition is bigger than maxReadPosition, we only can
read an empty list as result. In fact, when maxReadPosition have not been
updated, we should put read op in to wait state and when maxReadPosition
updated, we can notify it and read continue.
### Modifications
1. Add a field named maxReadPosition in`ManagedLedgerImpl` and if read op
enable maxReadPosition, we should check this readPosition is bigger than
maxReadPosition, if bigger we should put the op into wait state, if smaller or
equals we can do this op.
2. Add a field named `waitingCursorsByMaxReadPosition` in
`ManagedLedgerImpl`, when cursor has read op in wait state, we can put this
read op in to this queue. If maxReadPosition updated, we will pool it and
notify this this read op.
3. In topicTransaction buffer, when any updated maxReadposition op we should
sync it to `ManagedLedgerImpl` maxReadPosition.
### Verifying this change
add the test
### 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
- Does this pull request introduce a new feature? (yes)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs
/ not documented)
- If a feature is not applicable for documentation, explain why?
- If a feature is not documented yet in this PR, please create a followup
issue for adding the documentation
--
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]