diff options
| author | chrislu <chris.lu@gmail.com> | 2022-12-19 11:30:50 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-12-19 11:30:50 -0800 |
| commit | 3fc3e7083c442aefd009c95bdad7379afa660392 (patch) | |
| tree | 9e460976ca5cc698df89edc0a37d9d07c873fc16 | |
| parent | 8a40fa8993b531f04d3b7100679ff5675d3f8c90 (diff) | |
| download | seaweedfs-3fc3e7083c442aefd009c95bdad7379afa660392.tar.xz seaweedfs-3fc3e7083c442aefd009c95bdad7379afa660392.zip | |
metadata skip reading un-available logs
this means the volumes for metadata histories have been lost.
| -rw-r--r-- | weed/filer/filer_notify.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/filer/filer_notify.go b/weed/filer/filer_notify.go index 77b659288..f8a1dd603 100644 --- a/weed/filer/filer_notify.go +++ b/weed/filer/filer_notify.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "math" + "regexp" "strings" "time" @@ -108,6 +109,10 @@ func (f *Filer) logFlushFunc(startTime, stopTime time.Time, buf []byte) { } } +var ( + VolumeNotFoundPattern = regexp.MustCompile(`volume \d+? not found`) +) + func (f *Filer) ReadPersistedLogBuffer(startTime time.Time, stopTsNs int64, eachLogEntryFn func(logEntry *filer_pb.LogEntry) error) (lastTsNs int64, isDone bool, err error) { startTime = startTime.UTC() @@ -159,6 +164,10 @@ func (f *Filer) ReadPersistedLogBuffer(startTime time.Time, stopTsNs int64, each if err == io.EOF { continue } + if VolumeNotFoundPattern.MatchString(err.Error()) { + glog.Warningf("skipping reading %s: %v", hourMinuteEntry.FullPath, err) + continue + } return lastTsNs, isDone, fmt.Errorf("reading %s: %v", hourMinuteEntry.FullPath, err) } chunkedFileReader.Close() |
