Skip to content

Commit

Permalink
add logs about region logs cleaning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Jun 21, 2023
1 parent 7ab8e8b commit f46a4d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wal/src/message_queue_impl/log_cleaner.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

//! Log cleaner

Expand Down Expand Up @@ -68,7 +68,7 @@ impl<M: MessageQueue> LogCleaner<M> {

pub async fn maybe_clean_logs(&mut self, safe_delete_offset: Offset) -> Result<()> {
info!(
"Begin to check and clean logs, region id:{}, topic:{}, safe delete offset:{:?}",
"Region clean logs begin, region id:{}, topic:{}, safe delete offset:{:?}",
self.region_id, self.log_topic, safe_delete_offset
);

Expand Down Expand Up @@ -102,7 +102,7 @@ impl<M: MessageQueue> LogCleaner<M> {
}

info!(
"Finished to check and clean logs, do clean:{}, region id:{}, topic:{}, prepare delete to offset:{:?}",
"Region clean logs finish, do clean:{}, region id:{}, topic:{}, prepare delete to offset:{:?}",
do_clean, self.region_id, self.log_topic, safe_delete_offset
);

Expand Down
2 changes: 2 additions & 0 deletions wal/src/message_queue_impl/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ impl<M: MessageQueue> Region<M> {
};

let safe_delete_offset = snapshot.safe_delete_offset();
info!("Region clean logs, snapshot:{snapshot:?}, safe_delete_offset:{safe_delete_offset}");

// Sync snapshot first.
synchronizer
.sync(snapshot)
Expand Down

0 comments on commit f46a4d2

Please sign in to comment.