HDDS-16162. Fail lifecycle task when KeyLifecycleService cannot prepare trash root - #11021
Open
aryangupta1998 wants to merge 7 commits into
Open
HDDS-16162. Fail lifecycle task when KeyLifecycleService cannot prepare trash root#11021aryangupta1998 wants to merge 7 commits into
aryangupta1998 wants to merge 7 commits into
Conversation
added 2 commits
August 12, 2026 14:31
…ries without advancing scan state.
priyeshkaratha
left a comment
Member
There was a problem hiding this comment.
Thanks @aryangupta1998 for working on this. Please check my inline comments.
ChenSammi
reviewed
Aug 19, 2026
priyeshkaratha
approved these changes
Aug 20, 2026
priyeshkaratha
left a comment
Member
There was a problem hiding this comment.
Thanks @aryangupta1998 . Changes LGTM
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.
What changes were proposed in this pull request?
When lifecycle expiration is configured to move expired keys to trash, KeyLifecycleService should fail fast if it cannot prepare the trash root directory for a bucket.
Today, if trash root preparation fails, the task can continue evaluating the bucket even though move-to-trash cannot succeed for that run. This wastes work and delays a clean retry path.
Change:
If trash root initialization fails in moveToTrash, abort the current bucket lifecycle task immediately (propagate failure).
Keep existing per-key rename failure behavior unchanged (log and continue).
Benefits:
Avoids wasted lifecycle evaluation when trash is not writable/initializable.
Makes failure mode explicit and visible in task logs/metrics.
Lets the next periodic lifecycle run retry the bucket from normal state without partial “pretend progress”.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16162
How was this patch tested?
Tested Manually.