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

[Broker] Optimize ManagedLedger Ledger Ownership Check #13222

Merged
merged 1 commit into from Dec 10, 2021

Conversation

michaeljmarshall
Copy link
Member

@michaeljmarshall michaeljmarshall commented Dec 9, 2021

Motivation

The logic added in #11912 forces all reads to check for containment in the managed ledger's collection of ledgers. Since the current ledger is always a member of the managed ledger's collection of ledgers, we can add an optimization that skips this check when reading from the current ledger. Note that all tail reads go through this part of the code, even if they're hitting the broker's cache.

Modifications

  • Update the ordering of conditional logic in ManagedLedger#asyncReadEntry.

Verifying this change

The test added in #11912 still passes, so this has the correct logic.

Does this pull request potentially affect one of the following parts:

This is not a breaking change.

Documentation

  • no-need-doc

@michaeljmarshall michaeljmarshall added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/broker release/2.7.4 release/2.9.1 release/2.8.3 labels Dec 9, 2021
@michaeljmarshall michaeljmarshall added this to the 2.10.0 milestone Dec 9, 2021
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 9, 2021
@merlimat merlimat merged commit 02b8de0 into apache:master Dec 10, 2021
@michaeljmarshall michaeljmarshall deleted the optimize-ledger-check branch December 10, 2021 05:23
codelipenghui pushed a commit that referenced this pull request Dec 11, 2021
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Dec 11, 2021
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
codelipenghui pushed a commit that referenced this pull request Dec 21, 2021
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Dec 21, 2021
zymap pushed a commit that referenced this pull request Dec 23, 2021
@zymap zymap added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.7 Archived: 2.7 is end of life cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.7.4 release/2.8.3 release/2.9.2 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.

None yet

5 participants