From 385a4dec30f4b9a64f9cd72f46ac3757cda23c09 Mon Sep 17 00:00:00 2001 From: Baptiste Mille-Mathias Date: Wed, 23 Dec 2020 09:07:31 +0100 Subject: [PATCH 1/3] [shell] Clarify bucket replication setting order --- weed/shell/command_s3_bucket_create.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/shell/command_s3_bucket_create.go b/weed/shell/command_s3_bucket_create.go index 28cf1d945..a512ffc4a 100644 --- a/weed/shell/command_s3_bucket_create.go +++ b/weed/shell/command_s3_bucket_create.go @@ -34,7 +34,9 @@ func (c *commandS3BucketCreate) Do(args []string, commandEnv *CommandEnv, writer bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError) bucketName := bucketCommand.String("name", "", "bucket name") - replication := bucketCommand.String("replication", "", "replication setting for the bucket, if not set it will honor the setting defined by the filer or master") + replication := bucketCommand.String("replication", "", "replication setting for the bucket, if not set "+ + "it will honor the value defined by the filer if it exists, "+ + "else it will honor the value defined on the master") if err = bucketCommand.Parse(args); err != nil { return nil } From 0ca9d89589f9cff770ccb4fd5d95f643c8c4f2c6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 23 Dec 2020 14:34:59 -0800 Subject: [PATCH 2/3] s3: break loop if error fix #1701 --- weed/s3api/s3api_objects_list_handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index dce2fd6b0..b674f87cd 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -315,7 +315,7 @@ func (s3a *S3ApiServer) isDirectoryAllEmpty(filerClient filer_pb.SeaweedFilerCli currentDir := parentDir + "/" + name var startFrom string var isExhausted bool - for fileCounter == 0 && !isExhausted { + for fileCounter == 0 && !isExhausted && err == nil { err = filer_pb.SeaweedList(filerClient, currentDir, "", func(entry *filer_pb.Entry, isLast bool) error { if entry.IsDirectory { subDirs = append(subDirs, entry.Name) From 3be363579971470fff1acc8ebf668a3f3851fa33 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 23 Dec 2020 14:36:48 -0800 Subject: [PATCH 3/3] just log error when checking empty dir failed --- weed/s3api/s3api_objects_list_handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index b674f87cd..0af099967 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -265,7 +265,7 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d } else { var isEmpty bool if isEmpty, err = s3a.isDirectoryAllEmpty(client, dir, entry.Name); err != nil { - return + glog.Errorf("check empty folder %s: %v", dir, err) } if !isEmpty { eachEntryFn(dir, entry)