From eeaf757765f05beb22d4cd88e2ac8dcd148b6d2d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 18 Oct 2026 20:31:00 -0700 Subject: [PATCH] shell: volume.growth.resume command (#11763) --- weed/shell/command_volume_growth_resume.go | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 weed/shell/command_volume_growth_resume.go diff --git a/weed/shell/command_volume_growth_resume.go b/weed/shell/command_volume_growth_resume.go new file mode 100644 index 0000000000..7cad7c71ab --- /dev/null +++ b/weed/shell/command_volume_growth_resume.go @@ -0,0 +1,52 @@ +package shell + +import ( + "context" + "fmt" + "io" + + "github.com/seaweedfs/seaweedfs/weed/pb/master_pb" +) + +func init() { + Commands = append(Commands, &commandVolumeGrowthResume{}) +} + +type commandVolumeGrowthResume struct { +} + +func (c *commandVolumeGrowthResume) Name() string { + return "volume.growth.resume" +} + +func (c *commandVolumeGrowthResume) Help() string { + return `resume volume growth frozen after detected master state loss + + volume.growth.resume + + Volume growth freezes automatically when a volume server reports a + topology id that differs from this cluster's, which means the master + state was rebuilt and max volume id knowledge may be incomplete. Run + this after verifying the cluster inventory so new ids are not reused. + +` +} + +func (c *commandVolumeGrowthResume) HasTag(CommandTag) bool { + return false +} + +func (c *commandVolumeGrowthResume) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) { + return commandEnv.MasterClient.WithClient(context.Background(), false, func(client master_pb.SeaweedClient) error { + resp, err := client.ResumeVolumeGrowth(context.Background(), &master_pb.ResumeVolumeGrowthRequest{}) + if err != nil { + return err + } + if resp.WasFrozen { + fmt.Fprintf(writer, "volume growth resumed\n") + } else { + fmt.Fprintf(writer, "volume growth was not frozen\n") + } + return nil + }) +}