Skip to content

gazctl shards prune: treat missing delete permission as non-fatal - #488

Merged
williamhbaker merged 1 commit into
masterfrom
wb/prune-no-perm-error
Jul 15, 2026
Merged

gazctl shards prune: treat missing delete permission as non-fatal#488
williamhbaker merged 1 commit into
masterfrom
wb/prune-no-perm-error

Conversation

@williamhbaker

Copy link
Copy Markdown
Contributor

Recovery-log pruning is best-effort cleanup of superseded fragments. When a tenant brings their own storage bucket without granting delete permission, every prune fails with AccessDenied on the recovery/ prefix. This hard-errors the command (exit 1) and fires recurring alerts for a bucket we can't clean up and don't otherwise depend on.

Classify a failed fragment removal: authorization failures (missing delete permission, 403, bucket-not-found) are now logged and counted in a new non-fatal permissionDenied metric, so the prune still completes successfully. All other removal errors retain the existing failedToRemove behavior and continue to fail the command, so genuine problems keep surfacing.

This reuses the per-backend IsAuthError classification already used by fragment.Persist for graceful shutdown, exposed via a new fragment.IsAuthError helper.

Recovery-log pruning is best-effort cleanup of superseded fragments.
When a tenant brings their own storage bucket without granting delete
permission, every prune fails with AccessDenied on the recovery/ prefix.
This hard-errors the command (exit 1) and fires recurring alerts for a
bucket we can't clean up and don't otherwise depend on.

Classify a failed fragment removal: authorization failures (missing
delete permission, 403, bucket-not-found) are now logged and counted in
a new non-fatal permissionDenied metric, so the prune still completes
successfully. All other removal errors retain the existing failedToRemove
behavior and continue to fail the command, so genuine problems keep
surfacing.

This reuses the per-backend IsAuthError classification already used by
fragment.Persist for graceful shutdown, exposed via a new
fragment.IsAuthError helper.

@dgreer-dev dgreer-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good.

@williamhbaker
williamhbaker merged commit 42c2cc1 into master Jul 15, 2026
1 check passed
@williamhbaker
williamhbaker deleted the wb/prune-no-perm-error branch July 15, 2026 21:15
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.

2 participants