aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-07-20 22:02:05 -0700
committerChris Lu <chris.lu@gmail.com>2020-07-20 22:02:05 -0700
commit885c624bceb61688c806b91350e70d75088c6eea (patch)
treeb4e3e1deb1133cc7d34757c0981e30dabe196a03
parent44057a4de18e4fdc9b9249d76ba8208654b507ee (diff)
downloadseaweedfs-885c624bceb61688c806b91350e70d75088c6eea.tar.xz
seaweedfs-885c624bceb61688c806b91350e70d75088c6eea.zip
volume.fsck: follow manifest chunks
-rw-r--r--weed/shell/command_volume_fsck.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/weed/shell/command_volume_fsck.go b/weed/shell/command_volume_fsck.go
index 69a1a63b4..cf5ad6d6d 100644
--- a/weed/shell/command_volume_fsck.go
+++ b/weed/shell/command_volume_fsck.go
@@ -11,6 +11,7 @@ import (
"path/filepath"
"sync"
+ "github.com/chrislusf/seaweedfs/weed/filer2"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
@@ -196,7 +197,12 @@ func (c *commandVolumeFsck) collectFilerFileIds(tempFolder string, volumeIdToSer
files[i.vid].Write(buffer)
}
}, func(entry *filer_pb.FullEntry, outputChan chan interface{}) (err error) {
- for _, chunk := range entry.Entry.Chunks {
+ dChunks, mChunks, resolveErr := filer2.ResolveChunkManifest(filer2.LookupFn(c.env), entry.Entry.Chunks)
+ if resolveErr != nil {
+ return nil
+ }
+ dChunks = append(dChunks, mChunks...)
+ for _, chunk := range dChunks {
outputChan <- &Item{
vid: chunk.Fid.VolumeId,
fileKey: chunk.Fid.FileKey,