Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
turn off vacuum on each checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Horusiath committed Jul 26, 2023
1 parent 73a9f8f commit 075c370
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bottomless/src/replicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ impl Replicator {
} else {
tokio::fs::remove_file(&fpath).await.unwrap();
let elapsed = Instant::now() - start;
tracing::trace!("Uploaded to S3: {} in {:?}", fpath, elapsed);
tracing::debug!("Uploaded to S3: {} in {:?}", fpath, elapsed);
}
drop(permit);
});
Expand Down
7 changes: 5 additions & 2 deletions sqld/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ async fn start_primary(
) -> anyhow::Result<()> {
let is_fresh_db = check_fresh_db(&config.db_path);
// switch frame-count checkpoint to time-based one
let disable_auto_checkpoint = config.checkpoint_interval.is_some();
let disable_auto_checkpoint =
config.checkpoint_interval.is_some() && config.bottomless_replication.is_some();
let logger = Arc::new(ReplicationLogger::open(
&config.db_path,
config.max_log_size,
Expand Down Expand Up @@ -767,7 +768,9 @@ pub async fn run_server(config: Config) -> anyhow::Result<()> {
}

if let Some(interval) = config.checkpoint_interval {
join_set.spawn(run_checkpoint_cron(config.db_path.clone(), interval));
if config.bottomless_replication.is_some() {
join_set.spawn(run_checkpoint_cron(config.db_path.clone(), interval));
}
}

let reset = HARD_RESET.clone();
Expand Down
2 changes: 1 addition & 1 deletion sqld/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ struct Cli {
http_replication_listen_addr: Option<SocketAddr>,
/// Interval in seconds, in which WAL checkpoint is being called.
/// By default, the interval is 1 hour.
#[clap(long, env = "SQLD_CHECKPOINT_INTERVAL_S", default_value = "3600")]
#[clap(long, env = "SQLD_CHECKPOINT_INTERVAL_S")]
checkpoint_interval_s: Option<u64>,
}

Expand Down
1 change: 0 additions & 1 deletion sqld/src/replication/primary/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,6 @@ fn checkpoint_db(data_path: &Path, disable_auto_checkpoint: bool) -> anyhow::Res
if num_checkpointed == -1 {
bail!("Checkpoint failed: database journal_mode is not WAL")
} else {
conn.execute("VACUUM", ())?;
Ok(())
}
} else {
Expand Down

0 comments on commit 075c370

Please sign in to comment.