Skip to content

[improve][broker] Optimize fine-grained concurrency control for BucketDelayedDeliveryTracker#10

Open
Denovo1998 wants to merge 20 commits intomasterfrom
bucket_delivery_tracker_optimize
Open

[improve][broker] Optimize fine-grained concurrency control for BucketDelayedDeliveryTracker#10
Denovo1998 wants to merge 20 commits intomasterfrom
bucket_delivery_tracker_optimize

Conversation

@Denovo1998
Copy link
Owner

@Denovo1998 Denovo1998 commented Sep 14, 2025

Fixes #xyz

Main Issue: #

Motivation

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository: apache#24739

…rategy

Refactor lock mechanism from StampedLock to ReentrantReadWriteLock for thread safety. Add async bucket snapshot creation and improve concurrent message handling.
@codecov
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

❌ Patch coverage is 68.55346% with 100 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.32%. Comparing base (ee33c99) to head (cc1a635).
⚠️ Report is 98 commits behind head on master.

Files with missing lines Patch % Lines
...r/delayed/bucket/BucketDelayedDeliveryTracker.java 72.85% 40 Missing and 20 partials ⚠️
...sar/broker/delayed/NoopDelayedDeliveryContext.java 0.00% 10 Missing ⚠️
...broker/delayed/AbstractDelayedDeliveryTracker.java 78.57% 8 Missing and 1 partial ⚠️
...layed/bucket/CombinedSegmentDelayedIndexQueue.java 22.22% 3 Missing and 4 partials ⚠️
...broker/delayed/InMemoryDelayedDeliveryTracker.java 45.45% 6 Missing ⚠️
...rg/apache/pulsar/broker/delayed/bucket/Bucket.java 42.85% 3 Missing and 1 partial ⚠️
...r/delayed/BucketDelayedDeliveryTrackerFactory.java 60.00% 2 Missing ⚠️
...delayed/InMemoryDelayedDeliveryTrackerFactory.java 50.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #10      +/-   ##
============================================
+ Coverage     74.28%   74.32%   +0.04%     
- Complexity     2492    34088   +31596     
============================================
  Files          1913     1922       +9     
  Lines        149280   150427    +1147     
  Branches      17324    17471     +147     
============================================
+ Hits         110887   111800     +913     
- Misses        29565    29692     +127     
- Partials       8828     8935     +107     
Flag Coverage Δ
inttests 26.35% <8.80%> (-0.30%) ⬇️
systests 22.88% <0.00%> (+<0.01%) ⬆️
unittests 73.84% <68.55%> (+0.04%) ⬆️

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

Files with missing lines Coverage Δ
...oker/delayed/DispatcherDelayedDeliveryContext.java 100.00% <100.00%> (ø)
...r/delayed/BucketDelayedDeliveryTrackerFactory.java 88.00% <60.00%> (-5.48%) ⬇️
...delayed/InMemoryDelayedDeliveryTrackerFactory.java 87.50% <50.00%> (-7.74%) ⬇️
...rg/apache/pulsar/broker/delayed/bucket/Bucket.java 87.27% <42.85%> (-6.61%) ⬇️
...broker/delayed/InMemoryDelayedDeliveryTracker.java 85.57% <45.45%> (-3.20%) ⬇️
...layed/bucket/CombinedSegmentDelayedIndexQueue.java 82.22% <22.22%> (-15.08%) ⬇️
...broker/delayed/AbstractDelayedDeliveryTracker.java 82.60% <78.57%> (-3.67%) ⬇️
...sar/broker/delayed/NoopDelayedDeliveryContext.java 0.00% <0.00%> (ø)
...r/delayed/bucket/BucketDelayedDeliveryTracker.java 79.59% <72.85%> (-2.48%) ⬇️

... and 112 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant