mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #1738 from qieqieplus/rocksdb
fix rocksdb crash when list directory
This commit is contained in:
commit
07f4703bfc
|
@ -181,18 +181,12 @@ func enumerate(iter *gorocksdb.Iterator, prefix, lastKey []byte, includeLastKey
|
||||||
iter.Seek(prefix)
|
iter.Seek(prefix)
|
||||||
} else {
|
} else {
|
||||||
iter.Seek(lastKey)
|
iter.Seek(lastKey)
|
||||||
|
|
||||||
if !includeLastKey {
|
if !includeLastKey {
|
||||||
key := iter.Key().Data()
|
if iter.Valid() {
|
||||||
|
if bytes.Equal(iter.Key().Data(), lastKey) {
|
||||||
if !bytes.HasPrefix(key, prefix) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if bytes.Equal(key, lastKey) {
|
|
||||||
iter.Next()
|
iter.Next()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,10 +244,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 a new issue