diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2021-08-16 00:54:51 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-16 00:54:51 +0800 |
| commit | 27c05f8c0b5c7bda43babeb61d79684d11851111 (patch) | |
| tree | d235573112ce168ca904acbc3932ed12e94de80c /weed/shell/command_ec_encode.go | |
| parent | 97ad3e9d027216d74132652d4d899c7fc7c33ab1 (diff) | |
| parent | ec989b037717f8fd7f0ed3bbc80f0a33654fe7aa (diff) | |
| download | seaweedfs-27c05f8c0b5c7bda43babeb61d79684d11851111.tar.xz seaweedfs-27c05f8c0b5c7bda43babeb61d79684d11851111.zip | |
Merge pull request #80 from chrislusf/master
sync
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) |
