Skip to content

Commit

Permalink
chore: reduce kafka logs (#986)
Browse files Browse the repository at this point in the history
## Rationale
There are too many logs.

## Detailed Changes
- Log level change to debug
- Tempfile is put in dev-dependencies.

## Test Plan
No need
  • Loading branch information
jiacai2050 authored Jun 12, 2023
1 parent 3c2a05a commit 2e20665
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ endif
fix:
cargo fmt
cargo sort --workspace
cargo clippy --fix --all-targets --all-features --workspace -- -D warnings
cargo clippy --fix --allow-staged --all-targets --all-features --workspace -- -D warnings
1 change: 1 addition & 0 deletions analytic_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ common_util = { workspace = true, features = ["test"] }
env_logger = { workspace = true }
pin-project-lite = { workspace = true }
rand = { workspace = true }
tempfile = { workspace = true }
wal = { workspace = true, features = ["test"] }
8 changes: 4 additions & 4 deletions wal/src/message_queue_impl/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use util::*;
use crate::{
kv_encoder::CommonLogEncoding,
log_batch::{LogEntry, LogWriteBatch},
manager::{self},
manager,
message_queue_impl::{
encoding::{format_wal_data_topic_name, format_wal_meta_topic_name, MetaEncoding},
log_cleaner::LogCleaner,
Expand Down Expand Up @@ -258,7 +258,7 @@ impl<M: MessageQueue> Region<M> {
})?;

ensure!(returned_high_watermark == high_watermark, OpenNoCause { namespace , region_id, msg: format!(
"failed while recover from meta, high watermark shouldn't changed while opening region,
"failed while recover from meta, high watermark shouldn't changed while opening region,
origin high watermark:{high_watermark}, returned high watermark:{returned_high_watermark}")
});

Expand Down Expand Up @@ -375,7 +375,7 @@ impl<M: MessageQueue> Region<M> {
})?;

ensure!(returned_high_watermark == high_watermark, OpenNoCause { namespace , region_id, msg: format!(
"failed while recover from log, high watermark shouldn't changed while opening region,
"failed while recover from log, high watermark shouldn't changed while opening region,
origin high watermark:{high_watermark}, returned high watermark:{returned_high_watermark}")
});

Expand Down Expand Up @@ -702,7 +702,7 @@ impl<M: MessageQueue> RegionInner<M> {
.await
.map_err(Box::new)?;

debug!("Create scanning iterator successfully, region id:{}, table id:{:?}, log topic:{}, scan range{:?}", self.region_context.region_id(),
debug!("Create scanning iterator successfully, region id:{}, table id:{:?}, log topic:{}, scan range{:?}", self.region_context.region_id(),
table_id, self.log_topic, scan_range);

Ok(MessageQueueLogIterator::new(
Expand Down
11 changes: 3 additions & 8 deletions wal/src/message_queue_impl/snapshot_synchronizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use common_util::{
define_result,
error::{BoxError, GenericError},
};
use log::info;
use log::debug;
use message_queue::MessageQueue;
use snafu::{ensure, Backtrace, ResultExt, Snafu};

Expand Down Expand Up @@ -67,11 +67,6 @@ impl<Mq: MessageQueue> SnapshotSynchronizer<Mq> {
meta_topic: String,
meta_encoding: MetaEncoding,
) -> Self {
info!(
"Snapshot synchronizer init, region id:{}, meta topic:{}",
region_id, meta_topic
);

Self {
region_id,
message_queue,
Expand All @@ -81,7 +76,7 @@ impl<Mq: MessageQueue> SnapshotSynchronizer<Mq> {
}

pub async fn sync(&self, snapshot: RegionMetaSnapshot) -> Result<()> {
info!(
debug!(
"Begin to sync snapshot to meta topic, snapshot:{:?}, topic:{}",
snapshot, self.meta_topic
);
Expand Down Expand Up @@ -140,7 +135,7 @@ impl<Mq: MessageQueue> SnapshotSynchronizer<Mq> {
topic: self.meta_topic.clone(),
})?;

info!(
debug!(
"Finished to sync snapshot to meta topic, topic:{}",
self.meta_topic
);
Expand Down

0 comments on commit 2e20665

Please sign in to comment.