Browse Source

Filtering by volume id is prioritized.

pull/2438/head
user 3 years ago
parent
commit
9668b15f38
  1. 10
      weed/shell/command_volume_configure_replication.go

10
weed/shell/command_volume_configure_replication.go

@ -111,7 +111,11 @@ func (c *commandVolumeConfigureReplication) Do(args []string, commandEnv *Comman
func getVolumeFilter(replicaPlacement *super_block.ReplicaPlacement, volumeId uint32, collectionPattern string) func(message *master_pb.VolumeInformationMessage) bool {
replicaPlacementInt32 := uint32(replicaPlacement.Byte())
if collectionPattern != "" {
if volumeId > 0 {
return func(v *master_pb.VolumeInformationMessage) bool {
return v.Id == volumeId && v.ReplicaPlacement != replicaPlacementInt32
}
}
return func(v *master_pb.VolumeInformationMessage) bool {
matched, err := filepath.Match(collectionPattern, v.Collection)
if err != nil {
@ -120,7 +124,3 @@ func getVolumeFilter(replicaPlacement *super_block.ReplicaPlacement, volumeId ui
return matched
}
}
return func(v *master_pb.VolumeInformationMessage) bool {
return v.Id == volumeId && v.ReplicaPlacement != replicaPlacementInt32
}
}
Loading…
Cancel
Save