From 4eb9ad46b9445b1740830905a075fd79ba3f115c Mon Sep 17 00:00:00 2001 From: yiwu-arbug Date: Tue, 22 Jun 2021 16:37:22 -0700 Subject: [PATCH] Fix wrong tikv_raftstore_hibernated_peer_state metric (#10420) * show hibernate_regions config Signed-off-by: Yi Wu * fix hibernate region metrics Signed-off-by: Yi Wu * fix merge Signed-off-by: Yi Wu Co-authored-by: Ti Chi Robot --- components/raftstore/src/store/config.rs | 2 +- components/raftstore/src/store/fsm/peer.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/raftstore/src/store/config.rs b/components/raftstore/src/store/config.rs index 52c47ea6c0d..4e421d40e88 100644 --- a/components/raftstore/src/store/config.rs +++ b/components/raftstore/src/store/config.rs @@ -164,7 +164,7 @@ pub struct Config { #[online_config(skip)] pub future_poll_size: usize, - #[online_config(hidden)] + #[online_config(skip)] pub hibernate_regions: bool, #[doc(hidden)] #[online_config(hidden)] diff --git a/components/raftstore/src/store/fsm/peer.rs b/components/raftstore/src/store/fsm/peer.rs index e65d07bf3e2..e4ed680799a 100644 --- a/components/raftstore/src/store/fsm/peer.rs +++ b/components/raftstore/src/store/fsm/peer.rs @@ -254,6 +254,7 @@ where let mut region = metapb::Region::default(); region.set_id(region_id); + HIBERNATED_PEER_STATE_GAUGE.awaken.inc(); let (tx, rx) = mpsc::loose_bounded(cfg.notify_capacity); Ok(( tx,