Browse Source

filer: leveldb and hbase may miss files when listing large directories more than 1024

fix https://github.com/chrislusf/seaweedfs/issues/1768
pull/1778/head
Chris Lu 4 years ago
parent
commit
4be51c0701
  1. 5
      weed/filer/hbase/hbase_store.go
  2. 2
      weed/filer/leveldb/leveldb_store.go
  3. 2
      weed/filer/leveldb2/leveldb2_store.go
  4. 2
      weed/filer/leveldb3/leveldb3_store.go

5
weed/filer/hbase/hbase_store.go

@ -185,8 +185,6 @@ func (store *HbaseStore) ListDirectoryPrefixedEntries(ctx context.Context, dirPa
continue continue
} }
lastFileName = fileName
value := cell.Value value := cell.Value
if fileName == startFileName && !includeStartFile { if fileName == startFileName && !includeStartFile {
@ -197,6 +195,9 @@ func (store *HbaseStore) ListDirectoryPrefixedEntries(ctx context.Context, dirPa
if limit < 0 { if limit < 0 {
break break
} }
lastFileName = fileName
entry := &filer.Entry{ entry := &filer.Entry{
FullPath: fullpath, FullPath: fullpath,
} }

2
weed/filer/leveldb/leveldb_store.go

@ -187,11 +187,11 @@ func (store *LevelDBStore) ListDirectoryPrefixedEntries(ctx context.Context, dir
if fileName == startFileName && !includeStartFile { if fileName == startFileName && !includeStartFile {
continue continue
} }
lastFileName = fileName
limit-- limit--
if limit < 0 { if limit < 0 {
break break
} }
lastFileName = fileName
entry := &filer.Entry{ entry := &filer.Entry{
FullPath: weed_util.NewFullPath(string(dirPath), fileName), FullPath: weed_util.NewFullPath(string(dirPath), fileName),
} }

2
weed/filer/leveldb2/leveldb2_store.go

@ -196,11 +196,11 @@ func (store *LevelDB2Store) ListDirectoryPrefixedEntries(ctx context.Context, di
if fileName == startFileName && !includeStartFile { if fileName == startFileName && !includeStartFile {
continue continue
} }
lastFileName = fileName
limit-- limit--
if limit < 0 { if limit < 0 {
break break
} }
lastFileName = fileName
entry := &filer.Entry{ entry := &filer.Entry{
FullPath: weed_util.NewFullPath(string(dirPath), fileName), FullPath: weed_util.NewFullPath(string(dirPath), fileName),
} }

2
weed/filer/leveldb3/leveldb3_store.go

@ -316,11 +316,11 @@ func (store *LevelDB3Store) ListDirectoryPrefixedEntries(ctx context.Context, di
if fileName == startFileName && !includeStartFile { if fileName == startFileName && !includeStartFile {
continue continue
} }
lastFileName = fileName
limit-- limit--
if limit < 0 { if limit < 0 {
break break
} }
lastFileName = fileName
entry := &filer.Entry{ entry := &filer.Entry{
FullPath: weed_util.NewFullPath(string(dirPath), fileName), FullPath: weed_util.NewFullPath(string(dirPath), fileName),
} }

Loading…
Cancel
Save