From b5cdd7160043b8bac77731a5c756a0f5a0381a34 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 2 Apr 2026 12:18:56 -0700 Subject: [PATCH] filer.sync: include last error in stall diagnostics --- weed/command/filer_sync.go | 9 +++++++-- weed/replication/sink/filersink/fetch_write.go | 1 + weed/replication/sink/filersink/filer_sink.go | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go index 7b9c85c99..a509deb48 100644 --- a/weed/command/filer_sync.go +++ b/weed/command/filer_sync.go @@ -375,8 +375,13 @@ func doSubscribeFilerMetaChanges(clientId int32, clientEpoch int32, sourceGrpcDi lastLogTsNs = now if offsetTsNs == lastProgressedTsNs { for _, t := range filerSink.ActiveTransfers() { - glog.V(0).Infof(" %s %s: %d bytes received, %s", - t.ChunkFileId, t.Path, t.BytesReceived, t.Status) + if t.LastErr != "" { + glog.V(0).Infof(" %s %s: %d bytes received, %s, last error: %s", + t.ChunkFileId, t.Path, t.BytesReceived, t.Status, t.LastErr) + } else { + glog.V(0).Infof(" %s %s: %d bytes received, %s", + t.ChunkFileId, t.Path, t.BytesReceived, t.Status) + } } } lastProgressedTsNs = offsetTsNs diff --git a/weed/replication/sink/filersink/fetch_write.go b/weed/replication/sink/filersink/fetch_write.go index 35ce29501..d711b76d3 100644 --- a/weed/replication/sink/filersink/fetch_write.go +++ b/weed/replication/sink/filersink/fetch_write.go @@ -335,6 +335,7 @@ func (fs *FilerSink) fetchAndWrite(sourceChunk *filer_pb.FileChunk, path string, glog.V(1).Infof("skip retrying stale source %s for %s: %v", sourceChunk.GetFileIdString(), path, retryErr) return false } + transferStatus.LastErr = retryErr.Error() if isEofError(retryErr) { eofBackoff = nextEofBackoff(eofBackoff) transferStatus.BytesReceived = int64(len(partialData)) diff --git a/weed/replication/sink/filersink/filer_sink.go b/weed/replication/sink/filersink/filer_sink.go index b42c89fab..6bdeb10ee 100644 --- a/weed/replication/sink/filersink/filer_sink.go +++ b/weed/replication/sink/filersink/filer_sink.go @@ -27,6 +27,7 @@ type ChunkTransferStatus struct { Path string BytesReceived int64 Status string // "downloading", "uploading", or "waiting 10s" etc. + LastErr string } type FilerSink struct {