From 59387f0b3aa85e103160280b5f4bebe413173c1f Mon Sep 17 00:00:00 2001 From: congqixia Date: Fri, 23 Aug 2024 14:09:03 +0800 Subject: [PATCH] fix: Use correct release func when datanode unwatch a channel (#35655) See also #35654 Signed-off-by: Congqi Xia --- internal/datanode/channel/channel_manager.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/datanode/channel/channel_manager.go b/internal/datanode/channel/channel_manager.go index 191f7e22c1..fec7d67d55 100644 --- a/internal/datanode/channel/channel_manager.go +++ b/internal/datanode/channel/channel_manager.go @@ -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(), }