You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Aryan Gupta (Jira)" <ji...@apache.org> on 2026/08/20 09:35:00 UTC
[jira] [Updated] (HDDS-16162) Fail lifecycle task when KeyLifecycleService cannot prepare trash root
[ https://issues.apache.org/jira/browse/HDDS-16162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aryan Gupta updated HDDS-16162:
-------------------------------
Description:
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”.
was:
When lifecycle expiration is configured to move expired keys to trash, {{KeyLifecycleService}} currently clears the pending key list even if {{moveToTrash}} fails. It can then save lifecycle scan state past those keys, so the failed keys are not retried until a later full scan.
We should avoid marking failed trash moves as processed. If moving expired keys or directories to trash fails, the lifecycle task should fail for that bucket without saving scan state past the failed entries. The next lifecycle run can then retry them from the previous scan position.
h2. Benefits
* Preserves trash semantics: keys are not directly deleted when trash move fails.
* Prevents lifecycle from silently skipping expired keys.
* Retries failed keys sooner, instead of waiting for a full bucket scan to complete.
* Keeps scan state accurate: only successfully handled entries are marked as progress.
> Fail lifecycle task when KeyLifecycleService cannot prepare trash root
> ----------------------------------------------------------------------
>
> Key: HDDS-16162
> URL: https://issues.apache.org/jira/browse/HDDS-16162
> Project: Apache Ozone
> Issue Type: Improvement
> Reporter: Aryan Gupta
> Assignee: Aryan Gupta
> Priority: Major
> Labels: pull-request-available
>
> 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”.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org