filer leveldb2: correct directory listing

fix https://github.com/chrislusf/seaweedfs/issues/1001
This commit is contained in:
Chris Lu 2019-07-07 20:37:48 -07:00
parent fe2882ce7d
commit 7872fc38ea

View file

@ -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) {