mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-18 14:41:31 +08:00
fix seek lastkey may reach EOF
This commit is contained in:
parent
0764fccde7
commit
c7e7431fd3
@ -182,17 +182,9 @@ func enumerate(iter *gorocksdb.Iterator, prefix, lastKey []byte, includeLastKey
|
|||||||
} else {
|
} else {
|
||||||
iter.Seek(lastKey)
|
iter.Seek(lastKey)
|
||||||
|
|
||||||
if !includeLastKey {
|
if iter.Valid() && !includeLastKey &&
|
||||||
key := iter.Key().Data()
|
bytes.Equal(iter.Key().Data(), lastKey) {
|
||||||
|
iter.Next()
|
||||||
if !bytes.HasPrefix(key, prefix) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if bytes.Equal(key, lastKey) {
|
|
||||||
iter.Next()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,10 +242,6 @@ func (store *RocksDBStore) ListDirectoryPrefixedEntries(ctx context.Context, ful
|
|||||||
if fileName == "" {
|
if fileName == "" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
limit--
|
|
||||||
if limit < 0 {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
entry := &filer.Entry{
|
entry := &filer.Entry{
|
||||||
FullPath: weed_util.NewFullPath(string(fullpath), fileName),
|
FullPath: weed_util.NewFullPath(string(fullpath), fileName),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user