fix: Use correct release func when datanode unwatch a channel (#35655)

See also #35654

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/35616/head^2
congqixia 2024-08-23 14:09:03 +08:00 committed by GitHub
parent e8e3544a11
commit 59387f0b3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 1 deletions

View File

@ -71,7 +71,15 @@ func NewChannelManager(pipelineParams *util.PipelineParams, fgManager pipeline.F
opRunners: typeutil.NewConcurrentMap[string, *opRunner](),
abnormals: typeutil.NewConcurrentMap[int64, string](),
releaseFunc: fgManager.RemoveFlowgraph,
releaseFunc: func(channelName string) {
if pipelineParams.CompactionExecutor != nil {
pipelineParams.CompactionExecutor.DiscardPlan(channelName)
}
if pipelineParams.WriteBufferManager != nil {
pipelineParams.WriteBufferManager.RemoveChannel(channelName)
}
fgManager.RemoveFlowgraph(channelName)
},
closeCh: lifetime.NewSafeChan(),
}