Skip to content

fix: preserve tiered metadata on incomplete bulk-delete replies - #277

Open
perfloop[bot] wants to merge 4 commits into
mainfrom
perfloop-pr-open-p9w9nt1ehx
Open

perfloop[bot] wants to merge 4 commits into
mainfrom
perfloop-pr-open-p9w9nt1ehx

Conversation

@perfloop

@perfloop perfloop Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Tiered mode treats local metadata as authoritative for locally stored objects. For parsed DeleteObjects requests, an incomplete or unparseable 2xx result no longer authorizes removal of the pre-forward metadata versions. Complete, parsed results retain the existing per-key error handling and version guard. Proxy-mode conservative invalidation is unchanged.

TestTieredBulkDeleteTruncatedFailurePreservesLocalObject checks the same failure scenarios before and after the handler change.

This condition holds with this change and does not hold at 6c04b1ebf459e45f9b5289d13312def9fca3bf2f: For POST /{bucket}?delete in tiered mode, a valid request containing a non-versioned local-tier key with successful pre-forward metadata lookup and unchanged, unexpired metadata must not remove its captured metadata after an incomplete or unparseable 2xx upstream result; a key whose upstream deletion was rejected remains readable through validated GET and HEAD..

TestTieredBulkDeleteResultControls passes on the final source. It covers complete all-error and quiet-success replies and a newer local PUT during forwarding. The existing TestHandleDeleteObjects_UnparseableResultInvalidatesAllAndPreservesResponse also passes on the final source and retains proxy-mode malformed-result coverage. The small adapter used for the source comparison is not part of this pull request; the native tests are.

make build and make lint-ci passed, as did the focused proxy tests. The full make test suite remains target-CI work.


Generated by Perfloop.


Note

Medium Risk
Changes authoritative metadata removal for tiered bulk deletes; incorrect gating could leave stale objects or drop metadata too aggressively, but scope is limited to DeleteObjects convergence with new regression tests.

Overview
Tiered DeleteObjects no longer drops local metadata on ambiguous upstream 2xx bodies. Post-success reconciliation now runs convergeTieredDelete only when the captured response is complete and the DeleteResult XML parses; truncated reads, read errors after a partial body, and malformed XML leave pre-forward metadata and validated GET/HEAD behavior unchanged. Per-key success vs <Error> handling is unchanged when the result is complete and parseable.

Proxy-mode bulk delete behavior is unchanged: it still invalidates before forward and, after 2xx, can conservatively fence every requested key when the result cannot be parsed. Docs in README.md and docs/tiered-mode.md spell out the split between proxy invalidation and tiered authoritative metadata.

Adds proxy/tiered_bulk_delete_test.go for incomplete/unparseable failures, all-error replies, quiet success, and a racing local PUT during an in-flight delete.

Reviewed by Cursor Bugbot for commit 7873c1b. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previous test coverage gap addressed.

Summary

Tiered bulk deletes preserve local metadata when the upstream reply is incomplete or cannot be parsed. Proxy-mode invalidation stays unchanged.

  • Tiered bulk deletes keep local metadata when upstream replies are incomplete.

Reviews (2) · Last reviewed commit: "fix: preserve tiered metadata on incompl..." · Reviewed by Greptile

Comment thread proxy/tiered_bulk_delete_test.go Outdated
Comment on lines +159 to +165
const rejectedPrefix = `<DeleteResult><Error><Key>local-key</Key><Code>AccessDenied</Code></Error>`
tests := []struct {
name string
readErr error
}{
{name: "truncated response read", readErr: io.ErrUnexpectedEOF},
{name: "fully received malformed result"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Completeness check lacks independent coverage

Both failure cases use XML with an unclosed DeleteResult, so both would still pass if capture.Complete were removed from the new guard. The forwarder can capture parseable XML before a final read error, so this leaves that protection untested.

Add a case that returns <DeleteResult/> followed by io.ErrUnexpectedEOF, then checks that metadata and GET/HEAD results stay unchanged.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Response to this feedback.

This suggestion matches the existing test style and is valid. The current cases do not distinguish an incomplete response that is already parseable from an unparseable body, so I’ll add the requested <DeleteResult/> plus io.ErrUnexpectedEOF case and verify the metadata and GET/HEAD behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 7873c1bcd60dbee6f5b9d9dab187f97e68ec50cd. Response to this feedback.

Added a parseable <DeleteResult/> response that ends with io.ErrUnexpectedEOF to TestTieredBulkDeleteTruncatedFailurePreservesLocalObject. The test asserts that this incomplete capture leaves the metadata and validated GET/HEAD results unchanged.

Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
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.

1 participant