Skip to content

Commit

Permalink
gc: check the return error of client scan
Browse files Browse the repository at this point in the history
  • Loading branch information
SonglinLife committed Mar 3, 2025
1 parent 4411caf commit 780cee4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pkg/meta/tkv.go
Original file line number Diff line number Diff line change
Expand Up @@ -2581,19 +2581,24 @@ func (m *kvMeta) scanPendingFiles(ctx Context, scan pendingFileScan) error {
// deleted files: Diiiiiiiissssssss
klen := 1 + 8 + 8

var err error
m.client.scan(m.fmtKey("D"), func(key, val []byte) {
var scanErr error
if err := m.client.scan(m.fmtKey("D"), func(key, val []byte) {
if scanErr != nil {
return
}
if len(key) != klen {
err = fmt.Errorf("invalid key %x", key)
scanErr = fmt.Errorf("invalid key %x", key)
return
}
ino := m.decodeInode(key[1:9])
size := binary.BigEndian.Uint64(key[9:])
ts := m.parseInt64(val)
_, err = scan(ino, size, ts)
})
_, scanErr = scan(ino, size, ts)
}); err != nil {
return err
}

return err
return scanErr
}

func (m *kvMeta) doRepair(ctx Context, inode Ino, attr *Attr) syscall.Errno {
Expand Down

0 comments on commit 780cee4

Please sign in to comment.