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

fix: too frequent flush #943

Merged
merged 2 commits into from
May 30, 2023
Merged
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion analytic_engine/src/compaction/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ impl ScheduleWorker {
}

async fn flush_tables(&self) {
info!("Scheduled flush all tables begins");
ShiKaiWi marked this conversation as resolved.
Show resolved Hide resolved

let mut tables_buf = Vec::new();
self.space_store.list_all_tables(&mut tables_buf);
let flusher = Flusher {
Expand All @@ -648,8 +650,14 @@ impl ScheduleWorker {
for table_data in &tables_buf {
let last_flush_time = table_data.last_flush_time();
if last_flush_time + self.max_unflushed_duration.as_millis_u64()
> common_util::time::current_time_millis()
< common_util::time::current_time_millis()
ShiKaiWi marked this conversation as resolved.
Show resolved Hide resolved
{
info!(
"Scheduled flush is triggered, table:{}, last_flush_time:{last_flush_time}ms, max_unflushed_duration:{:?}",
table_data.name,
self.max_unflushed_duration,
);

let mut serial_exec = table_data.serial_exec.lock().await;
let flush_scheduler = serial_exec.flush_scheduler();
// Instance flush the table asynchronously.
Expand All @@ -661,6 +669,8 @@ impl ScheduleWorker {
}
}
}

info!("Scheduled flush all tables finishes");
}
}

Expand Down