-
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] Avoid orphan ledgers in BucketDelayedDeliveryTracker #22802
Conversation
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. Good work @dao-jun.
@lhotari Many thanks for your review! merging... |
Needed #23431 for fixing Pulsar CI. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22802 +/- ##
============================================
+ Coverage 73.57% 74.24% +0.66%
- Complexity 32624 34426 +1802
============================================
Files 1877 1951 +74
Lines 139502 147734 +8232
Branches 15299 16403 +1104
============================================
+ Hits 102638 109682 +7044
- Misses 28908 29552 +644
- Partials 7956 8500 +544
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…pache#22802) (cherry picked from commit 8b6b337) (cherry picked from commit 7299f1a)
…pache#22802) (cherry picked from commit 8b6b337) (cherry picked from commit 7299f1a)
Motivation
For BucketDelayedDeliveryTracker, we store the Bucket metadata(position) in Cursor#properties, and remove the property before delete
ImmutableBucket
.There is a corner case that it could remove Cursor#properties succeed but delete
ImmutableBucket
failed.Since we store the Bucket in Ledgers, if remove Cursor#properties succeed but delete
ImmutableBucket
failed, the ledger may have a change to be an orphan ledger, not reachable and not usable.The PR is for the purpose of handle the case, remove Cursor#properties after delete
ImmutableBucket
, if theBucket
delete succeed but remove Cursor#properties failed we can detect it in therecover
phase and remove the properties, to keep the data consistent and avoid orphan ledgers.Modifications
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: