Skip to content

Commit

Permalink
fix: Don't create checkpoint if source is not restarable (#2070)
Browse files Browse the repository at this point in the history
  • Loading branch information
chubei authored Sep 22, 2023
1 parent 556ce6b commit 4aebc23
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dozer-core/src/epoch/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,16 @@ impl EpochManager {
let instant = SystemTime::now();
let action = if *should_commit {
let num_records = self.record_store().num_records();
if num_records - state.next_record_index_to_persist
if source_states.values().all(|table_states| {
table_states
.values()
.all(|&state| state != TableState::NonRestartable)
}) && (num_records - state.next_record_index_to_persist
>= self.options.max_num_records_before_persist
|| instant
.duration_since(state.last_persisted_epoch_decision_instant)
.unwrap_or(Duration::from_secs(0))
>= Duration::from_secs(self.options.max_interval_before_persist_in_seconds)
>= Duration::from_secs(self.options.max_interval_before_persist_in_seconds))
{
state.next_record_index_to_persist = num_records;
state.last_persisted_epoch_decision_instant = instant;
Expand Down

0 comments on commit 4aebc23

Please sign in to comment.