Browse Source
Merge pull request #3056 from kmlebedev/avoid_del_volume
avoid delete volume replica if collection mismatch
pull/3060/head
Chris Lu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
0 deletions
-
weed/shell/command_volume_fix_replication.go
|
|
@ -200,6 +200,17 @@ func (c *commandVolumeFixReplication) deleteOneVolume(commandEnv *CommandEnv, wr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
сollectionIsMismatch := false |
|
|
|
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) |
|
|
|
сollectionIsMismatch = true |
|
|
|
} |
|
|
|
} |
|
|
|
if сollectionIsMismatch { |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|
fmt.Fprintf(writer, "deleting volume %d from %s ...\n", replica.info.Id, replica.location.dataNode.Id) |
|
|
|
|
|
|
|
if !takeAction { |
|
|
|