Skip to content

Commit

Permalink
raftstore: fix the building warning caused by the feature cfg (#13004)
Browse files Browse the repository at this point in the history
ref #12063

Fix the building warning caused by the feature cfg.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
  • Loading branch information
JmPotato and ti-chi-bot committed Jul 13, 2022
1 parent b558d0b commit 2edf25d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions components/raftstore/src/store/worker/split_controller.rs
Expand Up @@ -8,7 +8,6 @@ use std::{
time::{Duration, SystemTime},
};

use fail::fail_point;
use kvproto::{
kvrpcpb::KeyRange,
metapb::{self, Peer},
Expand Down Expand Up @@ -619,7 +618,7 @@ impl AutoSplitController {

fn is_grpc_poll_busy(&self, grpc_thread_usage: f64) -> bool {
#[cfg(feature = "failpoints")]
fail_point!("mock_grpc_poll_is_not_busy", |_| { false });
fail::fail_point!("mock_grpc_poll_is_not_busy", |_| { false });
if self.max_grpc_thread_count == 0 {
return false;
}
Expand All @@ -630,7 +629,7 @@ impl AutoSplitController {

fn is_unified_read_pool_busy(&self, unified_read_pool_thread_usage: f64) -> bool {
#[cfg(feature = "failpoints")]
fail_point!("mock_unified_read_pool_is_busy", |_| { true });
fail::fail_point!("mock_unified_read_pool_is_busy", |_| { true });
if self.max_unified_read_pool_thread_count == 0 {
return false;
}
Expand All @@ -645,7 +644,7 @@ impl AutoSplitController {

fn is_region_busy(&self, unified_read_pool_thread_usage: f64, region_cpu_usage: f64) -> bool {
#[cfg(feature = "failpoints")]
fail_point!("mock_region_is_busy", |_| { true });
fail::fail_point!("mock_region_is_busy", |_| { true });
if unified_read_pool_thread_usage <= 0.0 || !self.should_check_region_cpu() {
return false;
}
Expand Down Expand Up @@ -798,9 +797,8 @@ impl AutoSplitController {
.with_label_values(&["read"])
.observe(qps as f64);

// 1. If the QPS and Byte do not meet the threshold, skip.
// 2. If the Unified Read Pool is not busy or
// the Region is not hot enough (takes up 50% of the Unified Read Pool CPU times), skip.
// 1. If the QPS or the byte does not meet the threshold, skip.
// 2. If the Unified Read Pool or the region is not hot enough, skip.
if qps < self.cfg.qps_threshold
&& byte < self.cfg.byte_threshold
&& (!is_unified_read_pool_busy || !is_region_busy)
Expand Down

0 comments on commit 2edf25d

Please sign in to comment.