You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve existing Object Lock retention during site-replication bucket adoption #78
When site replication adopts a pre-existing same-name bucket, PeerBucketMakeWithVersioningHandler handles BucketExists and then unconditionally executes:
If the existing bucket already has a full Object Lock configuration with DefaultRetention, this overwrites it with the minimal ObjectLockEnabled=Enabled document before normal status/heal reconciliation. The local bucket's retention policy is silently downgraded during adoption.
This is distinct from #76: #76 routes Object Lock metadata through the wrong wire field during initial sync and remote heal. This issue concerns destructive handling of an already-existing local bucket before that metadata event is applied.
Proposed behavior
When opts.LockEnabled is true, write the minimal enabled config only if meta.ObjectLockConfigXML is empty.
Preserve any existing full Object Lock configuration and its ObjectLockConfigUpdatedAt; let explicit metadata status/heal resolve cross-site conflicts.
When writing the minimal default, do not assign a new current-time Object Lock timestamp. Leave it at the creation-default state so heal can recognize it as bootstrap metadata rather than a newer policy.
Keep existing versioning enablement behavior; CreatedAt canonicalization is outside this issue unless a reproduction proves it contributes to the retention overwrite.
Tests
Adopt an existing bucket with a full GOVERNANCE/COMPLIANCE DefaultRetention config: exact XML and timestamp remain unchanged.
Adopt an existing bucket with no Object Lock config while the source requires locking: minimal enabled config is written.
Reload metadata and confirm the minimal config's default timestamp equals bucket Created rather than adoption time.
Run focused site-replication/Object Lock tests, race tests, full cmd, and remote CI.
Ordering
Land after #76, which provides the corrected Object Lock event/test fixtures, and before the broader #77 timestamp/heal work.
PR #90 is stacked on #76. It preserves full Object Lock retention and enabled custom versioning, bootstraps missing configs, and deliberately enables suspended/invalid versioning. CreatedAt ordering remains outside this PR under #77-A.
Resolved by #90. Bucket adoption now preserves existing Object Lock and enabled custom versioning, initializes missing state, and repairs suspended/invalid state. Final main 1be684b passed Go CI, VulnCheck, the full local race suite, and Test Release run 33254848256.
Activity
Vonng commentedon Aug 29, 2026
PR submitted
PR #90 is stacked on #76. It preserves full Object Lock retention and enabled custom versioning, bootstraps missing configs, and deliberately enables suspended/invalid versioning. CreatedAt ordering remains outside this PR under #77-A.
Vonng commentedon Aug 29, 2026
Resolved by #90. Bucket adoption now preserves existing Object Lock and enabled custom versioning, initializes missing state, and repairs suspended/invalid state. Final main 1be684b passed Go CI, VulnCheck, the full local race suite, and Test Release run 33254848256.