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] [broker] Separate offload read and write thread pool #24025

Conversation

hangc0276
Copy link
Contributor

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

When we enable Jcloud offloader for all the topics, some topics need to perform catch-up read from the tiered storage; the ledger offload process and ledger catch-up read process are impacted each other due to the ledger offload and offloaded ledger read sharing the same thread pool. We need to separate the read and write thread pool for the offloader.

Modifications

Separate the read and write thread pool for the offloader.

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:

@hangc0276 hangc0276 self-assigned this Feb 25, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 25, 2025
@hangc0276 hangc0276 added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/tieredstorage ready-to-test and removed doc-not-needed Your PR changes do not impact docs labels Feb 25, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.

Project coverage is 74.19%. Comparing base (bbc6224) to head (fc4cb38).
Report is 938 commits behind head on master.

Files with missing lines Patch % Lines
...r/offload/jcloud/JCloudLedgerOffloaderFactory.java 0.00% 4 Missing ⚠️
...lsar/common/policies/data/OffloadPoliciesImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24025      +/-   ##
============================================
+ Coverage     73.57%   74.19%   +0.62%     
+ Complexity    32624    32381     -243     
============================================
  Files          1877     1861      -16     
  Lines        139502   144170    +4668     
  Branches      15299    16420    +1121     
============================================
+ Hits         102638   106970    +4332     
+ Misses        28908    28761     -147     
- Partials       7956     8439     +483     
Flag Coverage Δ
inttests 26.79% <7.69%> (+2.20%) ⬆️
systests 23.15% <76.92%> (-1.18%) ⬇️
unittests 73.71% <34.78%> (+0.86%) ⬆️

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

Files with missing lines Coverage Δ
...che/bookkeeper/mledger/LedgerOffloaderFactory.java 40.00% <100.00%> (-10.00%) ⬇️
...org/apache/pulsar/broker/ServiceConfiguration.java 98.16% <100.00%> (-1.23%) ⬇️
...n/java/org/apache/pulsar/broker/PulsarService.java 84.41% <100.00%> (+2.03%) ⬆️
...e/pulsar/common/policies/data/OffloadPolicies.java 100.00% <ø> (+100.00%) ⬆️
...d/jcloud/impl/BlobStoreManagedLedgerOffloader.java 75.85% <100.00%> (+0.66%) ⬆️
...lsar/common/policies/data/OffloadPoliciesImpl.java 81.81% <0.00%> (-3.85%) ⬇️
...r/offload/jcloud/JCloudLedgerOffloaderFactory.java 0.00% <0.00%> (ø)

... and 1052 files with indirect coverage changes

@Technoboy- Technoboy- added this to the 4.1.0 milestone Feb 26, 2025
@Technoboy- Technoboy- merged commit b407a21 into apache:master Feb 26, 2025
53 checks passed
BewareMyPower added a commit to BewareMyPower/pulsar that referenced this pull request Feb 26, 2025
… LTS

- Remove `managedLedgerOffloadReadThreads` from apache#24025
- Remove `managedLedgerMaxReadsInFlightPermitsAcquireTimeoutMillis` and
  `managedLedgerMaxReadsInFlightPermitsAcquireQueueSize` from apache#23901
- Remove `managedLedgerCursorResetLedgerCloseTimestampMaxClockSkewMillis` from apache#22792
The configs above only increase the complexity and are hard to configure.

Add more comments to `managedLedgerPersistIndividualAckAsLongArray` from apache#23759.
This config was added to keep the compatibility from 3.x or earlier so
it has value to retain. 3.x users must configure it with false when
upgrading to 4.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tieredstorage cherry-picked/branch-3.3 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.3.6 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