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][offload]PIP-211: Introduce Offload throttling, P1 #22385

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

dao-jun
Copy link
Member

@dao-jun dao-jun commented Mar 29, 2024

PIP: #18004

Motivation

See #18004

Modifications

  1. Move AsyncTokenBucket related classes from pulsar-broker to pulsar-common
  2. Add OffloadLedgerHandle.java
  3. Pass OffloadLedgerHandle's instance to LedgerOffloader instead of LedgerHandle.

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:

@github-actions github-actions bot added the doc-required Your PR changes impact docs and you will update later. label Mar 29, 2024
@dao-jun dao-jun self-assigned this Mar 29, 2024
@dao-jun dao-jun requested a review from Technoboy- March 29, 2024 12:36
@dao-jun dao-jun added this to the 3.3.0 milestone Mar 29, 2024
@dao-jun dao-jun closed this Mar 29, 2024
@dao-jun dao-jun reopened this Mar 29, 2024
@dao-jun
Copy link
Member Author

dao-jun commented Mar 29, 2024

Origin PR: #17485

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that AsyncTokenBucket should be used for rate limiting instead of implementing a separate solution. It was introduced in PIP-322.

@dao-jun
Copy link
Member Author

dao-jun commented Mar 29, 2024

I think that AsyncTokenBucket should be used for rate limiting instead of implementing a separate solution. It was introduced in PIP-322.

@lhotari
TimeWindow is not introduced by this PR, it exists a long time. Just reuse it here. If you think AsyncTokenBucket is better, I can fix this.

@dao-jun
Copy link
Member Author

dao-jun commented Mar 29, 2024

@lhotari I will move AsyncTokenBucket related class from pulsar-broker to pulsar-common, is it OK?

@lhotari
Copy link
Member

lhotari commented Mar 29, 2024

I think that AsyncTokenBucket should be used for rate limiting instead of implementing a separate solution. It was introduced in PIP-322.

@lhotari
TimeWindow is not introduced by this PR, it exists a long time. Just reuse it here. If you think AsyncTokenBucket is better, I can fix this.

Yes, I think so. It's worth checking if you could implemented the rate limiting in a similar way as it is in other Pulsar rate limiters that were refactored in PIP-322 implementation.

@dao-jun dao-jun requested a review from lhotari March 29, 2024 15:38
@dao-jun dao-jun changed the title [improve][offload]PIP-211: Introduce Offload threshold, P1 [improve][offload]PIP-211: Introduce Offload throttling, P1 Mar 29, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 83.05085% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 73.71%. Comparing base (bbc6224) to head (ada5b82).
Report is 107 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22385      +/-   ##
============================================
+ Coverage     73.57%   73.71%   +0.13%     
+ Complexity    32624    32404     -220     
============================================
  Files          1877     1886       +9     
  Lines        139502   139926     +424     
  Branches      15299    15326      +27     
============================================
+ Hits         102638   103141     +503     
+ Misses        28908    28810      -98     
- Partials       7956     7975      +19     
Flag Coverage Δ
inttests 27.03% <11.86%> (+2.45%) ⬆️
systests 24.48% <52.54%> (+0.16%) ⬆️
unittests 72.98% <79.66%> (+0.14%) ⬆️

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

Files Coverage Δ
...apache/bookkeeper/mledger/ManagedLedgerConfig.java 96.38% <100.00%> (+0.08%) ⬆️
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 80.95% <100.00%> (+0.29%) ⬆️
...org/apache/pulsar/broker/ServiceConfiguration.java 99.39% <100.00%> (+<0.01%) ⬆️
...n/java/org/apache/pulsar/broker/PulsarService.java 82.62% <ø> (+0.25%) ⬆️
...ker/resourcegroup/ResourceGroupPublishLimiter.java 86.95% <ø> (ø)
...rg/apache/pulsar/broker/service/BrokerService.java 80.96% <100.00%> (+0.18%) ⬆️
.../pulsar/broker/service/PublishRateLimiterImpl.java 86.15% <ø> (ø)
...broker/service/persistent/DispatchRateLimiter.java 78.63% <ø> (ø)
...roker/service/persistent/SubscribeRateLimiter.java 54.54% <ø> (ø)
...ava/org/apache/pulsar/broker/stats/TimeWindow.java 66.66% <ø> (ø)
... and 8 more

... and 181 files with indirect coverage changes

@nodece nodece self-requested a review May 6, 2024 02:51
@coderzc coderzc modified the milestones: 3.3.0, 3.4.0 May 8, 2024
@lhotari lhotari modified the milestones: 4.0.0, 4.1.0 Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants