-
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 can't stop phase-two of compaction even though messageId read reaches lastReadId #20988
Conversation
@@ -277,6 +277,7 @@ private void phaseTwoLoop(RawReader reader, MessageId to, Map<String, MessageId> | |||
promise.complete(null); | |||
} | |||
}); | |||
return; |
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.
What if some of the previous addToCompactedLedger aync write fail later, but the last id's addToCompactedLedger is complete first? Do we mark the promise
as successful here?
Don't we need to wait for all outstanding addToCompactedLedger to be complete before making promise
complete?
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.
You are right, but this PR is to fix phase two can't be stopped. We can open another PR to fix this issue.
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.
@heesung-sn I opened #21067 to fix it.
Codecov Report
@@ Coverage Diff @@
## master #20988 +/- ##
============================================
+ Coverage 33.53% 37.31% +3.78%
- Complexity 12174 12468 +294
============================================
Files 1621 1698 +77
Lines 126919 131291 +4372
Branches 13851 14524 +673
============================================
+ Hits 42561 48991 +6430
+ Misses 78745 75856 -2889
- Partials 5613 6444 +831
Flags with carried forward coverage won't be shown. Click here to find out more.
|
3de7045
to
c2c09a5
Compare
0be467d
to
288c73f
Compare
288c73f
to
d789b98
Compare
Motivation
Currently, the compactor can't stop phase-two even though messageId read reaches lastReadId, this may lead to the next entry being dropped because it does not exist in the latestForKey.
Modifications
Stop phase two when the messageId read reaches lastReadId.
Verifying this change
(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:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: