aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruser <ekhvalov@gmail.com>2021-11-11 18:18:56 +0900
committeruser <ekhvalov@gmail.com>2021-11-11 18:18:56 +0900
commit9668b15f3868b5084961a27fb79588b01ae9a91e (patch)
tree1c001f32000c045a8b68a4cdf9d7e0e7af9b7107
parent563a74a9eb050730ee16e3510ca95d0c36d13fdb (diff)
downloadseaweedfs-9668b15f3868b5084961a27fb79588b01ae9a91e.tar.xz
seaweedfs-9668b15f3868b5084961a27fb79588b01ae9a91e.zip
Filtering by volume id is prioritized.
-rw-r--r--weed/shell/command_volume_configure_replication.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/weed/shell/command_volume_configure_replication.go b/weed/shell/command_volume_configure_replication.go
index fe4eab22a..7e9627b40 100644
--- a/weed/shell/command_volume_configure_replication.go
+++ b/weed/shell/command_volume_configure_replication.go
@@ -111,16 +111,16 @@ 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 {
- matched, err := filepath.Match(collectionPattern, v.Collection)
- if err != nil {
- return false
- }
- return matched
+ return v.Id == volumeId && v.ReplicaPlacement != replicaPlacementInt32
}
}
return func(v *master_pb.VolumeInformationMessage) bool {
- return v.Id == volumeId && v.ReplicaPlacement != replicaPlacementInt32
+ matched, err := filepath.Match(collectionPattern, v.Collection)
+ if err != nil {
+ return false
+ }
+ return matched
}
}