mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-20 13:30:46 +02:00
shell: default batch size for ec.encode and ec.decode (#10308)
* shell: ec.encode batches 10 volumes by default Encoding a whole collection as one batch means a late failure leaves everything half-converted. Default -batchSize to 10 so each batch is encoded, rebalanced, verified, and its originals deleted before the next starts. -batchSize=0 keeps the all-at-once behavior. Batch progress messages now print only when there is more than one batch, so small runs read as before. * shell: ec.decode decodes in batches, refreshing topology in between ec.decode walked every volume off the single topology snapshot taken at startup, which goes stale as earlier decodes move shards around and create volumes. Decode 10 volumes per batch by default, re-collecting the topology and rebuilding the free-space accounting between batches. -batchSize=0 keeps the single-snapshot behavior.
This commit is contained in:
@@ -262,16 +262,16 @@ func TestParseEcEncodeVolumeIds(t *testing.T) {
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
func TestChunkEcEncodeVolumeIds(t *testing.T) {
|
||||
func TestChunkVolumeIds(t *testing.T) {
|
||||
vids := []needle.VolumeId{101, 102, 103, 104, 105}
|
||||
|
||||
assert.Equal(t, [][]needle.VolumeId{
|
||||
{101, 102},
|
||||
{103, 104},
|
||||
{105},
|
||||
}, chunkEcEncodeVolumeIds(vids, 2))
|
||||
}, chunkVolumeIds(vids, 2))
|
||||
|
||||
assert.Equal(t, [][]needle.VolumeId{vids}, chunkEcEncodeVolumeIds(vids, 0))
|
||||
assert.Equal(t, [][]needle.VolumeId{vids}, chunkVolumeIds(vids, 0))
|
||||
}
|
||||
|
||||
func ecShardVisibilityTestTopology(nodes ...*master_pb.DataNodeInfo) *master_pb.TopologyInfo {
|
||||
|
||||
Reference in New Issue
Block a user