Skip to content

Commit

Permalink
chore: record replay cost in log (#1569)
Browse files Browse the repository at this point in the history
## Rationale


## Detailed Changes
1. Add replay cost in log
2. Remove verbose http log
3. Recover default to shard based, which is faster in most wal
implementation.

## Test Plan
  • Loading branch information
jiacai2050 committed Sep 14, 2024
1 parent 3bcc64f commit 42baf2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/analytic_engine/src/instance/wal_replayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use std::{
fmt::Display,
ops::Range,
sync::Arc,
time::Instant,
};

use async_trait::async_trait;
Expand Down Expand Up @@ -120,15 +121,15 @@ impl<'a> WalReplayer<'a> {
/// Replay tables and return the failed tables and the causes.
pub async fn replay(&mut self) -> Result<FailedTables> {
// Build replay action according to mode.
let table_num = self.table_datas.len();
info!(
"Replay wal logs begin, context:{}, tables:{:?}",
"Replay wal logs begin, context:{}, table_num:{table_num}, tables:{:?}",
self.context, self.table_datas
);
let begin = Instant::now();
let result = self.replay.run(&self.context, self.table_datas).await;
info!(
"Replay wal logs finish, context:{}, tables:{:?}",
self.context, self.table_datas,
);
let cost = Instant::now().duration_since(begin);
info!("Replay wal logs finish, table_num:{table_num}, cost:{cost:?}");

result
}
Expand Down
2 changes: 1 addition & 1 deletion src/analytic_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl Default for Config {
wal_encode: WalEncodeConfig::default(),
wal: WalConfig::default(),
remote_engine_client: remote_engine_client::config::Config::default(),
recover_mode: RecoverMode::TableBased,
recover_mode: RecoverMode::ShardBased,
metrics: MetricsOptions::default(),
}
}
Expand Down
1 change: 0 additions & 1 deletion src/server/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ impl Service {
.or(self.wal_stats())
.or(self.query_push_down())
.or(self.slow_threshold())
.with(warp::log("http_requests"))
.with(warp::log::custom(|info| {
let path = info.path();
// Don't record /debug API
Expand Down

0 comments on commit 42baf2e

Please sign in to comment.