rpuch commented on code in PR #1325:
URL: https://github.com/apache/ignite-3/pull/1325#discussion_r1033191087


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##########
@@ -185,7 +212,7 @@ protected void close(boolean destroy) throws 
StorageException {
             AbstractPageMemoryMvPartitionStorage partition = 
mvPartitions.getAndUpdate(i, p -> null);
 
             if (partition != null) {
-                closeables.add(destroy ? partition::destroy : 
partition::close);
+                closeables.add(destroy ? () -> 
destroyMvPartitionStorage(partition) : partition::close);

Review Comment:
   Is it ok that we don't wait for any partition to be actually destroyed (as 
we just ignore the returned futures)?



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/Checkpointer.java:
##########
@@ -442,7 +444,8 @@ boolean writePages(
     }
 
     private void syncUpdatedPageStores(
-            ConcurrentMap<GroupPartitionId, LongAdder> updatedPartitions
+            ConcurrentMap<GroupPartitionId, LongAdder> updatedPartitions,
+            CheckpointProgressImpl currentCheckpointProgress

Review Comment:
   This parameter does not seem to be used



##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbTableStorage.java:
##########
@@ -378,21 +381,38 @@ public RocksDbMvPartitionStorage 
getOrCreateMvPartition(int partitionId) throws
     }
 
     @Override
-    public void destroyPartition(int partitionId) throws StorageException {
+    public CompletableFuture<Void> destroyPartition(int partitionId) {
         checkPartitionId(partitionId);
 
+        CompletableFuture<Void> destroyPartitionFuture = new 
CompletableFuture<>();
+
+        CompletableFuture<Void> previousDestroyPartitionFuture = 
partitionIdDestroyFutureMap.putIfAbsent(
+                partitionId,
+                destroyPartitionFuture
+        );
+
+        if (previousDestroyPartitionFuture != null) {
+            return previousDestroyPartitionFuture;
+        }
+
         RocksDbMvPartitionStorage mvPartition = 
partitions.getAndSet(partitionId, null);
 
         if (mvPartition != null) {
-            //TODO IGNITE-17626 Destroy indexes as well...
-            mvPartition.destroy();
-
             try {
+                //TODO IGNITE-17626 Destroy indexes as well...
+                mvPartition.destroy();

Review Comment:
   Can this operation take a long time? If not, please add a comment stating 
this; if yes, probably a TODO should be added to address this later as 
`MvTableStorage#destroyPartition()` should be async after the latest changes.



-- 
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]

Reply via email to