Skip to content

Commit

Permalink
address some log problems
Browse files Browse the repository at this point in the history
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
  • Loading branch information
CalvinNeo committed Aug 30, 2022
1 parent 12c105d commit 17eb204
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
22 changes: 10 additions & 12 deletions components/raftstore/src/engine_store_ffi/observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_) => (),
}
});
Expand All @@ -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()
);
}
}
}
Expand Down Expand Up @@ -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
Expand All @@ -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 => {
Expand All @@ -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(())
}

Expand Down
3 changes: 2 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 17eb204

Please sign in to comment.