Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: record replay cost in log #1569

Merged
merged 3 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -204,7 +204,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
Loading