mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-18 22:43:41 +08:00
volume: find a non-empty offset when binary searching by timestamp
fix https://github.com/chrislusf/seaweedfs/issues/2364
This commit is contained in:
parent
84d2e1bdd0
commit
b530f12327
@ -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…
Reference in New Issue
Block a user