sk0x50 commented on a change in pull request #5779: IGNITE-10508 Support the
new checkpoint feature not wait for the previous operation to complete
URL: https://github.com/apache/ignite/pull/5779#discussion_r253419381
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
##########
@@ -3360,59 +3423,230 @@ private void doCheckpoint() {
markCheckpointEnd(chp);
}
- tracker.onEnd();
-
- if (chp.hasDelta() || destroyedPartitionsCnt > 0) {
- if (printCheckpointStats) {
- if (log.isInfoEnabled()) {
- String walSegsCoveredMsg =
prepareWalSegsCoveredMsg(chp.walSegsCoveredRange);
-
- log.info(String.format("Checkpoint finished
[cpId=%s, pages=%d, markPos=%s, " +
- "walSegmentsCleared=%d,
walSegmentsCovered=%s, markDuration=%dms, pagesWrite=%dms, fsync=%dms, " +
- "total=%dms]",
- chp.cpEntry != null ?
chp.cpEntry.checkpointId() : "",
- chp.pagesSize,
- chp.cpEntry != null ?
chp.cpEntry.checkpointMark() : "",
- chp.walFilesDeleted,
- walSegsCoveredMsg,
- tracker.markDuration(),
- tracker.pagesWriteDuration(),
- tracker.fsyncDuration(),
- tracker.totalDuration()));
- }
- }
- }
+ updateMetrics(chp);
- updateMetrics(chp, tracker);
+ // Print checkpoint finish message.
+ printCheckpointFinish(chp);
}
catch (IgniteCheckedException e) {
if (chp != null)
chp.progress.cpFinishFut.onDone(e);
+ // In case of checkpoint initialization error node should be
invalidated and stopped.
cctx.kernalContext().failure().process(new
FailureContext(FailureType.CRITICAL_ERROR, e));
}
}
+ /**
+ * @param chp Checkpoint entry.
+ * @return {@code True} if current checkpoint operation canceleted.
+ */
+ private boolean checkCancel(Checkpoint chp) {
+ CheckpointProgress cpProgress = chp.progress;
+
+ if (shutdownNow) {
+ cpProgress.cpFinishFut.onDone(new NodeStoppingException("Node
is stopping."));
+
+ return true;
+ }
+
+ if (allowCheckpointCancel){
+ // Check cancel flag for current checkpoint.
+ // Only one cancel is allow, second will be ignore via
prevCanceled flag.
+ if (cpProgress.canceled && !cpProgress.prevCanceled) {
+ //TODO Actions after checkpoint canceled.
+ printCheckpointCancel(chp);
+
+ return true;
+ }
+ else
+ return false;
Review comment:
It seems that this return statement is redundant.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services