Skip to content

[improve][broker] Pin executor to managed ledger instance to cache the string hashing - #18078

Merged
AnonHxy merged 8 commits into
apache:masterfrom
merlimat:managed-ledger-executor-cache
Nov 30, 2022
Merged

AnonHxy merged 8 commits into
apache:masterfrom
merlimat:managed-ledger-executor-cache

Conversation

@merlimat

@merlimat merlimat commented Oct 17, 2022 •

Copy link
Copy Markdown
Contributor

Motivation

In many operations we're hashing on the managed ledger name to ensure all the callbacks are triggered from same thread. Instead of hashing the string each, let's pin the thread and always use the same, for a given managed ledger instance.

This will avoid the hashing overhead.

Tests in merlimat#3

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Oct 17, 2022
@merlimat merlimat added this to the 2.12.0 milestone Oct 17, 2022
@merlimat merlimat added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Oct 17, 2022
@github-actions github-actions Bot added doc-label-missing and removed doc-not-needed Your PR changes do not impact docs labels Oct 17, 2022
@apache apache deleted a comment from github-actions Bot Oct 17, 2022
@merlimat merlimat added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Oct 17, 2022
@github-actions github-actions Bot added doc-label-missing and removed doc-not-needed Your PR changes do not impact docs labels Oct 17, 2022
@github-actions

Copy link
Copy Markdown

@merlimat Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Oct 17, 2022
@merlimat merlimat changed the title [Broker] Pin executor to managed ledger instance to cache the string hashing [improve] Pin executor to managed ledger instance to cache the string hashing Oct 17, 2022
@Technoboy- Technoboy- changed the title [improve] Pin executor to managed ledger instance to cache the string hashing [improve][broker] Pin executor to managed ledger instance to cache the string hashing Oct 18, 2022
@Technoboy- Technoboy- closed this Oct 18, 2022
@Technoboy- Technoboy- reopened this Oct 18, 2022
@codecov-commenter

codecov-commenter commented Oct 18, 2022 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.33333% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.56%. Comparing base (cee697b) to head (66fc80a).
⚠️ Report is 3226 commits behind head on master.

Files with missing lines Patch % Lines
...okkeeper/mledger/impl/ShadowManagedLedgerImpl.java 0.00% 4 Missing ⚠️
...che/bookkeeper/mledger/impl/ManagedCursorImpl.java 33.33% 2 Missing ⚠️
...kkeeper/mledger/impl/cache/EntryCacheDisabled.java 0.00% 2 Missing ⚠️
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 88.88% 1 Missing ⚠️
...keeper/mledger/impl/cache/RangeEntryCacheImpl.java 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18078      +/-   ##
============================================
- Coverage     47.06%   46.56%   -0.50%     
- Complexity     8956    10342    +1386     
============================================
  Files           592      698     +106     
  Lines         56313    68326   +12013     
  Branches       5844     7332    +1488     
============================================
+ Hits          26503    31817    +5314     
- Misses        26946    32886    +5940     
- Partials       2864     3623     +759     
Flag Coverage Δ
unittests 46.56% <58.33%> (-0.50%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...org/apache/bookkeeper/mledger/impl/OpAddEntry.java 64.21% <100.00%> (ø)
...rg/apache/bookkeeper/mledger/impl/OpReadEntry.java 65.55% <100.00%> (ø)
...keeper/mledger/impl/cache/PendingReadsManager.java 40.00% <100.00%> (ø)
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 53.95% <88.88%> (ø)
...keeper/mledger/impl/cache/RangeEntryCacheImpl.java 45.79% <50.00%> (ø)
...che/bookkeeper/mledger/impl/ManagedCursorImpl.java 37.11% <33.33%> (ø)
...kkeeper/mledger/impl/cache/EntryCacheDisabled.java 10.86% <0.00%> (ø)
...okkeeper/mledger/impl/ShadowManagedLedgerImpl.java 0.00% <0.00%> (ø)

... and 172 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Technoboy-
Technoboy- force-pushed the managed-ledger-executor-cache branch from c27ba86 to a971e4c Compare October 22, 2022 14:16
@poorbarcode

Copy link
Copy Markdown
Contributor

/pulsarbot rerun-failure-checks

@tisonkun

tisonkun commented Nov 2, 2022

Copy link
Copy Markdown
Member

/pulsarbot rerun-failure-checks

@AnonHxy
AnonHxy force-pushed the managed-ledger-executor-cache branch from 8a7a7ce to 9783b6b Compare November 28, 2022 16:24
@AnonHxy
AnonHxy force-pushed the managed-ledger-executor-cache branch from 9783b6b to 66fc80a Compare November 29, 2022 05:05
@AnonHxy
AnonHxy merged commit fe45a9c into apache:master Nov 30, 2022
lifepuzzlefun pushed a commit to lifepuzzlefun/pulsar that referenced this pull request Dec 9, 2022
lifepuzzlefun pushed a commit to lifepuzzlefun/pulsar that referenced this pull request Jan 10, 2023
@merlimat
merlimat deleted the managed-ledger-executor-cache branch October 24, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test 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.

10 participants