mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-09 10:44:45 +08:00
shell: volume.tier.move makes up changes if volume move failed
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user