fix(replication): propagate metadata changes (#5635)

Preserve metadata replication operations in the durable MRF and route tagging, retention, and legal-hold updates through the existing full-object replication transport. Keep ACL propagation outside the contract because the current object model has no durable object ACL state.

Refs #1616
This commit is contained in:
cxymds
2026-08-02 21:50:24 +08:00
committed by GitHub
parent 2cc7443067
commit 779b5a49ea
8 changed files with 294 additions and 156 deletions
+24
View File
@@ -164,6 +164,7 @@ mod tests {
replication_etags_match, target_is_newer_than_source_null_version,
};
use crate::filemeta::{ReplicationAction, ReplicationType};
use crate::http::AMZ_OBJECT_LOCK_MODE;
use std::collections::HashMap;
use time::{Duration, OffsetDateTime};
@@ -267,4 +268,27 @@ mod tests {
ReplicationAction::Metadata
);
}
#[test]
fn replication_action_detects_tags_and_object_lock_metadata_differences() {
let mut source_metadata = HashMap::new();
source_metadata.insert(AMZ_OBJECT_LOCK_MODE.to_string(), "GOVERNANCE".to_string());
let source = ReplicationSourceObject {
user_tags: "a=1&b=2",
user_defined: &source_metadata,
..source_object(&source_metadata)
};
let target_metadata = HashMap::new();
let target = ReplicationTargetObject {
tag_count: 1,
metadata: Some(&target_metadata),
..target_object(&target_metadata)
};
assert_eq!(
replication_action_for_target(&source, &target, ReplicationType::Metadata),
ReplicationAction::Metadata
);
}
}