Repository navigation
fix(s3): reclaim the replaced object version when the deletes queue refuses it - #14766
Conversation
…he deletes queue is down PutObject and CompleteMultipartUpload on an existing key write the new version under a fresh path and hand the old one to the deletes queue. A refused or failed enqueue is swallowed, so the old object stays in storage with no file row pointing at it. The test breaks the deletes queue and asserts the bucket holds exactly one object after each overwrite. Runs in the queue lane, which now also triggers on Storage changes.
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
…efuses it An overwrite publishes the new version first and hands the old path to the deletes worker, because a backend delete can wait on an active GET of the same object. When the enqueue threw or returned false the old object was left in storage with no row pointing at it. Delete it inline in that case and log loudly only if storage refuses too; the request still succeeds, since the replacement is already live. The row build in PutObject now sits inside the try, so a failing size lookup no longer orphans the new object, and cleanup errors no longer mask the original failure.
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
|
Review complete. No issues found — approved ✅. The PR hardens
Reviewed commit: bf5d757 |
🟢 Tier S · Ready to mergeS3 object replacement now falls back to deleting the prior immutable storage path inline when the deletes queue refuses publication, and logs cleanup failures without changing the completed request. The PUT file-size lookup is also inside the row-write cleanup boundary, and an end-to-end queue-outage test covers PUT and multipart overwrites in the queue-retry lane.
📂 Walkthrough · 3
Reviewed |
fix(s3): reclaim the replaced object version when the deletes queue refuses it (cherry picked from commit a704b1b)
Overwriting an object through the S3 API (PutObject on an existing key, CompleteMultipartUpload) writes the new version under a fresh path, updates the file row, then enqueues
DELETE_TYPE_FILESfor the old path. A failed enqueue was swallowed and afalsereturn was ignored, so the old object stayed in storage with nothing pointing at it.falseConsole::warningConsole::errorwith the path, request still 200getFileSize()ran outside thetrytryThe queue stays the first choice: a backend delete can wait on an active GET of the same object, and the replacement is already live.
Test:
S3CustomServerTest::testOverwriteWithoutDeletesQueueputs a string at the deletes queue key (every push fails with WRONGTYPE), overwrites by PUT and by multipart, and asserts the bucket holds one object. It breaks a queue for the whole stack, so it is in thequeueRetrylane, which now also runs for Storage changes.Related: appwrite-labs/cloud#6628