Skip to content

HDDS-16162. Fail lifecycle task when KeyLifecycleService cannot prepare trash root - #11021

Open
aryangupta1998 wants to merge 7 commits into
apache:masterfrom
aryangupta1998:HDDS-16162
Open

HDDS-16162. Fail lifecycle task when KeyLifecycleService cannot prepare trash root#11021
aryangupta1998 wants to merge 7 commits into
apache:masterfrom
aryangupta1998:HDDS-16162

Conversation

@aryangupta1998

@aryangupta1998 aryangupta1998 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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.

@priyeshkaratha priyeshkaratha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aryangupta1998 for working on this. Please check my inline comments.

@aryangupta1998 aryangupta1998 changed the title HDDS-16162. KeyLifecycleService should retry failed move-to-trash entries without advancing scan state. HDDS-16162. Fail lifecycle task when KeyLifecycleService cannot prepare trash root Aug 20, 2026

@priyeshkaratha priyeshkaratha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aryangupta1998 . Changes LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants