Browse Source

filer leveldb2: correct directory listing

fix https://github.com/chrislusf/seaweedfs/issues/1001
pull/1020/head
Chris Lu 6 years ago
parent
commit
7872fc38ea
  1. 3
      weed/filer2/leveldb2/leveldb2_store.go

3
weed/filer2/leveldb2/leveldb2_store.go

@ -138,8 +138,9 @@ func (store *LevelDB2Store) ListDirectoryEntries(ctx context.Context, fullpath f
limit int) (entries []*filer2.Entry, err error) {
directoryPrefix, partitionId := genDirectoryKeyPrefix(fullpath, "", store.dbCount)
lastFileStart, _ := genDirectoryKeyPrefix(fullpath, startFileName, store.dbCount)
iter := store.dbs[partitionId].NewIterator(&leveldb_util.Range{Start: directoryPrefix}, nil)
iter := store.dbs[partitionId].NewIterator(&leveldb_util.Range{Start: lastFileStart}, nil)
for iter.Next() {
key := iter.Key()
if !bytes.HasPrefix(key, directoryPrefix) {

Loading…
Cancel
Save