Improve EC shards rebalancing logic across racks (#6270)

Improve EC shards rebalancing logic across racks.

  - Favor target shards with less preexisting shards, to ensure a fair distribution.
  - Randomize selection when multiple possible target shards are available.
  - Add logic to account for replication settings when selecting target shards (currently disabled).
This commit is contained in:
Lisandro Pin
2024-11-21 17:46:24 +01:00
committed by GitHub
parent e56327e3b0
commit ca499de1cb
4 changed files with 274 additions and 45 deletions

View File

@@ -2,15 +2,18 @@ package shell
import (
_ "embed"
"github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/stretchr/testify/assert"
//"google.golang.org/protobuf/proto"
"github.com/golang/protobuf/proto"
"strconv"
"strings"
"testing"
"github.com/golang/protobuf/proto"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
)
@@ -127,3 +130,6 @@ var topoData string
//go:embed volume.list2.txt
var topoData2 string
//go:embed volume.ecshards.txt
var topoDataEc string