enhance: clean channel node info in meta store (#32988)

issue: #32910
see also: #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>
pull/33035/head
wei liu 2024-05-14 10:05:40 +08:00 committed by GitHub
parent a984e46a29
commit cba2c7a3be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View File

@ -297,6 +297,7 @@ queryCoord:
checkNodeSessionInterval: 60 # the interval(in seconds) of check querynode cluster session
gracefulStopTimeout: 5 # seconds. force stop node without graceful stop
enableStoppingBalance: true # whether enable stopping balance
channelExclusiveNodeFactor: 4 # the least node number for enable channel's exclusive mode
cleanExcludeSegmentInterval: 60 # the time duration of clean pipeline exclude segment which used for filter invalid data, in seconds
ip: # if not specified, use the first unicastable address
port: 19531

View File

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

View File

@ -180,6 +180,9 @@ func (suite *ReplicaSuite) testRead(r *Replica) {
}
func (suite *ReplicaSuite) TestChannelExclusiveMode() {
paramtable.Get().Save(paramtable.Get().QueryCoordCfg.Balancer.Key, ChannelLevelScoreBalancerName)
defer paramtable.Get().Reset(paramtable.Get().QueryCoordCfg.Balancer.Key)
r := newReplica(&querypb.Replica{
ID: 1,
CollectionID: 2,