Browse Source

fix test_bucket_listv2_delimiter_prefix

pull/5580/head
Konstantin Lebedev 8 months ago
parent
commit
36f64caecc
  1. 3
      weed/filer/abstract_sql/abstract_sql_store.go
  2. 5
      weed/server/filer_grpc_server.go

3
weed/filer/abstract_sql/abstract_sql_store.go

@ -381,7 +381,8 @@ func (store *AbstractSqlStore) ListRecursivePrefixedEntries(ctx context.Context,
glog.V(0).Infof("scan isDir %v skip %v", entry.IsDirectory(), entry.FullPath)
continue
}
if delimiter && shortDir != dir && !entry.IsDirectory() {
// Todo test_bucket_listv2_delimiter_prefix move start from prefix to SQL because in extreme cases, where there are more keys that need to be skipped than the limit
if delimiter && shortDir != dir && (!entry.IsDirectory() || (len(startFileName) > 0 && strings.HasPrefix(dir, startFileName))) {
glog.V(0).Infof("scan isDir %v skip %v", entry.IsDirectory(), entry.FullPath)
continue
}

5
weed/server/filer_grpc_server.go

@ -39,7 +39,7 @@ func (fs *FilerServer) LookupDirectoryEntry(ctx context.Context, req *filer_pb.L
func (fs *FilerServer) ListEntries(req *filer_pb.ListEntriesRequest, stream filer_pb.SeaweedFiler_ListEntriesServer) (err error) {
glog.V(4).Infof("ListEntries %v", req)
glog.V(0).Infof("ListEntries %v", req)
limit := int(req.Limit)
if limit == 0 {
@ -47,7 +47,8 @@ func (fs *FilerServer) ListEntries(req *filer_pb.ListEntriesRequest, stream file
}
paginationLimit := filer.PaginationSize
if paginationLimit > limit && !req.Delimiter {
// Todo test_bucket_listv2_delimiter_prefix move start from prefix to SQL because in extreme cases, where there are more keys that need to be skipped than the limit
if paginationLimit > limit && !(req.Recursive && req.Delimiter && len(req.StartFromFileName) > 0) {
paginationLimit = limit
if req.Recursive {
paginationLimit *= 2

Loading…
Cancel
Save