Browse Source

fix seek lastkey may reach EOF

pull/1738/head
qieqieplus 4 years ago
parent
commit
c7e7431fd3
  1. 18
      weed/filer/rocksdb/rocksdb_store.go

18
weed/filer/rocksdb/rocksdb_store.go

@ -182,17 +182,9 @@ func enumerate(iter *gorocksdb.Iterator, prefix, lastKey []byte, includeLastKey
} else {
iter.Seek(lastKey)
if !includeLastKey {
key := iter.Key().Data()
if !bytes.HasPrefix(key, prefix) {
return nil
}
if bytes.Equal(key, lastKey) {
iter.Next()
}
if iter.Valid() && !includeLastKey &&
bytes.Equal(iter.Key().Data(), lastKey) {
iter.Next()
}
}
@ -250,10 +242,6 @@ func (store *RocksDBStore) ListDirectoryPrefixedEntries(ctx context.Context, ful
if fileName == "" {
return true
}
limit--
if limit < 0 {
return false
}
entry := &filer.Entry{
FullPath: weed_util.NewFullPath(string(fullpath), fileName),
}

Loading…
Cancel
Save