aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_move.go
diff options
context:
space:
mode:
authorLisandro Pin <lisandro.pin@proton.ch>2024-12-18 20:59:48 +0100
committerGitHub <noreply@github.com>2024-12-18 11:59:48 -0800
commit44c48c929ac2e513a3ad5749744c77ab480ae1fe (patch)
treeb93904e1c7ca3ff6e4177281fc991a04d953f885 /weed/shell/command_volume_move.go
parent72af97162fa4b76557c9160a3809b0a9dd67cbbd (diff)
downloadseaweedfs-44c48c929ac2e513a3ad5749744c77ab480ae1fe.tar.xz
seaweedfs-44c48c929ac2e513a3ad5749744c77ab480ae1fe.zip
Parallelize volume replica operations within `ec.encode`. (#6374)
Diffstat (limited to 'weed/shell/command_volume_move.go')
-rw-r--r--weed/shell/command_volume_move.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/weed/shell/command_volume_move.go b/weed/shell/command_volume_move.go
index 2ddd3f625..26fd5fc58 100644
--- a/weed/shell/command_volume_move.go
+++ b/weed/shell/command_volume_move.go
@@ -227,10 +227,14 @@ func markVolumeWritable(grpcDialOption grpc.DialOption, volumeId needle.VolumeId
})
}
+func markVolumeReplicaWritable(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, location wdclient.Location, writable, persist bool) error {
+ fmt.Printf("markVolumeReadonly %d on %s ...\n", volumeId, location.Url)
+ return markVolumeWritable(grpcDialOption, volumeId, location.ServerAddress(), writable, persist)
+}
+
func markVolumeReplicasWritable(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, locations []wdclient.Location, writable, persist bool) error {
for _, location := range locations {
- fmt.Printf("markVolumeReadonly %d on %s ...\n", volumeId, location.Url)
- if err := markVolumeWritable(grpcDialOption, volumeId, location.ServerAddress(), writable, persist); err != nil {
+ if err := markVolumeReplicaWritable(grpcDialOption, volumeId, location, writable, persist); err != nil {
return err
}
}