Skip to content

fix(TC-1354): size S3 block deletes with HeadObject - #337

Merged
samgbafa merged 1 commit into
mainfrom
skgbafa/tc-1354-s3-remove-head-object
Oct 17, 2026
Merged

samgbafa merged 1 commit into
mainfrom
skgbafa/tc-1354-s3-remove-head-object

Conversation

@samgbafa

Copy link
Copy Markdown
Contributor

Linear: TC-1354

Problem

S3BlockStore::remove called GetObjectAttributes without an attribute list. S3 requires x-amz-object-attributes, and MinIO rejects the call with InvalidArgument: Invalid attribute name specified., so every S3 block delete returned an error.

No code on main or in the released node calls remove today (kv/del is logical and leaves blobs in place), so this does not affect production now. It matters as soon as something calls remove, such as #336 or a later cleanup.

Change

  • remove now gets the size and checks existence with HeadObject, then deletes. A missing object still returns Ok(None). The space size drops by the object's stored length.
  • The object_size and delete helpers match feat(TC-887): seal KV blocks in the S3 store (S3c, stacked on #333) #336's, so the TC-887 stack rebases with no logic conflict.
  • New tinycloud-node-server/tests/s3_block_store.rs runs against the at-rest harness's native MinIO. It is #[ignore]d by default, and the at-rest harness CI job runs it with the harness env loaded.

Evidence (local, native MinIO RELEASE.2025-09-07T16-13-09Z, no Docker)

  • RED on main 951d2f5: remove_deletes_the_block_and_releases_its_size fails with InvalidArgument: Invalid attribute name specified.
  • GREEN with this change. The test covers four things: removing a block, a sibling block surviving, the size dropping by exactly the removed length, and a second remove (or a remove of a never-stored hash) returning None without changing the size.
  • cargo test -p tinycloud-node --lib storage:: passes, cargo fmt --all -- --check is clean, and RUSTFLAGS=-Dwarnings cargo clippy -p tinycloud-node --all-targets is clean.

S3BlockStore::remove called GetObjectAttributes without an attribute
list, which S3 and MinIO reject, so every S3 block delete errored.
Use HeadObject for the size and existence check, as #336 does. A
missing object is still Ok(None), and the quota drops by the stored
length. Adds a MinIO-backed test run in the at-rest harness CI job.
@samgbafa

Copy link
Copy Markdown
Contributor Author

APPROVE: see TC-1354 (head e8a176abaf7075e2ac17fbeba6b82a59604dcd0e)

@samgbafa
samgbafa merged commit 7ce99c5 into main Oct 17, 2026
22 checks passed
samgbafa added a commit that referenced this pull request Oct 17, 2026
#337 fixed S3 remove sizing with HeadObject; this branch already sizes
and deletes through HeadObject with generation keys, operation locks and
confirmed-absence refunds, so keep its remove and drop main's now-unused
helpers. Main's TC-1354 MinIO test uses generation 0 (the bare key).
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