Skip to content

Commit cba2c7a

Browse files
authored
enhance: clean channel node info in meta store (milvus-io#32988)
issue: milvus-io#32910 see also: milvus-io#32911 when channel exclusive mode is enabled, replica will record channel node info in meta store, and if the balance policy changes, which means channel exclusive mode is disabled, we should clean up the channel node info in meta store, and stop to balance node between channels. Signed-off-by: Wei Liu <wei.liu@zilliz.com>
1 parent a984e46 commit cba2c7a

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

configs/milvus.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ queryCoord:
297297
checkNodeSessionInterval: 60 # the interval(in seconds) of check querynode cluster session
298298
gracefulStopTimeout: 5 # seconds. force stop node without graceful stop
299299
enableStoppingBalance: true # whether enable stopping balance
300+
channelExclusiveNodeFactor: 4 # the least node number for enable channel's exclusive mode
300301
cleanExcludeSegmentInterval: 60 # the time duration of clean pipeline exclude segment which used for filter invalid data, in seconds
301302
ip: # if not specified, use the first unicastable address
302303
port: 19531

internal/querycoordv2/meta/replica.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,11 @@ func (replica *mutableReplica) tryBalanceNodeForChannel() {
230230
return
231231
}
232232

233+
balancePolicy := paramtable.Get().QueryCoordCfg.Balancer.GetValue()
234+
enableChannelExclusiveMode := balancePolicy == ChannelLevelScoreBalancerName
233235
channelExclusiveFactor := paramtable.Get().QueryCoordCfg.ChannelExclusiveNodeFactor.GetAsInt()
234-
// to do: if query node scale in happens, and the condition does not meet, should we exit channel's exclusive mode?
235-
if len(replica.rwNodes) < len(channelNodeInfos)*channelExclusiveFactor {
236+
// if balance policy or node count doesn't match condition, clean up channel node info
237+
if !enableChannelExclusiveMode || len(replica.rwNodes) < len(channelNodeInfos)*channelExclusiveFactor {
236238
for name := range replica.replicaPB.GetChannelNodeInfos() {
237239
replica.replicaPB.ChannelNodeInfos[name] = &querypb.ChannelNodeInfo{}
238240
}

internal/querycoordv2/meta/replica_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ func (suite *ReplicaSuite) testRead(r *Replica) {
180180
}
181181

182182
func (suite *ReplicaSuite) TestChannelExclusiveMode() {
183+
paramtable.Get().Save(paramtable.Get().QueryCoordCfg.Balancer.Key, ChannelLevelScoreBalancerName)
184+
defer paramtable.Get().Reset(paramtable.Get().QueryCoordCfg.Balancer.Key)
185+
183186
r := newReplica(&querypb.Replica{
184187
ID: 1,
185188
CollectionID: 2,

0 commit comments

Comments
 (0)