diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-08-13 03:09:28 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-08-13 03:09:28 -0700 |
| commit | 0f7d4556d839ffc9d0dcfbc965e3b970cb30c77d (patch) | |
| tree | c91a04437e24626b00dc1f0e0de0efdd92f910ff /weed/shell/command_ec_encode.go | |
| parent | 333cdce485ee5389306527cc8c1b40fdcf884137 (diff) | |
| download | seaweedfs-0f7d4556d839ffc9d0dcfbc965e3b970cb30c77d.tar.xz seaweedfs-0f7d4556d839ffc9d0dcfbc965e3b970cb30c77d.zip | |
shell: volume.tier.move makes up changes if volume move failed
Diffstat (limited to 'weed/shell/command_ec_encode.go')
| -rw-r--r-- | weed/shell/command_ec_encode.go | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go index 8480bab06..014b9bab7 100644 --- a/weed/shell/command_ec_encode.go +++ b/weed/shell/command_ec_encode.go @@ -100,7 +100,7 @@ func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId, // fmt.Printf("found ec %d shards on %v\n", vid, locations) // mark the volume as readonly - err = markVolumeReadonly(commandEnv.option.GrpcDialOption, vid, locations) + err = markVolumeReplicasWritable(commandEnv.option.GrpcDialOption, vid, locations, false) if err != nil { return fmt.Errorf("mark volume %d as readonly on %s: %v", vid, locations[0].Url, err) } @@ -120,28 +120,6 @@ func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId, return nil } -func markVolumeReadonly(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, locations []wdclient.Location) error { - - for _, location := range locations { - - fmt.Printf("markVolumeReadonly %d on %s ...\n", volumeId, location.Url) - - err := operation.WithVolumeServerClient(location.Url, grpcDialOption, func(volumeServerClient volume_server_pb.VolumeServerClient) error { - _, markErr := volumeServerClient.VolumeMarkReadonly(context.Background(), &volume_server_pb.VolumeMarkReadonlyRequest{ - VolumeId: uint32(volumeId), - }) - return markErr - }) - - if err != nil { - return err - } - - } - - return nil -} - func generateEcShards(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, collection string, sourceVolumeServer string) error { fmt.Printf("generateEcShards %s %d on %s ...\n", collection, volumeId, sourceVolumeServer) |
