aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-05-16 13:07:05 +0500
committerKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-05-16 13:07:05 +0500
commit279053572cb00ed0d7c357e2b087b20d9638cf38 (patch)
treeab29c627a9ab7ef6aa9d41cc60e0865e6590985a
parent9ff0d9900288a2dc92d3a82256fb3f359be20d3b (diff)
downloadseaweedfs-279053572cb00ed0d7c357e2b087b20d9638cf38.tar.xz
seaweedfs-279053572cb00ed0d7c357e2b087b20d9638cf38.zip
avoid delete volume replica if collection mismatch
-rw-r--r--weed/shell/command_volume_fix_replication.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/shell/command_volume_fix_replication.go b/weed/shell/command_volume_fix_replication.go
index c4bef5925..b65d1996e 100644
--- a/weed/shell/command_volume_fix_replication.go
+++ b/weed/shell/command_volume_fix_replication.go
@@ -200,6 +200,13 @@ func (c *commandVolumeFixReplication) deleteOneVolume(commandEnv *CommandEnv, wr
}
}
+ for _, volumeReplica := range replicas {
+ if volumeReplica.info.Collection != replica.info.Collection {
+ fmt.Fprintf(writer, "skip delete volume %d as collection %s is mismatch: %s\n", replica.info.Id, replica.info.Collection, volumeReplica.info.Collection)
+ continue
+ }
+ }
+
fmt.Fprintf(writer, "deleting volume %d from %s ...\n", replica.info.Id, replica.location.dataNode.Id)
if !takeAction {