Skip to content

Commit

Permalink
chore: log and flush
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed Sep 12, 2023
1 parent 90a809b commit 52b8f07
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/mito2/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ impl WorkerGroup {
})
.collect();

info!(
"Started region worker group with {} workers",
config.num_workers
);

WorkerGroup { workers, scheduler }
}

Expand Down
4 changes: 4 additions & 0 deletions src/mito2/src/worker/handle_flush.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ impl<S> RegionWorkerLoop<S> {
// Flush memtable with max mutable memtable.
// TODO(yingwen): Maybe flush more tables to reduce write buffer size.
if let Some(region) = max_mem_region {
info!(
"Chosen the region {} with the maximum mutable memtable size to flush: {}.",
region.region_id, max_mutable_size
);
if !self.flush_scheduler.is_flush_requested(region.region_id) {
let task = self.new_flush_task(region, FlushReason::EngineFull);
self.flush_scheduler.schedule_flush(region, task)?;
Expand Down
6 changes: 3 additions & 3 deletions src/mito2/src/worker/handle_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ impl<S: LogStore> RegionWorkerLoop<S> {
mut write_requests: Vec<SenderWriteRequest>,
allow_stall: bool,
) {
// Flush this worker if the engine needs to flush.
self.maybe_flush_worker();

if write_requests.is_empty() {
return;
}

// Flush this worker if the engine needs to flush.
self.maybe_flush_worker();

if self.should_reject_write() {
// The memory pressure is still too high, reject write requests.
reject_write_requests(write_requests);
Expand Down

0 comments on commit 52b8f07

Please sign in to comment.