From 4a82177f69a475d5d11d263ba746fa5ca630ff53 Mon Sep 17 00:00:00 2001 From: Michal Maslanka Date: Tue, 7 Nov 2023 16:34:15 +0100 Subject: [PATCH] rm_stm: clear metrics when stopping rm_stm When `rm_stm` is stopped it should release all used resources including metrics name. This will allow partition to be recreated if required. Signed-off-by: Michal Maslanka --- src/v/cluster/rm_stm.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/v/cluster/rm_stm.cc b/src/v/cluster/rm_stm.cc index f4237cb014ab..750a8f7adc42 100644 --- a/src/v/cluster/rm_stm.cc +++ b/src/v/cluster/rm_stm.cc @@ -993,6 +993,7 @@ ss::future<> rm_stm::stop() { _log_stats_timer.cancel(); co_await _gate.close(); co_await reset_producers(); + _metrics.clear(); co_await persisted_stm<>::stop(); }