From 235bbc870e2d63aac90d7ba5154b22282d8cc4dd Mon Sep 17 00:00:00 2001 From: Zixiong Liu Date: Mon, 28 Mar 2022 12:56:27 +0800 Subject: [PATCH] owner(cdc): clean up metrics when owner resigns (#4998) close pingcap/tiflow#4774 --- cdc/owner/owner.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cdc/owner/owner.go b/cdc/owner/owner.go index db24995c367..1a516bdbaa2 100644 --- a/cdc/owner/owner.go +++ b/cdc/owner/owner.go @@ -251,6 +251,7 @@ func (o *Owner) WriteDebugInfo(w io.Writer) { // AsyncStop stops the owner asynchronously func (o *Owner) AsyncStop() { atomic.StoreInt32(&o.closed, 1) + o.cleanStaleMetrics() } func (o *Owner) cleanUpChangefeed(state *orchestrator.ChangefeedReactorState) {