Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][txn] change delete pending ack position from foreach to firstKey #16927

Merged

Conversation

congbobo184
Copy link
Contributor

@congbobo184 congbobo184 commented Aug 3, 2022

Motivation

now transaction pending ack delete pending ack state position use cursor mark delete position.

now the logic is use foreach, every position in pending ack state need to check the position whether smaller than mark delete position. If the position is smaller than mark delete position, it can be deleted from the pending ack state map.

this map is a skipListMap, the key is the position, so we only need to check if the first entry is better, if it is smaller than mark delete we can continue check, otherwise, we only break the check directly.

Modifications

chan foreach to use firstkey

Verifying this change

add the test for it

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

  • doc-not-needed

@congbobo184 congbobo184 added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/transaction doc-not-needed Your PR changes do not impact docs labels Aug 3, 2022
@congbobo184 congbobo184 added this to the 2.11.0 milestone Aug 3, 2022
@congbobo184 congbobo184 self-assigned this Aug 3, 2022
@Technoboy- Technoboy- merged commit 5b65fda into apache:master Aug 4, 2022
Technoboy- pushed a commit to merlimat/pulsar that referenced this pull request Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transaction doc-not-needed Your PR changes do not impact docs type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants