aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_decode.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-10-05 11:13:48 -0700
committerchrislu <chris.lu@gmail.com>2023-10-05 11:13:48 -0700
commit0fd7222d65d58f81d08712702b4d5604a85ca92a (patch)
tree0822baacf8cca164e4326683586b5b9164cb919d /weed/shell/command_ec_decode.go
parent7b3c63a8afa5bd305437f6913774c0e1e76eb569 (diff)
downloadseaweedfs-0fd7222d65d58f81d08712702b4d5604a85ca92a.tar.xz
seaweedfs-0fd7222d65d58f81d08712702b4d5604a85ca92a.zip
default to skip if less than 4 nodes
Diffstat (limited to 'weed/shell/command_ec_decode.go')
-rw-r--r--weed/shell/command_ec_decode.go22
1 files changed, 4 insertions, 18 deletions
diff --git a/weed/shell/command_ec_decode.go b/weed/shell/command_ec_decode.go
index 0aca9e00b..aecc21065 100644
--- a/weed/shell/command_ec_decode.go
+++ b/weed/shell/command_ec_decode.go
@@ -4,7 +4,6 @@ import (
"context"
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"io"
@@ -39,14 +38,12 @@ func (c *commandEcDecode) Help() string {
}
func (c *commandEcDecode) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
- encodeCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- volumeId := encodeCommand.Int("volumeId", 0, "the volume id")
- collection := encodeCommand.String("collection", "", "the collection name")
- forceChanges := encodeCommand.Bool("force", false, "force the encoding even if the cluster has less than recommended 4 nodes")
- if err = encodeCommand.Parse(args); err != nil {
+ decodeCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ volumeId := decodeCommand.Int("volumeId", 0, "the volume id")
+ collection := decodeCommand.String("collection", "", "the collection name")
+ if err = decodeCommand.Parse(args); err != nil {
return nil
}
- infoAboutSimulationMode(writer, *forceChanges, "-force")
if err = commandEnv.confirmIsLocked(args); err != nil {
return
@@ -60,17 +57,6 @@ func (c *commandEcDecode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
return err
}
- if !*forceChanges {
- var nodeCount int
- eachDataNode(topologyInfo, func(dc string, rack RackId, dn *master_pb.DataNodeInfo) {
- nodeCount++
- })
- if nodeCount < erasure_coding.ParityShardsCount {
- glog.V(0).Infof("skip erasure coding with %d nodes, less than recommended %d nodes", nodeCount, erasure_coding.ParityShardsCount)
- return nil
- }
- }
-
// volumeId is provided
if vid != 0 {
return doEcDecode(commandEnv, topologyInfo, *collection, vid)