fix skip loop

This commit is contained in:
Konstantin Lebedev 2022-05-16 13:16:27 +05:00
parent 279053572c
commit 10d435f2c2

View file

@ -200,12 +200,16 @@ func (c *commandVolumeFixReplication) deleteOneVolume(commandEnv *CommandEnv, wr
} }
} }
сollectionIsMismatch := false
for _, volumeReplica := range replicas { for _, volumeReplica := range replicas {
if volumeReplica.info.Collection != replica.info.Collection { 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) fmt.Fprintf(writer, "skip delete volume %d as collection %s is mismatch: %s\n", replica.info.Id, replica.info.Collection, volumeReplica.info.Collection)
continue сollectionIsMismatch = true
} }
} }
if сollectionIsMismatch {
continue
}
fmt.Fprintf(writer, "deleting volume %d from %s ...\n", replica.info.Id, replica.location.dataNode.Id) fmt.Fprintf(writer, "deleting volume %d from %s ...\n", replica.info.Id, replica.location.dataNode.Id)