[fix][broker] Fix can't stop phase-two of compaction even though messageId read reaches lastReadId#20988
Merged
coderzc merged 4 commits intoapache:masterfrom Aug 22, 2023
Merged
Conversation
5 tasks
poorbarcode
approved these changes
Aug 14, 2023
| promise.complete(null); | ||
| } | ||
| }); | ||
| return; |
Contributor
There was a problem hiding this comment.
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?
Member
Author
There was a problem hiding this comment.
You are right, but this PR is to fix phase two can't be stopped. We can open another PR to fix this issue.
heesung-sohn
approved these changes
Aug 15, 2023
codelipenghui
approved these changes
Aug 16, 2023
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #20988 +/- ##
============================================
+ Coverage 72.67% 73.08% +0.41%
+ Complexity 32268 32243 -25
============================================
Files 1863 1875 +12
Lines 139397 139587 +190
Branches 15336 15349 +13
============================================
+ Hits 101308 102021 +713
+ Misses 30032 29494 -538
- Partials 8057 8072 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
3de7045 to
c2c09a5
Compare
gaoran10
approved these changes
Aug 21, 2023
0be467d to
288c73f
Compare
288c73f to
d789b98
Compare
Merged
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: