This is an automated email from the ASF dual-hosted git repository.
jiacai2050 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/horaedb.git
The following commit(s) were added to refs/heads/main by this push:
new 42baf2ee chore: record replay cost in log (#1569)
42baf2ee is described below
commit 42baf2eea5d0fe02f99b6a820e1fb318e433d55f
Author: Jiacai Liu <[email protected]>
AuthorDate: Sat Sep 14 15:25:11 2024 +0800
chore: record replay cost in log (#1569)
## 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
---
src/analytic_engine/src/instance/wal_replayer.rs | 11 ++++++-----
src/analytic_engine/src/lib.rs | 2 +-
src/server/src/http.rs | 1 -
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/analytic_engine/src/instance/wal_replayer.rs
b/src/analytic_engine/src/instance/wal_replayer.rs
index ac1c1a8e..251797bf 100644
--- a/src/analytic_engine/src/instance/wal_replayer.rs
+++ b/src/analytic_engine/src/instance/wal_replayer.rs
@@ -22,6 +22,7 @@ use std::{
fmt::Display,
ops::Range,
sync::Arc,
+ time::Instant,
};
use async_trait::async_trait;
@@ -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
}
diff --git a/src/analytic_engine/src/lib.rs b/src/analytic_engine/src/lib.rs
index 9b2780dd..4b80741f 100644
--- a/src/analytic_engine/src/lib.rs
+++ b/src/analytic_engine/src/lib.rs
@@ -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(),
}
}
diff --git a/src/server/src/http.rs b/src/server/src/http.rs
index da74ee84..83dad878 100644
--- a/src/server/src/http.rs
+++ b/src/server/src/http.rs
@@ -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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]