-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Fix repeatedly acquired pending reads quota #23869
[fix][broker] Fix repeatedly acquired pending reads quota #23869
Conversation
...er/src/test/java/org/apache/bookkeeper/mledger/impl/InflightReadsLimiterIntegrationTest.java
Show resolved
Hide resolved
I agree that this issue exists, however there are broader issues in the Sharing some context about the issues I have found and what I have currently in progress: I have reported issues #23482, #23504, #23505 and #23506 . I have already changes to address these issues in an experimental branch, pending the submission of individual PRs. Addressing the lack of caching for replay queue messages requires broader changes to the the broker cache and those will be covered with a new PIP. Some earlier details shared in this comment: #23524 (comment) . Due to issues #23482 and #23506, I don't think that this PR would resolve problems alone. Regarding broker OOMEs, issue #23504 would also need to be resolved. It's possible that |
Agree with you, let us fix them one by one, which is easier to review, and we should add tests for each case. |
I think we should use AsyncTokenBucket or Guava.RateLimiter.tryAcquire for this rate limiter. IMHO, the current logic, requiring acquiredPermit to release is error-prone, when the caller forgets to release it. Instead, I think we better use token bucket-based one, which can automatically fill the bucket. |
@heesung-sn I agree, the current solution is problematic. However, a token bucket isn't most optimal for this use case. I have a redesigned solution the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23869 +/- ##
============================================
+ Coverage 73.57% 74.24% +0.66%
+ Complexity 32624 32222 -402
============================================
Files 1877 1853 -24
Lines 139502 143618 +4116
Branches 15299 16310 +1011
============================================
+ Hits 102638 106622 +3984
+ Misses 28908 28610 -298
- Partials 7956 8386 +430
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@heesung-sn @poorbarcode To continue the improvements to address issues with |
(cherry picked from commit 331a997)
(cherry picked from commit 331a997)
(cherry picked from commit 331a997)
Motivation
Background
managedLedgerMaxReadsInFlightSize
50~59
50~69
Request-2
will wait forRequest-1
, and only send a real request that reads60~69
afterRequest-1
is finished.Issue
Request-2
above requests repeatedly50~70
when creating.61~70
afterRequest-1
is finished.Request-2
acquire20
quota.Request-2
acquire40
quota.testPreciseLimitation
to reproduce the issueModifications
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x