Feng Ruohang
b2dca43fda
fix: order value-less replicated Object Lock updates by timestamp
...
CopyObjectHandler rebuilt the destination metadata with the public Object Lock keys stripped (cmd/object-handlers.go:1708) and then restored a value only inside retentionMode.Valid() and legalHold.Status.Valid() (cmd/object-handlers.go:1715 and :1732), so a replica update that carried no retention or legal-hold value never reached the ordering comparison and silently erased whatever the destination held, however new it was; a retention removal that did win recorded no ordering timestamp either, so cmd/bucket-object-lock.go:370 later read an unparseable stored timestamp and let an older retained value back in. Each replica field is now decided on its source timestamp first and its incoming value second, and both restore helpers write the stored timestamp back before returning early on an empty stored value, which is the only way a removal timestamp survives the REPLACE metadata directive. Legal hold stays deliberately asymmetric: S3 has no legal-hold removal, an explicitly empty status is already rejected as invalid, and an absent status conveys no change even when an orphaned timestamp arrives with it, so only a valid ON or OFF can win.
Three inherited defects would have defeated that ordering, so they are fixed here too. The SSE-KMS branch of putOptsFromHeaders built its own ObjectOptions and dropped the parsed lock timestamps, leaving every replicated lock update unordered on a bucket with default KMS encryption; it now carries them. The in-place SSE-C key rotation snapshots the stored reserved metadata into encMetadata before the lock decision exists and merges it back afterwards to preserve the encryption headers, reinstating the ordering timestamp the decision had just replaced; the snapshot is now reconciled with the decision for a trusted replica. Finally, the value-less handling applies only to an actual replica: a trusted peer that sends the replication marker without REPLICA status keeps the previous behaviour, so a REPLACE copy carrying no lock headers still writes a version with no retention and no hold.
Tests: TestAPICopyObjectReplicaAbsentLockFieldsPreserveNewerState, TestAPICopyObjectReplicaRetentionRemovalKeepsOrderingTimestamp, TestAPICopyObjectReplicaObjectLockOrdering, TestAPICopyObjectReplicaRetentionRemovalUnderBucketKMS, TestAPICopyObjectReplicaLockTimestampSurvivesSSECKeyRotation and TestAPICopyObjectMarkerOnlyLeavesObjectLockUnchanged, all on ErasureSD and Erasure. Compatibility: no API, wire or stored-field change, and a field arriving with no source timestamp is unordered and now preserves destination state, so an un-upgraded 0806 peer keeps replicating safely while it still runs the old erasing receiver.
Fixes pgsty/silo#111
Signed-off-by: Feng Ruohang <rh@vonng.com >
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01L7qJqWwy8oFA6aCXWRzXQe
Signed-off-by: Feng Ruohang <rh@vonng.com >
2026-09-05 16:58:11 +08:00
..
2024-06-05 00:51:13 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-08-06 08:46:58 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-08-28 19:39:48 -07:00
2025-10-10 11:57:03 -07:00
2026-09-03 20:54:40 +08:00
2025-03-29 17:56:02 -07:00
2026-08-27 09:05:49 +08:00
2026-09-03 20:54:40 +08:00
2026-08-06 08:46:58 +08:00
2025-08-28 19:39:48 -07:00
2025-09-28 13:59:21 -07:00
2026-08-04 22:48:06 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-05-27 08:19:03 -07:00
2026-08-04 23:02:16 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-08-04 23:02:16 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-03-14 17:39:57 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-03-14 17:39:57 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2024-01-08 15:22:28 -08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-03-14 17:39:57 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2026-08-04 23:02:16 +08:00
2025-08-28 19:39:48 -07:00
2025-04-09 07:28:39 -07:00
2025-01-17 11:19:30 -08:00
2024-01-30 18:11:45 -08:00
2025-09-28 13:59:21 -07:00
2025-03-29 17:56:02 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2026-08-29 09:10:58 +08:00
2026-08-29 01:33:24 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 00:45:02 +08:00
2026-09-02 14:06:56 +08:00
2026-09-03 20:54:40 +08:00
2022-10-24 17:44:15 -07:00
2026-09-02 07:08:02 +08:00
2026-09-03 20:54:40 +08:00
2025-03-29 17:56:02 -07:00
2024-06-10 08:50:49 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2026-08-25 19:24:44 +05:00
2026-08-25 19:24:44 +05:00
2026-09-02 07:20:53 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-05 16:58:11 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2026-09-02 00:03:33 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2024-08-15 05:04:40 -07:00
2025-02-18 08:25:55 -08:00
2025-09-28 13:59:21 -07:00
2026-03-21 13:49:36 +08:00
2025-04-09 07:28:39 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2022-10-24 17:44:15 -07:00
2026-08-06 12:43:58 +08:00
2026-08-29 16:00:21 +08:00
2026-09-03 20:54:40 +08:00
2023-09-18 10:00:54 -07:00
2025-04-09 07:28:39 -07:00
2026-09-03 20:54:40 +08:00
2026-08-06 08:46:58 +08:00
2026-08-06 08:46:58 +08:00
2023-06-19 17:53:08 -07:00
2026-08-24 02:22:20 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2023-07-08 07:31:42 -07:00
2024-03-17 23:42:40 -07:00
2025-08-28 19:39:48 -07:00
2025-09-30 23:06:01 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2024-01-12 23:51:08 -08:00
2026-08-24 01:08:46 +08:00
2024-03-10 01:15:15 -08:00
2024-05-08 17:51:34 -07:00
2026-08-04 23:02:16 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2026-09-02 20:04:57 +08:00
2025-08-28 19:39:48 -07:00
2025-09-28 13:59:21 -07:00
2026-09-02 14:06:56 +08:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-04-09 07:28:39 -07:00
2026-08-04 23:00:21 +08:00
2025-08-28 19:39:48 -07:00
2026-08-04 22:48:06 +08:00
2026-08-04 22:48:06 +08:00
2025-08-28 19:39:48 -07:00
2024-05-14 17:11:04 -07:00
2022-08-04 16:10:08 -07:00
2025-08-28 19:39:48 -07:00
2025-08-28 19:39:48 -07:00
2025-08-28 19:39:48 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2025-08-28 19:39:48 -07:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-10-23 21:05:31 -07:00
2026-08-29 19:28:06 +08:00
2026-08-24 12:20:52 +08:00
2026-09-03 20:54:40 +08:00
2026-08-04 23:00:31 +08:00
2025-10-23 21:05:31 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2024-01-30 18:11:45 -08:00
2026-09-03 20:54:40 +08:00
2024-04-04 05:04:40 -07:00
2026-09-03 20:54:40 +08:00
2026-08-06 08:46:58 +08:00
2026-08-04 23:02:16 +08:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-08-06 08:46:58 +08:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-05-16 07:27:42 -07:00
2025-09-28 13:59:21 -07:00
2026-09-02 02:31:20 +08:00
2026-09-03 20:54:40 +08:00
2026-08-04 23:02:16 +08:00
2024-06-26 00:44:34 -07:00
2026-08-06 17:27:22 +08:00
2026-08-06 19:09:26 +08:00
2023-01-23 16:42:47 +05:30
2024-09-24 10:13:00 -07:00
2025-09-28 13:59:21 -07:00
2024-09-24 10:13:00 -07:00
2024-05-05 09:56:21 -07:00
2025-08-28 19:39:48 -07:00
2025-08-28 19:39:48 -07:00
2024-10-10 16:40:37 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2024-03-04 18:50:24 -08:00
2026-08-06 08:46:58 +08:00
2024-04-05 08:17:08 -07:00
2024-04-05 08:17:08 -07:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2024-05-07 16:55:37 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2023-07-05 10:40:45 -07:00
2026-08-04 23:02:16 +08:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-08-28 19:39:48 -07:00
2025-09-28 13:59:21 -07:00
2025-04-09 07:28:39 -07:00
2024-07-29 11:10:04 -07:00
2025-04-09 07:28:39 -07:00
2023-11-20 17:09:35 -08:00
2025-01-31 11:54:34 -08:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2022-10-24 17:44:15 -07:00
2025-08-28 19:39:48 -07:00
2026-08-26 19:02:25 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2025-04-09 07:28:39 -07:00
2025-05-07 08:37:12 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-05-26 00:06:43 -07:00
2026-09-03 20:54:40 +08:00
2026-08-24 01:08:46 +08:00
2025-10-10 11:57:03 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-03-29 17:56:02 -07:00
2025-09-28 13:59:21 -07:00
2024-09-24 10:13:00 -07:00
2024-05-10 07:50:39 -07:00
2025-06-04 13:45:31 -07:00
2025-09-28 13:59:21 -07:00
2024-05-24 05:50:46 -07:00
2024-05-14 00:25:56 -07:00
2024-03-10 01:15:15 -08:00
2024-05-02 01:20:42 -07:00
2024-04-23 21:10:35 -07:00
2025-02-18 08:25:55 -08:00
2026-09-03 20:54:40 +08:00
2024-06-06 02:36:25 -07:00
2024-05-14 00:27:33 -07:00
2024-08-15 05:04:40 -07:00
2024-05-24 12:29:25 -07:00
2024-06-20 10:55:03 -07:00
2025-03-29 17:56:02 -07:00
2024-04-16 22:10:25 -07:00
2024-03-10 01:15:15 -08:00
2024-06-20 10:55:03 -07:00
2025-02-28 11:33:08 -08:00
2024-08-01 17:55:27 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2025-08-28 19:39:48 -07:00
2025-09-28 13:59:21 -07:00
2026-06-12 21:08:59 +08:00
2025-10-10 11:57:03 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2026-09-03 20:54:40 +08:00
2026-08-26 19:02:25 +08:00
2023-11-20 17:09:35 -08:00
2025-09-28 13:59:21 -07:00
2025-08-28 19:39:48 -07:00
2024-08-28 18:40:52 -07:00
2026-08-27 09:05:49 +08:00
2022-12-23 07:46:00 -08:00
2024-04-04 05:04:40 -07:00
2025-09-28 13:59:21 -07:00
2026-08-29 16:00:21 +08:00
2025-10-10 11:57:03 -07:00
2025-08-28 19:39:48 -07:00
2025-04-09 07:28:39 -07:00
2026-09-05 16:58:11 +08:00
2024-02-21 22:26:06 -08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-08-29 18:18:01 +08:00
2026-09-03 20:54:40 +08:00
2026-08-29 17:23:26 +08:00
2026-08-29 16:00:21 +08:00
2026-08-29 18:21:13 +08:00
2026-08-29 18:15:51 +08:00
2026-08-09 17:52:38 +08:00
2025-04-09 07:28:39 -07:00
2026-08-29 16:00:21 +08:00
2026-09-05 16:58:11 +08:00
2025-07-18 14:56:31 -07:00
2026-09-03 20:54:40 +08:00
2026-08-29 16:00:21 +08:00
2026-08-04 23:00:30 +08:00
2026-09-03 20:54:40 +08:00
2026-08-29 17:32:25 +08:00
2023-09-13 08:14:36 -07:00
2025-09-28 13:59:21 -07:00
2025-02-18 08:25:55 -08:00
2025-08-28 19:39:48 -07:00
2026-08-24 01:08:46 +08:00
2023-09-13 08:14:36 -07:00
2024-04-22 10:49:30 -07:00
2024-02-14 17:09:38 -08:00
2024-02-14 17:09:38 -08:00
2026-08-04 23:02:16 +08:00
2026-09-03 20:54:40 +08:00
2024-09-09 09:58:30 -07:00
2026-08-06 08:46:58 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-09-01 20:50:08 +08:00
2025-08-28 19:39:48 -07:00
2025-08-28 19:39:48 -07:00
2025-10-23 08:10:12 -07:00
2026-08-06 08:46:58 +08:00
2025-08-28 19:39:48 -07:00
2026-08-04 23:02:16 +08:00
2026-08-04 23:02:16 +08:00
2026-09-05 16:58:11 +08:00
2026-09-03 20:54:40 +08:00
2024-07-29 11:10:04 -07:00
2026-09-03 20:54:40 +08:00
2026-08-04 23:02:16 +08:00
2026-09-03 20:54:40 +08:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-08-06 08:46:58 +08:00
2026-09-03 20:54:40 +08:00
2024-02-27 23:02:14 -08:00
2022-10-24 17:44:15 -07:00
2025-02-27 10:43:32 -08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2023-02-13 01:26:38 -08:00
2024-09-04 10:02:39 -07:00
2025-08-28 19:39:48 -07:00
2025-08-28 19:39:48 -07:00
2025-04-09 07:28:39 -07:00
2025-10-10 11:57:35 -07:00
2025-10-10 11:57:35 -07:00
2025-04-09 07:28:39 -07:00
2026-09-03 20:54:40 +08:00
2024-12-13 14:19:12 -08:00
2026-08-27 12:46:47 +05:00
2026-09-02 18:49:16 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-08-28 19:39:48 -07:00
2026-09-02 18:49:16 +08:00
2026-09-02 14:06:56 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2025-05-27 08:19:03 -07:00
2026-06-12 21:08:59 +08:00
2026-06-12 21:08:59 +08:00
2025-08-28 19:39:48 -07:00
2026-06-12 21:08:59 +08:00
2026-08-06 09:28:06 +08:00
2026-06-12 21:08:59 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-06-12 21:08:59 +08:00
2026-08-04 23:00:30 +08:00
2026-08-04 23:00:30 +08:00
2026-09-03 20:54:40 +08:00
2026-08-04 23:00:30 +08:00
2026-08-04 23:02:16 +08:00
2025-08-28 19:39:48 -07:00
2025-09-28 13:59:21 -07:00
2026-04-16 14:46:44 +08:00
2026-08-06 08:46:58 +08:00
2026-09-03 20:54:40 +08:00
2026-09-03 20:54:40 +08:00
2026-08-04 23:02:16 +08:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2024-02-19 14:54:46 -08:00
2024-04-16 22:09:58 -07:00
2025-08-28 19:39:48 -07:00
2025-04-16 00:34:24 -07:00
2025-02-18 08:25:55 -08:00
2026-08-06 08:46:58 +08:00
2026-08-06 08:46:58 +08:00
2026-08-06 08:46:58 +08:00
2026-09-03 20:54:40 +08:00
2025-08-28 19:39:48 -07:00
2025-08-28 19:39:48 -07:00
2026-09-03 20:54:40 +08:00
2026-08-06 08:46:58 +08:00
2024-10-31 15:10:24 -07:00
2025-03-29 17:56:02 -07:00
2025-09-28 13:59:21 -07:00
2025-06-08 09:13:30 -07:00
2026-08-06 08:46:58 +08:00
2024-07-23 09:36:24 -07:00
2024-07-23 09:36:24 -07:00
2025-08-28 19:39:48 -07:00
2025-04-09 07:28:39 -07:00
2023-11-28 22:35:16 -08:00
2026-08-04 23:00:31 +08:00
2026-08-04 23:00:31 +08:00
2023-03-06 08:56:29 -08:00
2025-08-28 19:39:48 -07:00
2025-08-28 19:39:48 -07:00
2024-08-08 08:29:58 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2024-10-22 08:30:50 -07:00
2025-09-28 13:59:21 -07:00
2025-09-28 13:59:21 -07:00
2026-08-04 23:02:16 +08:00
2025-08-28 19:39:48 -07:00
2026-08-24 01:08:46 +08:00
2026-08-24 01:08:46 +08:00
2024-03-01 21:11:03 -08:00
2024-03-01 21:11:03 -08:00
2025-08-28 19:39:48 -07:00
2026-08-04 23:00:21 +08:00