Repository navigation
feat(conformance): support external Object Lock fixtures - #1663
Merged
Merged
Conversation
Provision setup.buckets[].object_lock = true on external endpoints by creating buckets with x-amz-bucket-object-lock-enabled: true, verifying both ?object-lock and ?versioning readback as Enabled (failing closed and rolling back on refusal), tracking setup object versions by exact version ID, and treating Object Lock object targets as versioned for stale control socket retry safety. Authored writes against Object Lock buckets require --allow-external-writes, under which cleanup deletes versions with x-amz-bypass-governance-retention: true and lifts Legal Hold (OFF) on 403 for object versions before retrying DELETE. Cases that would apply irremovable COMPLIANCE object retention are refused at preflight before any remote contact so they never wedge a bucket. Closes #1418
This was referenced Nov 27, 2026
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
Completes the final external-fixture slice of #1418 (
setup.buckets[].object_lock = true), unblocked by #1512 (d7dbba80):crates/conformance/src/conn/external_fixture/object_lock.rs,lifecycle.rs,external_fixture.rs):object_lock = truebuckets withx-amz-bucket-object-lock-enabled: true(preserving region XMLcontent-type: application/xmlfor non-default regions) and strictly verifies bothGET /{bucket}?object-lock(<ObjectLockEnabled>Enabled</ObjectLockEnabled>) andGET /{bucket}?versioning(<Status>Enabled</Status>), failing closed withSutError::Refusedand rolling back the created bucket on any mismatch or malformed XML.object_lockdeclarations (object_lock = truewithversioning = "disabled"orabsent = true, or non-booleanobject_lock/absent) before any remote contact.x-amz-version-idviaput_fixture_versionand treats Object Lock object targets as versioned inis_versioned_object_targetso stale keep-alive control sockets never retryPUTand orphan duplicate versions.writes.rs,versioned.rs,object_lock.rs,lifecycle.rs):--allow-external-fixturesalone and clean up setup versions by exact encodedversionIdwithout governance bypass.--allow-external-writes(excluded from the non-write exact-version shortcut even whenversioning = "enabled"is also declared).--allow-external-writes, cleanup deletes owned and listed versions in Object Lock buckets withx-amz-bypass-governance-retention: trueand, when aVersion(never aDeleteMarker) still answers403, lifts its legal hold (PUT ...?legal-hold&versionId=...with<Status>OFF</Status>andContent-MD5) before retryingDELETEonce, failing closed and retaining bucket ownership on any non-204 outcome.COMPLIANCEobject retention (viaPutObjectRetentionXML,x-amz-object-lock-mode: COMPLIANCEheader,PostObjectform field, or bucketCOMPLIANCEDefaultRetentionpaired with an object write) are refused at preflight before any remote contact so they never wedge an external endpoint; bucket-onlyDefaultRetentionwithout object writes remains runnable.conformance/README.md,crates/conformance/MAP.md):538 (60.1%)to537 (60.0%)(verified bywrites_tests::the_readme_states_the_externally_runnable_share_of_this_corpusbecausec-lock-0008is now skipped at preflight instead of wedging cleanup).Closes #1418
Live External
compat-sutAcceptanceVerified against freshly built
compat-suton an ephemeral port over private temp data directories (process terminated and temp dirs removed after each scenario):--profile rustfs --allow-external-fixtures --filter c-lock-): 0 prepare/finish failures,c-lock-0028passed,c-lock-0012/c-lock-0013reached execute (hitting therustfs-profile<HostId>error-body difference),remaining_entries=[].--profile rustfs --allow-external-fixtures --allow-external-writes --filter c-lock-): 0 prepare/finish failures,c-lock-0009/c-lock-0027/c-lock-0028passed,c-lock-0005(GOVERNANCE) andc-lock-0006(LegalHold=ON) executed and cleaned up cleanly,c-lock-0008skipped atpreflight,remaining_entries=[].compat-sut --fixed-time 2026-01-02T03:04:05Z,--endpoint-fixed-time 2026-01-02T03:04:05Z --allow-external-fixtures --allow-external-writes --filter c-lock-): 0 prepare/finish failures, 11 passed (c-lock-0009,c-lock-0027,c-lock-0028,c-lock-0031–c-lock-0035,c-lock-0038,c-lock-0039,c-lock-0041),c-lock-0040/c-lock-0042multi-versionGOVERNANCE/LegalHoldcleaned up cleanly,c-lock-0008/c-lock-0036skipped atpreflight,remaining_entries=[].Mutation Proofs (10/10 Killed, Restored Byte-Identically)
All 13 loopback tests (
crates/conformance/src/conn/external_fixture/object_lock_tests.rs, 10 negative / 3 positive) were written TDD red-first (12 failed, 1 two-directional positive control passed) and verified against 10 deliberate red mutations:x-amz-bucket-object-lock-enabled: trueonCreateBucket-> killed byread_only_object_lock_setup_proves_lock_and_versioning_and_cleans_exact_versionGET ?object-lockreadback check -> killed byunproved_object_lock_readback_refuses_and_rolls_back_the_bucketGET ?versioningreadback check -> killed byunproved_versioning_readback_after_object_lock_refuses_and_rolls_back_the_bucketx-amz-bypass-governance-retention: truein locked version cleanup -> killed byexternal_writes_cleanup_bypasses_governance_lifts_legal_hold_and_removes_delete_markers403->PutObjectLegalHold(OFF)recovery -> killed byexternal_writes_cleanup_bypasses_governance_lifts_legal_hold_and_removes_delete_markersandfailed_legal_hold_clear_or_still_forbidden_delete_retains_bucket_ownershipis_versionguard on403legal-hold clear -> killed bydelete_marker_403_does_not_attempt_legal_hold_clear_and_retains_bucket_ownershipCOMPLIANCErefusal inwrites.rs-> killed bycompliance_object_retention_writes_are_refused_at_preflight_before_contactobject_lock = truewithversioning = "disabled"inplan()-> killed byobject_lock_with_disabled_versioning_or_absent_or_non_bool_is_rejected_before_connectingobject_lockexclusion in non-write exact-version preflight -> killed byauthored_writes_on_object_lock_bucket_are_refused_without_allow_external_writesowned.object_lockinis_versioned_object_target-> killed bystale_control_socket_does_not_retry_put_to_object_lock_object_targetVerification
cargo fmt --all --check— passedcargo clippy --workspace --all-targets -- -D warnings— passedRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps— passedcargo test --workspace— passed (149/149external_fixture, 24/24keys, full workspace suite green)cargo xtask verify --crate rustfs-gateway-conformance— passed (prebuild 25.19s, prepared loop 23.59s <= 30s)check_module_doc2292/2292,check_license_headers,check_file_size,check_map_files20/20,check_protected_files,check_corpus_change_reviewed,check_known_diffs_ratchet, etc.)Checklist
unsafe, no.unwrap()/.expect()on external input, no secrets loggedcompat-sutacceptance passedRole Verdicts
crates/conformance/src/conn/external_fixture/object_lock.rs), and lifecycle/writes wiring — no break foundobject_lock_tests.rs, 10 negative / 3 positive), all 10 deliberate red mutations M1–M10,conformance/README.mdrunnable-share ratchet (537 (60.0%)), and livecompat-sutzero-leak acceptance — no break found