-
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][Tiered Storage] Eagerly Delete Offloaded Segments On Topic Deletion #17915
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
Awesome work!
67b921b
to
ab7c5b3
Compare
…tion (apache#15914) * Truncate topic before deletion to avoid orphaned offloaded ledgers * CR feedback (cherry picked from commit 9026d19)
ab7c5b3
to
ba76543
Compare
Codecov Report
@@ Coverage Diff @@
## master #17915 +/- ##
=============================================
+ Coverage 34.91% 49.99% +15.07%
- Complexity 5707 7031 +1324
=============================================
Files 607 393 -214
Lines 53396 43489 -9907
Branches 5712 4470 -1242
=============================================
+ Hits 18644 21741 +3097
+ Misses 32119 19338 -12781
+ Partials 2633 2410 -223
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…tion (apache#17915) (cherry picked from commit 0854032)
…tion (apache#17915) (#152) (cherry picked from commit 0854032) Fixes apache#9962 ### Motivation Offloaded ledgers can be orphaned on topic deletion. This is a redo of apache#15914 which conflicted with concurrently merged apache#17736 thus resulting in apache#17889 . apache#17736 made a decision to not allow managed ledger trimming for the fenced mledgers because in many case fencing indicates a problems that should stop all operations on mledger. At the same time fencing is used before deletion starts, so trimming added to the deletion process cannot proceed. After discussion with @eolivelli I introduced new state, FencedForDeletion, which acts as Fenced state except for the trimming/deletion purposes. ### Modifications Topic to be truncated before deletion to delete offloaded ledgers properly and fail if truncation fails. ### Verifying this change local fork tests: dlg99#1 - [ ] Make sure that the change passes the CI checks. This change added integration tests ### Does this pull request potentially affect one of the following parts: *If `yes` was chosen, please highlight the changes* Nothing changed in the options but admin CLI will implicitly run truncate before topic delete. - Dependencies (does it add or upgrade a dependency): (yes / no) - The public API: (yes / no) - The schema: (yes / no / don't know) - The default values of configurations: (yes / no) - The wire protocol: (yes / no) - The rest endpoints: (yes / no) - The admin cli options: (yes / no) - Anything that affects deployment: (yes / no / don't know) ### Documentation Check the box below or label this PR directly. Need to update docs? - [ ] `doc-required` (Your PR needs to update docs and you will update later) - [x] `doc-not-needed` (Please explain why) - [ ] `doc` (Your PR contains doc changes) - [ ] `doc-complete` (Docs have been already added)
@dlg99 @eolivelli This PR can cherry-pick into 2.9? Whether to introduce break change? |
We cannot cherry pick this anywhere. |
…xception --- ### Motivation apache#17915 changes the fix apache#17512 which lead the offload data is deleted when metadata store exception happened. Then the ledger can not be read. The logs shows ``` Failed to update offloaded metadata for the ledgerId 6197907, the offloaded data will not be cleaned up ``` But the ledger deleted. Then managed ledger failed to open it ``` Error opening ledger for reading at position 6197907:0 ```
…xception --- ### Motivation apache#17915 changes the fix apache#17512 which lead the offload data is deleted when metadata store exception happened. Then the ledger can not be read. The logs shows ``` Failed to update offloaded metadata for the ledgerId 6197907, the offloaded data will not be cleaned up ``` But the ledger deleted. Then managed ledger failed to open it ``` Error opening ledger for reading at position 6197907:0 ```
Fixes #9962
Motivation
Offloaded ledgers can be orphaned on topic deletion.
This is a redo of #15914 which conflicted with concurrently merged #17736 thus resulting in #17889 .
#17736 made a decision to not allow managed ledger trimming for the fenced mledgers because in many case fencing indicates a problems that should stop all operations on mledger. At the same time fencing is used before deletion starts, so trimming added to the deletion process cannot proceed.
After discussion with @eolivelli I introduced new state, FencedForDeletion, which acts as Fenced state except for the trimming/deletion purposes.
Modifications
Topic to be truncated before deletion to delete offloaded ledgers properly and fail if truncation fails.
Verifying this change
local fork tests: dlg99#1
This change added integration tests
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesNothing changed in the options but admin CLI will implicitly run truncate before topic delete.
Documentation
Check the box below or label this PR directly.
Need to update docs?
doc-required
(Your PR needs to update docs and you will update later)
doc-not-needed
(Please explain why)
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)