Repository navigation
Conversation
Attribute and lock down the intermittent aws-sdk-java-v2 `S3Client.putObject versions:S3Exception/500/-` failure (#1083) and eliminate false-positive `fs_storage_error` noise observed during the first post-#1666 e2e-mint run (46083521885): - Root cause (reproduced on c93c794): Mint's `uploadMultiPartAsync_test` (`S3TestUtils.java:126`) invokes `s3AsyncClient.completeMultipartUpload` without awaiting its `CompletableFuture`, immediately followed by `uploadObjectVersions_test` issuing three `PutObject` calls to the same unversioned `(bucketName, "testobject")`. Before #1660 (`7ee712e3`), `CompleteMultipartUpload` released `version_lock`, removed the 50 MiB tombstone directory, and then wrote `v-*/completion` outside the lock. When a concurrent `PutObject` ran `remove_null_versions` (`remove_dir_all`) on that same version directory, `record_completion` created `completion` mid-removal, failing `rmdir` with `ENOTEMPTY` (`500 InternalError`) and leaving an orphaned `v-*` directory containing only `["completion"]` (with `record` already unlinked), causing every AWS SDK v2 retry to fail permanently with `500 InternalError`. - #1660 (`7ee712e3`) structurally eliminated this race by staging the `completion` receipt inside `.tmp-*` before atomic rename and holding `version_lock` through tombstone removal. Post-#1660/#1666 Mint run 46083521885 passed `aws-sdk-java-v2` 7 PASS / 0 FAIL with zero HTTP 5xx responses across all 15 SDKs. - Regression tests: add a deterministic lock-and-staging invariant test (`versioning::tests::n_complete_multipart_stages_receipt_and_blocks_put_until_tombstone_removed`) and a live signed `S3Service` concurrent completion-vs-PUT/GET test (`multipart_replay::n_unawaited_multipart_completion_racing_put_and_get_never_returns_500`). - Diagnostic hygiene: short-circuit `io::ErrorKind::NotFound` in `FsBackend::read_upload_record` before calling `decode_upload_record` so expected `404 NoSuchUpload` lookups no longer fire the process-wide `storage_error` observer (`crates/fs/src/uploads.rs:568`), verified by `storage_error_observer::isolated_child_probe`. Closes #1083
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Attributes and locks down the intermittent
aws-sdk-java-v2S3Client.putObject versions:S3Exception/500/-failure tracked in #1083, and fixes the false-positivefs_storage_errordiagnostic observed in the first post-#1666e2e-mintrun (46083521885).Root Cause & Attribution (reproduced on
c93c7940)minio/mint@12559d50),S3TestUtils.uploadMultipartObjectAsync(S3TestUtils.java:126) callss3AsyncClient.completeMultipartUpload(completeMultipartUploadRequest)without.get()or.join(). Immediately afterward,uploadObjectVersions_test(S3Client.putObject versions) sends threePutObjectoverwrites to the same unversioned(bucketName, "testobject")while the 50 MiB backgroundCompleteMultipartUploadis still executing.1fa1c4af, 2026-09-29 — one day before the first occurrence on314233c8) and feat(fs): coordinate shared-root version mutations and null recovery #1660 (7ee712e3, 2026-11-27),CompleteMultipartUploadreleasedversion_lockafterpublish_object_if, deleted the 50 MiB.complete-*tombstone directory, and then rancompletion_replay::record_completion(&published.directory, ...)outsideversion_lock.PutObjectsuperseded that null version during the tombstone-removal window,remove_null_versions(remove_dir_all) unlinkedbodyandrecordwhilerecord_completioncreatedcompletioninside the samev-*directory.rmdirfailed withENOTEMPTY(500 InternalError) and left an orphanedv-*directory containing only["completion"]with norecord, causing every subsequent AWS SDK v2 retry to fail permanently with500 InternalError.c93c7940in 16 iterations (v-00000000000000001482-... -> files ["completion"],PutObject->500 InternalError, retryPutObject->500 InternalError).7ee712e3) structurally eliminated the race by stagingcompletioninside.tmp-*before atomic rename (write_staged_completion_receipt) and holdingversion_lockthroughremove_dir_all(&tombstone). Post-feat(fs): coordinate shared-root version mutations and null recovery #1660/feat(mint): capture closed-vocabulary server 5xx diagnostics #1666e2e-mint.ymlrun 46083521885 onmain(6c1c8299) passedaws-sdk-java-v27 PASS / 0 FAIL / 0 NAwith zero HTTP5xxresponses across all 15 SDKs.Changes in this PR
crates/fs/src/versioning/tests.rs: addn_complete_multipart_stages_receipt_and_blocks_put_until_tombstone_removedto deterministically assert thatcompletionis staged inside the published version directory before tombstone cleanup/lock release, that a concurrentPutObjectwaits whileversion_lockis held across tombstone cleanup, and that the superseded version and.complete-*tombstone are removed cleanly with no orphanv-*/completiondirectory.crates/fs/tests/crud/multipart_replay.rs: addn_unawaited_multipart_completion_racing_put_and_get_never_returns_500exercising unawaited signedCompleteMultipartUploadracing concurrent signedPutObjectandGetObjectcalls on the same unversioned key.crates/fs/src/uploads.rs+crates/fs/tests/crud/storage_error_observer.rs: short-circuitio::ErrorKind::NotFoundinFsBackend::read_upload_recordbefore callingdecode_upload_recordso expected404 NoSuchUploadlookups (observed asfs_storage_error crates/fs/src/uploads.rs:568 (x2)in run 46083521885) no longer trigger the process-widestorage_errorobserver.s3scheck: does not apply tos3s(rustfs-gateway-fsis this repository's local filesystem reference backend and diagnostic observer).Closes #1083
Verification
Mutation Proofs
write_staged_completion_receiptincrates/fs/src/versioning/publish.rs->n_complete_multipart_stages_receipt_and_blocks_put_until_tombstone_removedfailed (completion receipt must be staged before atomic rename and lock release).guardbeforecomplete_remove/ tombstone removal incrates/fs/src/completion.rs->n_complete_multipart_stages_receipt_and_blocks_put_until_tombstone_removedfailed (PutObject must wait while CompleteMultipartUpload still holds version_lock during tombstone cleanup).remove_safe_dir(&self.tombstone)inTombstoneState::Removeincrates/fs/src/staging.rs->n_complete_multipart_stages_receipt_and_blocks_put_until_tombstone_removedfailed (tombstone leaked: [".complete-..."]).std::fs::remove_dir_all(path)incrates/fs/src/versioning/null_recovery.rs::remove_version_dir_strict->n_unawaited_multipart_completion_racing_put_and_get_never_returns_500failed (assertion left == right failed: iter 0: expected a single healthy null version directory, left: 5, right: 1).NotFoundshort-circuit incrates/fs/src/uploads.rs::read_upload_record->storage_error_observer::set_storage_error_observer_installs_once_and_fires_only_on_failurefailed (healthy operations must not notify storage_error observer).Role Verdicts
Breaking Change
Checklist
cargo xtask verify)went red. The PR description names which ones
BREAKINGand a migration pathunsafeintroducedinventory/linkmeintroduced#[non_exhaustive]added to a DTO