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

Commit

Permalink
sqld: honor checkpoint-interval-s even without bottomless (#781)
Browse files Browse the repository at this point in the history
There's no reason I'm aware of to only make checkpoint-interval-s
option effective if bottomless is enabled. Botomlessless instances
should also be able to checkpoint periodically.
  • Loading branch information
psarna authored Oct 16, 2023
1 parent eb92268 commit 704b4de
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions sqld/src/namespace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,12 +719,11 @@ impl Namespace<PrimaryDatabase> {

let is_fresh_db = check_fresh_db(&db_path)?;
// switch frame-count checkpoint to time-based one
let auto_checkpoint =
if config.checkpoint_interval.is_some() && config.bottomless_replication.is_some() {
0
} else {
DEFAULT_AUTO_CHECKPOINT
};
let auto_checkpoint = if config.checkpoint_interval.is_some() {
0
} else {
DEFAULT_AUTO_CHECKPOINT
};

let logger = Arc::new(ReplicationLogger::open(
&db_path,
Expand Down Expand Up @@ -790,13 +789,11 @@ impl Namespace<PrimaryDatabase> {

join_set.spawn(run_periodic_compactions(logger.clone()));

if config.bottomless_replication.is_some() {
if let Some(checkpoint_interval) = config.checkpoint_interval {
join_set.spawn(run_periodic_checkpoint(
connection_maker.clone(),
checkpoint_interval,
));
}
if let Some(checkpoint_interval) = config.checkpoint_interval {
join_set.spawn(run_periodic_checkpoint(
connection_maker.clone(),
checkpoint_interval,
));
}

Ok(Self {
Expand Down

0 comments on commit 704b4de

Please sign in to comment.