mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 00:38:16 +00:00
fix(replication): log (not swallow) resync status persistence failure (backlog#799 B23) (#4320)
fix(replication): don't silently swallow resync status persistence failure (backlog#799 B23) After a resync computes a new replication status, it persists it via `put_object_metadata` but discarded the `Err` case (`if let Ok(u) = ...`). A failure left the object's on-disk replication status disagreeing with the resync result with no signal at all. Log the failure at warn level instead. Refs backlog#799 (B23), tracked in rustfs/backlog#863.
This commit is contained in:
@@ -2052,8 +2052,22 @@ pub async fn replicate_object<S: ReplicationStorage>(roi: ReplicateObjectInfo, s
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
if let Ok(u) = storage.put_object_metadata(&bucket, &object, &popts).await {
|
||||
object_info = u;
|
||||
match storage.put_object_metadata(&bucket, &object, &popts).await {
|
||||
Ok(u) => object_info = u,
|
||||
Err(e) => {
|
||||
// Persisting the resynced replication status failed. Don't swallow
|
||||
// it silently — the object's on-disk status now disagrees with the
|
||||
// resync result and needs operator visibility (backlog#799 B23).
|
||||
warn!(
|
||||
event = EVENT_RESYNC_TARGET_OPERATION_FAILED,
|
||||
component = LOG_COMPONENT_ECSTORE,
|
||||
subsystem = LOG_SUBSYSTEM_REPLICATION_RESYNC,
|
||||
bucket = %bucket,
|
||||
object = %object,
|
||||
error = %e,
|
||||
"Failed to persist resynced replication status metadata"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(stats) = runtime_sources::replication_stats() {
|
||||
|
||||
Reference in New Issue
Block a user