mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-20 06:07:05 +00:00
ec.balance: add a -volumeIds filter (#10667)
* ec.balance: add a -volumeIds filter Collection scope is often too broad for maintenance. -volumeIds narrows the plan to the given ec volume ids by leaving every other volume out of the topology handed to the planner, so no phase, dedup included, can plan against them. Ids with no ec shard in the selected collection, dataCenter and disk type are rejected rather than silently skipped. * ec.encode: key the orphan sweep without narrowing the volume id int is 32-bit on 32-bit builds, so int(vid) wraps for volume ids above MaxInt32. Format the id as the uint32 it is.
This commit is contained in:
@@ -250,18 +250,6 @@ func TestEcEncodeNodeCountCheck(t *testing.T) {
|
||||
assert.True(t, willProceed, "Should proceed with -force even with %d nodes", nodeCount)
|
||||
}
|
||||
|
||||
func TestParseEcEncodeVolumeIds(t *testing.T) {
|
||||
vids, err := parseEcEncodeVolumeIds("101, 102,101, 103")
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, []needle.VolumeId{101, 102, 103}, vids)
|
||||
|
||||
_, err = parseEcEncodeVolumeIds("101,abc")
|
||||
assert.Error(t, err)
|
||||
|
||||
_, err = parseEcEncodeVolumeIds(" , ")
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
func TestChunkVolumeIds(t *testing.T) {
|
||||
vids := []needle.VolumeId{101, 102, 103, 104, 105}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user