nizhikov commented on code in PR #10292:
URL: https://github.com/apache/ignite/pull/10292#discussion_r1005707191
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotFutureTask.java:
##########
@@ -102,7 +115,62 @@ public IncrementalSnapshotFutureTask(
return false;
}
- onDone(new IncrementalSnapshotFutureTaskResult());
+
cctx.kernalContext().pools().getSnapshotExecutorService().submit(() -> {
+ try {
+ // First increment must include low segment, because full
snapshot knows nothing about WAL.
+ // All other begins from the next segment because lowPtr
already saved inside previous increment.
+ long lowIdx = lowPtr.index() + (incIdx == 1 ? 0 : 1);
+ long highIdx = highPtr.index();
+
+ boolean compactionEnabled =
+
cctx.gridConfig().getDataStorageConfiguration().isWalCompactionEnabled();
+
+ if (log.isInfoEnabled()) {
+ log.info("Waiting for WAL segments archivation
[lowIdx=" + lowIdx +
+ ", highIdx=" + highIdx +
+ ", compaction=" + compactionEnabled + ']');
+ }
+
+ assert lowIdx <= highIdx;
+
+ cctx.wal().awaitArchived(highPtr.index());
+
+ if (compactionEnabled) {
+ if (log.isInfoEnabled()) {
+ log.info("Waiting for WAL segments compression
[lowIdx=" + lowIdx +
+ ", highIdx=" + highIdx + ']');
+ }
+
+ cctx.wal().awaitCompressed(highPtr.index());
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Linking WAL segments into incremental
snapshot [lowIdx=" + lowIdx +
+ ", highIdx=" + highIdx +
+ ", compaction=" + compactionEnabled + ']');
+ }
+
+ for (; lowIdx <= highIdx; lowIdx++) {
+ File seg = compactionEnabled
+ ? cctx.wal().compressedSegment(lowIdx)
+ : cctx.wal().archiveSegment(lowIdx);
+
+ assert seg.exists();
Review Comment:
Fixed. Test added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]