shell: update fs.verify and volume.fsck for new BFS signature

Updated dependent commands to match the refactored
doTraverseBfsAndSaving signature and use context for channel sends.
This commit is contained in:
Chris Lu
2026-01-29 14:42:10 -08:00
parent 3b05efbdbc
commit 94e0b902f9
2 changed files with 12 additions and 4 deletions

View File

@@ -241,7 +241,7 @@ func (c *commandVolumeFsck) collectFilerFileIdAndPaths(dataNodeVolumeIdToVInfo m
}()
return doTraverseBfsAndSaving(c.env, c.writer, c.getCollectFilerFilePath(), false,
func(entry *filer_pb.FullEntry, outputChan chan interface{}) (err error) {
func(ctx context.Context, entry *filer_pb.FullEntry, outputChan chan interface{}) (err error) {
if *c.verbose && entry.Entry.IsDirectory {
fmt.Fprintf(c.writer, "checking directory %s\n", util.NewFullPath(entry.Dir, entry.Entry.Name))
}
@@ -257,11 +257,15 @@ func (c *commandVolumeFsck) collectFilerFileIdAndPaths(dataNodeVolumeIdToVInfo m
if collectModifyFromAtNs != 0 && chunk.ModifiedTsNs < collectModifyFromAtNs {
continue
}
outputChan <- &Item{
select {
case outputChan <- &Item{
vid: chunk.Fid.VolumeId,
fileKey: chunk.Fid.FileKey,
cookie: chunk.Fid.Cookie,
path: util.NewFullPath(entry.Dir, entry.Entry.Name),
}:
case <-ctx.Done():
return ctx.Err()
}
}
return nil