Skip to content

Commit

Permalink
fix some checkpoint err
Browse files Browse the repository at this point in the history
  • Loading branch information
ic4y committed Sep 14, 2023
1 parent b975648 commit 8399565
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,24 +406,25 @@ protected void tryTriggerPendingCheckpoint(CheckpointType checkpointType) {
shutdown));
return;
}
if (checkpointType.isFinalCheckpoint() || checkpointType.isSchemaChangeCheckpoint()) {
if (pendingCounter.get() > 0) {
scheduleTriggerPendingCheckpoint(checkpointType, 500L);
return;
}
}

if (schemaChanging.get() && checkpointType.isGeneralCheckpoint()) {
LOG.info("skip trigger generic-checkpoint because schema change in progress");
return;
}

if (pendingCounter.get() > 0) {
scheduleTriggerPendingCheckpoint(checkpointType, 500L);
LOG.info(
"skip trigger checkpoint because there is already a pending checkpoint.");
return;
}

CompletableFuture<PendingCheckpoint> pendingCheckpoint =
createPendingCheckpoint(currentTimestamp, checkpointType);
startTriggerPendingCheckpoint(pendingCheckpoint);
pendingCounter.incrementAndGet();
// if checkpoint type are final type, we don't need to trigger next checkpoint
if (checkpointType.notFinalCheckpoint() && checkpointType.notSchemaChangeCheckpoint()) {
if (checkpointType.notFinalCheckpoint()) {
scheduleTriggerPendingCheckpoint(coordinatorConfig.getCheckpointInterval());
}
}
Expand Down

0 comments on commit 8399565

Please sign in to comment.