mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 10:15:43 +00:00
issue: https://github.com/milvus-io/milvus/issues/51065 ## What changed This PR switches the default QueryCoord balancer from `ScoreBasedBalancer` to `ChannelLevelScoreBalancer` and keeps unknown balancer names aligned with the new default fallback. It also sets the default `queryCoord.channelExclusiveNodeFactor` to `3`, so channel exclusive mode is enabled by default only when every channel can average at least three RW QueryNodes. ## Why `ChannelLevelScoreBalancer` improves channel placement, but channel exclusive mode constrains segment balancing inside each channel's assigned node group. If a replica has too many channels for its QueryNode count, enabling exclusive mode can prevent global node-level balancing from smoothing out skewed channel data. The default factor of `3` keeps smaller or high-channel-count replicas on the score-based node-level balancing path until there is enough QueryNode capacity per channel. ## Behavior With the default configuration, QueryCoord enables channel exclusive mode only when: ```text replica.RWNodesCount() >= len(channels) * 3 ``` For example, in an 8 QueryNode replica: - 2 channels can enable channel exclusive mode. - 3 channels cannot enable channel exclusive mode and continue using the score-based balancing fallback. ## Details - Update `configs/milvus.yaml` balancer and exclusive node factor defaults - Update paramtable defaults and default assertions - Make unknown balancer names fall back to `ChannelLevelScoreBalancer` - Add balancer factory coverage for default, fallback, explicit score-based, and explicit round-robin cases - Add replica coverage for the default three-nodes-per-channel threshold - Pin existing tests to legacy `ScoreBasedBalancer` or explicit factors where the old behavior is the scenario under test - Update replica observer tests to provide target channel metadata explicitly - Add and refresh the channel exclusive mode design document under `docs/design-docs` ## Validation - `git diff --check` - `source ~/.profile && source scripts/setenv.sh && GOTOOLCHAIN=local go test -tags dynamic,test -gcflags="all=-N -l" github.com/milvus-io/milvus/pkg/v3/util/paramtable -run 'TestComponentParam' -count=1 -v` - Attempted reset-milvus; Docker daemon was unavailable and this worktree has no `bin/milvus`. - Added `internal/querycoordv2/meta` threshold coverage; local execution is blocked before assertions by stale Cgo output missing `C.SegcoreSetPrefetchThreadPoolNum`. Signed-off-by: Wei Liu <wei.liu@zilliz.com>