aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_encode.go
diff options
context:
space:
mode:
authorLisandro Pin <lisandro.pin@proton.ch>2025-02-28 20:42:19 +0100
committerGitHub <noreply@github.com>2025-02-28 11:42:19 -0800
commitc07596691c5897a171aefd09c37a5f4a1807b510 (patch)
treeb7e730a4983971b72139f4765d86269287d3b583 /weed/shell/command_ec_encode.go
parent76a111f0a2fb6113d6c173758db5a91afa92e58d (diff)
downloadseaweedfs-c07596691c5897a171aefd09c37a5f4a1807b510.tar.xz
seaweedfs-c07596691c5897a171aefd09c37a5f4a1807b510.zip
`ec.encode`: Fix resolution of target collections. (#6585)
* Don't ignore empty (`""`) collection names when computing collections for a given volume ID. * `ec.encode`: Fix resolution of target collections. When no `volumeId` parameter is provided, compute volumes based on the provided collection name, even if it's empty (`""`). This restores behavior to before recent EC rebalancing rework. See also https://github.com/seaweedfs/seaweedfs/blob/ec30a504bae6cad75f859964e14c60d39cc43709/weed/shell/command_ec_encode.go#L99 .
Diffstat (limited to 'weed/shell/command_ec_encode.go')
-rw-r--r--weed/shell/command_ec_encode.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go
index e341f7828..a1d899d15 100644
--- a/weed/shell/command_ec_encode.go
+++ b/weed/shell/command_ec_encode.go
@@ -98,23 +98,19 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
}
}
+ var collections []string
var volumeIds []needle.VolumeId
if vid := needle.VolumeId(*volumeId); vid != 0 {
// volumeId is provided
volumeIds = append(volumeIds, vid)
+ collections = collectCollectionsForVolumeIds(topologyInfo, volumeIds)
} else {
- // apply to all volumes in the collection
+ // apply to all volumes for the given collection
volumeIds, err = collectVolumeIdsForEcEncode(commandEnv, *collection, *fullPercentage, *quietPeriod)
if err != nil {
return err
}
- }
-
- var collections []string
- if *collection != "" {
- collections = []string{*collection}
- } else {
- collections = collectCollectionsForVolumeIds(topologyInfo, volumeIds)
+ collections = append(collections, *collection)
}
// encode all requested volumes...