From 17eb20473a6e8eabfaa92f1bd553085c542037a4 Mon Sep 17 00:00:00 2001 From: CalvinNeo Date: Tue, 30 Aug 2022 20:50:05 +0800 Subject: [PATCH] address some log problems Signed-off-by: CalvinNeo --- .../src/engine_store_ffi/observer.rs | 22 +++++++++---------- src/config.rs | 3 ++- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/components/raftstore/src/engine_store_ffi/observer.rs b/components/raftstore/src/engine_store_ffi/observer.rs index b686499b340..0ad84c60b6c 100644 --- a/components/raftstore/src/engine_store_ffi/observer.rs +++ b/components/raftstore/src/engine_store_ffi/observer.rs @@ -679,7 +679,7 @@ impl ApplySnapshotObserver for TiFlashObserver { &snap_key, ); match sender.send(res) { - Err(e) => error!("pre apply snapshot err when send to receiver";), + Err(e) => error!("pre apply snapshot err when send to receiver"), Ok(_) => (), } }); @@ -688,7 +688,10 @@ impl ApplySnapshotObserver for TiFlashObserver { self.engine .pending_applies_count .fetch_sub(1, Ordering::SeqCst); - error!("apply_snap_pool is not initialized, quit background pre apply"; "peer_id" => peer_id, "region_id" => ob_ctx.region().get_id()); + error!("apply_snap_pool is not initialized, quit background pre apply"; + "peer_id" => peer_id, + "region_id" => ob_ctx.region().get_id() + ); } } } @@ -721,11 +724,6 @@ impl ApplySnapshotObserver for TiFlashObserver { Some(t) => { let neer_retry = match t.recv.recv() { Ok(snap_ptr) => { - info!("get prehandled snapshot success"; - "peer_id" => ?peer_id, - "region" => ?ob_ctx.region(), - "pending" => self.engine.pending_applies_count.load(Ordering::SeqCst), - ); self.engine_store_server_helper .apply_pre_handled_snapshot(snap_ptr.0); false @@ -741,11 +739,6 @@ impl ApplySnapshotObserver for TiFlashObserver { self.engine .pending_applies_count .fetch_sub(1, Ordering::SeqCst); - info!("apply snapshot finished"; - "peer_id" => ?peer_id, - "region" => ?ob_ctx.region(), - "pending" => self.engine.pending_applies_count.load(Ordering::SeqCst), - ); neer_retry } None => { @@ -770,6 +763,11 @@ impl ApplySnapshotObserver for TiFlashObserver { self.engine_store_server_helper .apply_pre_handled_snapshot(ptr.0); } + info!("apply snapshot finished"; + "peer_id" => ?peer_id, + "region" => ?ob_ctx.region(), + "pending" => self.engine.pending_applies_count.load(Ordering::SeqCst), + ); Ok(()) } diff --git a/src/config.rs b/src/config.rs index 111e7b148d6..be06665adb3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -91,7 +91,8 @@ const LOCKCF_MIN_MEM: usize = 256 * MIB as usize; const LOCKCF_MAX_MEM: usize = GIB as usize; const RAFT_MIN_MEM: usize = 256 * MIB as usize; const RAFT_MAX_MEM: usize = 2 * GIB as usize; -const LAST_CONFIG_FILE: &str = "last_tikv.toml"; +/// Exported for extra checking. +pub const LAST_CONFIG_FILE: &str = "last_tikv.toml"; const TMP_CONFIG_FILE: &str = "tmp_tikv.toml"; const MAX_BLOCK_SIZE: usize = 32 * MIB as usize;