tkalkirill commented on code in PR #1325:
URL: https://github.com/apache/ignite-3/pull/1325#discussion_r1031173887
##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/compaction/Compactor.java:
##########
@@ -357,14 +387,70 @@ void mergeDeltaFileToMainFile(
return;
}
+ if (filePageStore.isMarkedToDestroy()) {
+ return;
+ }
+
boolean removed = filePageStore.removeDeltaFile(deltaFilePageStore);
assert removed : filePageStore.filePath();
deltaFilePageStore.markMergedToFilePageStore();
deltaFilePageStore.stop(true);
+ }
+
+ /**
+ * Callback on destruction of the partition of the corresponding group.
+ *
+ * <p>If the partition compaction is in progress, then we will wait until
it is completed so that there are no errors when we want to
+ * destroy the partition file and its delta file, and at this time its
compaction occurs.
+ *
+ * @param groupId Group ID.
+ * @param partitionId Partition ID.
+ */
+ public void onPartitionDestruction(int groupId, int partitionId) throws
IgniteInternalCheckedException {
+ CompletableFuture<Void> partitionProcessingFuture =
processedPartitionMap.getProcessedPartitionFuture(groupId, partitionId);
+
+ if (partitionProcessingFuture != null) {
+ try {
+ // Time is taken arbitrarily, but long enough to allow time
for the future to complete.
+ partitionProcessingFuture.get(10, SECONDS);
+ } catch (Exception e) {
+ throw new IgniteInternalCheckedException(
+ IgniteStringFormatter.format(
+ "Error waiting for partition processing to
complete on compaction: [groupId={}, partitionId={}]",
+ groupId,
+ partitionId
+ ),
+ e
+ );
+ }
+ }
+ }
+
+ /**
+ * Delta file for compaction.
+ */
+ private static class DeltaFileToCompaction {
Review Comment:
Fix it
--
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]