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

sqld: honor checkpoint-interval-s even without bottomless #781

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Changes from all commits
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
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
Loading