Browse Source

volume: find a non-empty offset when binary searching by timestamp

fix https://github.com/chrislusf/seaweedfs/issues/2364
pull/2374/head
Chris Lu 3 years ago
parent
commit
b530f12327
  1. 10
      weed/storage/volume_backup.go

10
weed/storage/volume_backup.go

@ -194,6 +194,16 @@ func (v *Volume) BinarySearchByAppendAtNs(sinceNs uint64) (offset Offset, isLast
err = fmt.Errorf("read entry %d: %v", m, err)
return
}
for ; offset.IsZero() && m < h; m++ {
offset, err = v.readOffsetFromIndex(m)
if err != nil {
err = fmt.Errorf("read entry %d: %v", m, err)
return
}
}
if offset.IsZero() {
return Offset{}, true, nil
}
mNs, nsReadErr := v.readAppendAtNs(offset)
if nsReadErr != nil {

Loading…
Cancel
Save