From 5c5f8063d8d5cf6ddc659a488d151b4608c0deb8 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Mon, 6 Jul 2026 22:25:00 +0800 Subject: [PATCH] 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. --- .../bucket/replication/replication_resyncer.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/crates/ecstore/src/bucket/replication/replication_resyncer.rs b/crates/ecstore/src/bucket/replication/replication_resyncer.rs index f3fc517e4..3039d639e 100644 --- a/crates/ecstore/src/bucket/replication/replication_resyncer.rs +++ b/crates/ecstore/src/bucket/replication/replication_resyncer.rs @@ -2052,8 +2052,22 @@ pub async fn replicate_object(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() {