Browse Source

Tweak filersink stale logging

pull/8298/head
Chris Lu 20 hours ago
parent
commit
365e51f174
  1. 23
      weed/replication/sink/filersink/fetch_write.go

23
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 == "/":

Loading…
Cancel
Save