From e84fad9acfe02e7634355749fffcad62364063cb Mon Sep 17 00:00:00 2001 From: "byunghwa.yun" Date: Fri, 6 Aug 2021 12:13:37 +0900 Subject: [PATCH 1/4] Add crtime and mtime --- weed/shell/command_fs_mkdir.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/shell/command_fs_mkdir.go b/weed/shell/command_fs_mkdir.go index 71a9daece..11b663eec 100644 --- a/weed/shell/command_fs_mkdir.go +++ b/weed/shell/command_fs_mkdir.go @@ -6,6 +6,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/util" "io" "os" + "time" ) func init() { @@ -43,6 +44,8 @@ func (c *commandFsMkdir) Do(args []string, commandEnv *CommandEnv, writer io.Wri Name: name, IsDirectory: true, Attributes: &filer_pb.FuseAttributes{ + Mtime: time.Now().Unix(), + Crtime: time.Now().Unix(), FileMode: uint32(0777 | os.ModeDir), }, }, From f3dc909b21c2d4cc2f310b4205e56f1795713d77 Mon Sep 17 00:00:00 2001 From: "byunghwa.yun" Date: Fri, 6 Aug 2021 12:24:35 +0900 Subject: [PATCH 2/4] Change default permissions --- weed/filer/filer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filer/filer.go b/weed/filer/filer.go index d4c0b4eef..862f98496 100644 --- a/weed/filer/filer.go +++ b/weed/filer/filer.go @@ -207,7 +207,7 @@ func (f *Filer) ensureParentDirecotryEntry(ctx context.Context, entry *Entry, di Attr: Attr{ Mtime: now, Crtime: now, - Mode: os.ModeDir | entry.Mode | 0110, + Mode: os.ModeDir | entry.Mode | 0111, Uid: entry.Uid, Gid: entry.Gid, Collection: entry.Collection, From 8828f485c0193017307de67492681277062be0b8 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 6 Aug 2021 19:30:22 -0700 Subject: [PATCH 3/4] print volume deletion error --- weed/shell/command_volume_tier_move.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/shell/command_volume_tier_move.go b/weed/shell/command_volume_tier_move.go index 9e38c936d..a3d7f2756 100644 --- a/weed/shell/command_volume_tier_move.go +++ b/weed/shell/command_volume_tier_move.go @@ -136,7 +136,7 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, vid needle.Volum for _, loc := range locations { if loc.Url != dst.dataNode.Id { if err = deleteVolume(commandEnv.option.GrpcDialOption, vid, loc.Url); err != nil { - fmt.Fprintf(writer, "failed to delete volume %d on %s\n", vid, loc.Url) + fmt.Fprintf(writer, "failed to delete volume %d on %s: %v\n", vid, loc.Url, err) } } } From 0c0f77e2ae45e1f905d33bf9cf129667665121ab Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 6 Aug 2021 19:35:47 -0700 Subject: [PATCH 4/4] skip not found error on deletion --- weed/shell/command_volume_tier_move.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weed/shell/command_volume_tier_move.go b/weed/shell/command_volume_tier_move.go index a3d7f2756..19a515dab 100644 --- a/weed/shell/command_volume_tier_move.go +++ b/weed/shell/command_volume_tier_move.go @@ -8,6 +8,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/wdclient" "io" "path/filepath" + "strings" "time" "github.com/chrislusf/seaweedfs/weed/storage/needle" @@ -136,7 +137,9 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, vid needle.Volum for _, loc := range locations { if loc.Url != dst.dataNode.Id { if err = deleteVolume(commandEnv.option.GrpcDialOption, vid, loc.Url); err != nil { - fmt.Fprintf(writer, "failed to delete volume %d on %s: %v\n", vid, loc.Url, err) + if !strings.Contains(err.Error(), "not found") { + fmt.Fprintf(writer, "failed to delete volume %d on %s: %v\n", vid, loc.Url, err) + } } } }