From 365e51f174c5e2eca46ad4c9f620579db6820e6d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 10 Feb 2026 19:00:12 -0800 Subject: [PATCH] Tweak filersink stale logging --- .../replication/sink/filersink/fetch_write.go | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/weed/replication/sink/filersink/fetch_write.go b/weed/replication/sink/filersink/fetch_write.go index 407d44f27..f0399c577 100644 --- a/weed/replication/sink/filersink/fetch_write.go +++ b/weed/replication/sink/filersink/fetch_write.go @@ -141,7 +141,7 @@ func (fs *FilerSink) fetchAndWrite(sourceChunk *filer_pb.FileChunk, path string, return nil }, func(uploadErr error) (shouldContinue bool) { if fs.hasSourceNewerVersion(path, sourceMtime) { - glog.V(0).Infof("skip retrying stale source %s for %s: %v", sourceChunk.GetFileIdString(), path, uploadErr) + glog.V(1).Infof("skip retrying stale source %s for %s: %v", sourceChunk.GetFileIdString(), path, uploadErr) return false } glog.V(0).Infof("upload source data %v: %v", sourceChunk.GetFileIdString(), uploadErr) @@ -182,19 +182,18 @@ func (fs *FilerSink) targetPathToSourcePath(targetPath string) (util.FullPath, b return "", false } - sourceRoot := strings.TrimSuffix(fs.filerSource.Dir, "/") - targetRoot := strings.TrimSuffix(fs.dir, "/") - targetPath = strings.TrimSuffix(targetPath, "/") - if sourceRoot == "" { - sourceRoot = "/" - } - if targetRoot == "" { - targetRoot = "/" - } - if targetPath == "" { - targetPath = "/" + normalizePath := func(p string) string { + p = strings.TrimSuffix(p, "/") + if p == "" { + return "/" + } + return p } + sourceRoot := normalizePath(fs.filerSource.Dir) + targetRoot := normalizePath(fs.dir) + targetPath = normalizePath(targetPath) + var relative string switch { case targetRoot == "/":