You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "sashapolo (via GitHub)" <gi...@apache.org> on 2024/03/12 08:58:02 UTC

[PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

sashapolo opened a new pull request, #3399:
URL: https://github.com/apache/ignite-3/pull/3399

   https://issues.apache.org/jira/browse/IGNITE-21671
   
   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1523432435


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/meta/IndexMeta.java:
##########
@@ -27,6 +27,37 @@
  * Index meta information.
  */
 public class IndexMeta extends IndexMetaKey {
+    /** Index type. */
+    public enum IndexType {

Review Comment:
   This class is only a couple of lines long, what's the point? Also, `IndexType` is a very broad name, it's nice to have it nested in `IndexMeta` to better understand, where this type is used.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1524314359


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/meta/IndexMeta.java:
##########
@@ -27,6 +27,37 @@
  * Index meta information.
  */
 public class IndexMeta extends IndexMetaKey {
+    /** Index type. */
+    public enum IndexType {

Review Comment:
   Ok



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1524562943


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/CatalogStorageIndexDescriptorSupplier.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.table.distributed;
+
+import org.apache.ignite.internal.catalog.CatalogService;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexDescriptor;
+import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor;
+import org.apache.ignite.internal.hlc.HybridTimestamp;
+import org.apache.ignite.internal.storage.index.StorageIndexDescriptor;
+import org.apache.ignite.internal.storage.index.StorageIndexDescriptorSupplier;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Index descriptor supplier from catalog.
+ */
+class CatalogStorageIndexDescriptorSupplier implements StorageIndexDescriptorSupplier {
+    private final CatalogService catalogService;
+
+    private final LowWatermark lowWatermark;
+
+    CatalogStorageIndexDescriptorSupplier(CatalogService catalogService, LowWatermark lowWatermark) {
+        this.catalogService = catalogService;
+        this.lowWatermark = lowWatermark;
+    }
+
+    @Override
+    public @Nullable StorageIndexDescriptor get(int indexId) {
+        // Search for the index in the catalog history, which versions correspond to (lowWatermark, now] timestamp range.
+        int latestCatalogVersion = catalogService.latestCatalogVersion();
+
+        HybridTimestamp lowWatermarkTimestamp = lowWatermark.getLowWatermark();

Review Comment:
   Fixed



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo merged PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1523430691


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/CatalogStorageIndexDescriptorSupplier.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.table.distributed;
+
+import org.apache.ignite.internal.catalog.CatalogService;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexDescriptor;
+import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor;
+import org.apache.ignite.internal.hlc.HybridTimestamp;
+import org.apache.ignite.internal.storage.index.StorageIndexDescriptor;
+import org.apache.ignite.internal.storage.index.StorageIndexDescriptorSupplier;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Index descriptor supplier from catalog.
+ */
+class CatalogStorageIndexDescriptorSupplier implements StorageIndexDescriptorSupplier {
+    private final CatalogService catalogService;
+
+    private final LowWatermark lowWatermark;
+
+    CatalogStorageIndexDescriptorSupplier(CatalogService catalogService, LowWatermark lowWatermark) {
+        this.catalogService = catalogService;
+        this.lowWatermark = lowWatermark;
+    }
+
+    @Override
+    public @Nullable StorageIndexDescriptor get(int indexId) {
+        // Search for the index in the catalog history, which versions correspond to (lowWatermark, now] timestamp range.
+        int latestCatalogVersion = catalogService.latestCatalogVersion();
+
+        HybridTimestamp lowWatermarkTimestamp = lowWatermark.getLowWatermark();

Review Comment:
   What kind of race are you talking about? This code is executed during partition start, if LWM is changed during the partition start, I guess we would should block it anyway externally, because we need to execute some logic on this partition, no? 



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1523433537


##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##########
@@ -113,7 +114,40 @@ public abstract class AbstractMvTableStorageTest extends BaseMvStoragesTest {
 
     protected StorageHashIndexDescriptor hashIdx;
 
-    protected final CatalogService catalogService = mock(CatalogService.class);
+    private final CatalogService catalogService = mock(CatalogService.class);
+
+    protected final StorageIndexDescriptorSupplier indexDescriptorSupplier = new StorageIndexDescriptorSupplier() {
+        @Override
+        public @Nullable StorageIndexDescriptor get(int indexId) {
+            int catalogVersion = catalogService.latestCatalogVersion();
+
+            CatalogIndexDescriptor indexDescriptor = catalogService.index(indexId, catalogVersion);
+
+            if (indexDescriptor == null) {
+                return null;
+            }
+
+            CatalogTableDescriptor tableDescriptor = catalogService.table(indexDescriptor.tableId(), catalogVersion);
+
+            assertThat(tableDescriptor, is(notNullValue()));
+
+            return StorageIndexDescriptor.create(tableDescriptor, indexDescriptor);
+        }
+    };
+
+    private class TestRow {

Review Comment:
   I see IgniteTuple - I lose all of my temper and need to refactor it immediately



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1523383359


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/PageMemoryIndexes.java:
##########
@@ -105,8 +109,17 @@ void performRecovery(
                 StorageIndexDescriptor indexDescriptor = indexDescriptorSupplier.get(indexId);
 
                 if (indexDescriptor == null) {
-                    // TODO: IGNITE-21671 destroy the index if it can't be found in the Catalog.
-                    continue;
+                    // Index has not been found in the Catalog, we can treat it as destroyed and remove the storage.
+                    runConsistently.accept(locker -> {
+                        destroyIndexOnRecovery(indexMeta, indexStorageFactory, indexMetaTree)
+                                .whenComplete((v, e) -> {
+                                    if (e != null) {
+                                        LOG.error("Unable to destroy existing index that has been removed from the Catalog", e);

Review Comment:
   Let's indicate which index could not be deleted.



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/meta/IndexMeta.java:
##########
@@ -27,6 +27,37 @@
  * Index meta information.
  */
 public class IndexMeta extends IndexMetaKey {
+    /** Index type. */
+    public enum IndexType {

Review Comment:
   Maybe separate class file?



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/CatalogStorageIndexDescriptorSupplier.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.table.distributed;
+
+import org.apache.ignite.internal.catalog.CatalogService;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexDescriptor;
+import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor;
+import org.apache.ignite.internal.hlc.HybridTimestamp;
+import org.apache.ignite.internal.storage.index.StorageIndexDescriptor;
+import org.apache.ignite.internal.storage.index.StorageIndexDescriptorSupplier;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Index descriptor supplier from catalog.
+ */
+class CatalogStorageIndexDescriptorSupplier implements StorageIndexDescriptorSupplier {
+    private final CatalogService catalogService;
+
+    private final LowWatermark lowWatermark;
+
+    CatalogStorageIndexDescriptorSupplier(CatalogService catalogService, LowWatermark lowWatermark) {
+        this.catalogService = catalogService;
+        this.lowWatermark = lowWatermark;
+    }
+
+    @Override
+    public @Nullable StorageIndexDescriptor get(int indexId) {
+        // Search for the index in the catalog history, which versions correspond to (lowWatermark, now] timestamp range.
+        int latestCatalogVersion = catalogService.latestCatalogVersion();
+
+        HybridTimestamp lowWatermarkTimestamp = lowWatermark.getLowWatermark();

Review Comment:
   I think there may be a race here, as soon as we read the lwm it can immediately change and the index should already begin to be destroyed, I think this can be repaired by a consumer who will give the lwm and will not change it while you are working with it.



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/PageMemoryIndexes.java:
##########
@@ -124,6 +137,27 @@ void performRecovery(
         }
     }
 
+    private CompletableFuture<Void> destroyIndexOnRecovery(
+            IndexMeta indexMeta,
+            IndexStorageFactory indexStorageFactory,
+            IndexMetaTree indexMetaTree
+    ) {
+        switch (indexMeta.indexType()) {
+            case HASH:
+                PageMemoryHashIndexStorage hashIndexStorage = indexStorageFactory.restoreHashIndexStorageForDestroy(indexMeta);
+
+                return destroyStorage(indexMeta.indexId(), hashIndexStorage, indexMetaTree);
+
+            case SORTED:
+                PageMemorySortedIndexStorage sortedIndexStorage = indexStorageFactory.restoreSortedIndexStorageForDestroy(indexMeta);
+
+                return destroyStorage(indexMeta.indexId(), sortedIndexStorage, indexMetaTree);
+
+            default:
+                throw new AssertionError("Unexpected index type: " + indexMeta.indexType());

Review Comment:
   Let's indicate which index.



##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##########
@@ -760,6 +801,41 @@ void testNextRowIdToBuiltAfterRestart() throws Exception {
         }
     }
 
+    @Test
+    public void testIndexDestructionOnRecovery() throws Exception {
+        Assumptions.assumeFalse(tableStorage.isVolatile(), "Volatile storages do not support index recovery");

Review Comment:
   Maybe static import?



##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##########
@@ -113,7 +114,40 @@ public abstract class AbstractMvTableStorageTest extends BaseMvStoragesTest {
 
     protected StorageHashIndexDescriptor hashIdx;
 
-    protected final CatalogService catalogService = mock(CatalogService.class);
+    private final CatalogService catalogService = mock(CatalogService.class);
+
+    protected final StorageIndexDescriptorSupplier indexDescriptorSupplier = new StorageIndexDescriptorSupplier() {
+        @Override
+        public @Nullable StorageIndexDescriptor get(int indexId) {
+            int catalogVersion = catalogService.latestCatalogVersion();
+
+            CatalogIndexDescriptor indexDescriptor = catalogService.index(indexId, catalogVersion);
+
+            if (indexDescriptor == null) {
+                return null;
+            }
+
+            CatalogTableDescriptor tableDescriptor = catalogService.table(indexDescriptor.tableId(), catalogVersion);
+
+            assertThat(tableDescriptor, is(notNullValue()));
+
+            return StorageIndexDescriptor.create(tableDescriptor, indexDescriptor);
+        }
+    };
+
+    private class TestRow {

Review Comment:
   Meow



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1524289412


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/CatalogStorageIndexDescriptorSupplier.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.table.distributed;
+
+import org.apache.ignite.internal.catalog.CatalogService;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexDescriptor;
+import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor;
+import org.apache.ignite.internal.hlc.HybridTimestamp;
+import org.apache.ignite.internal.storage.index.StorageIndexDescriptor;
+import org.apache.ignite.internal.storage.index.StorageIndexDescriptorSupplier;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Index descriptor supplier from catalog.
+ */
+class CatalogStorageIndexDescriptorSupplier implements StorageIndexDescriptorSupplier {
+    private final CatalogService catalogService;
+
+    private final LowWatermark lowWatermark;
+
+    CatalogStorageIndexDescriptorSupplier(CatalogService catalogService, LowWatermark lowWatermark) {
+        this.catalogService = catalogService;
+        this.lowWatermark = lowWatermark;
+    }
+
+    @Override
+    public @Nullable StorageIndexDescriptor get(int indexId) {
+        // Search for the index in the catalog history, which versions correspond to (lowWatermark, now] timestamp range.
+        int latestCatalogVersion = catalogService.latestCatalogVersion();
+
+        HybridTimestamp lowWatermarkTimestamp = lowWatermark.getLowWatermark();

Review Comment:
   Okay, let's leave a comment then.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1524352528


##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##########
@@ -760,6 +801,41 @@ void testNextRowIdToBuiltAfterRestart() throws Exception {
         }
     }
 
+    @Test
+    public void testIndexDestructionOnRecovery() throws Exception {
+        Assumptions.assumeFalse(tableStorage.isVolatile(), "Volatile storages do not support index recovery");

Review Comment:
   Fixed



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/PageMemoryIndexes.java:
##########
@@ -105,8 +109,17 @@ void performRecovery(
                 StorageIndexDescriptor indexDescriptor = indexDescriptorSupplier.get(indexId);
 
                 if (indexDescriptor == null) {
-                    // TODO: IGNITE-21671 destroy the index if it can't be found in the Catalog.
-                    continue;
+                    // Index has not been found in the Catalog, we can treat it as destroyed and remove the storage.
+                    runConsistently.accept(locker -> {
+                        destroyIndexOnRecovery(indexMeta, indexStorageFactory, indexMetaTree)
+                                .whenComplete((v, e) -> {
+                                    if (e != null) {
+                                        LOG.error("Unable to destroy existing index that has been removed from the Catalog", e);

Review Comment:
   Fixed



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21671 Remove destroyed PageMemory indexes on recovery [ignite-3]

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #3399:
URL: https://github.com/apache/ignite-3/pull/3399#discussion_r1524352758


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/PageMemoryIndexes.java:
##########
@@ -124,6 +137,27 @@ void performRecovery(
         }
     }
 
+    private CompletableFuture<Void> destroyIndexOnRecovery(
+            IndexMeta indexMeta,
+            IndexStorageFactory indexStorageFactory,
+            IndexMetaTree indexMetaTree
+    ) {
+        switch (indexMeta.indexType()) {
+            case HASH:
+                PageMemoryHashIndexStorage hashIndexStorage = indexStorageFactory.restoreHashIndexStorageForDestroy(indexMeta);
+
+                return destroyStorage(indexMeta.indexId(), hashIndexStorage, indexMetaTree);
+
+            case SORTED:
+                PageMemorySortedIndexStorage sortedIndexStorage = indexStorageFactory.restoreSortedIndexStorageForDestroy(indexMeta);
+
+                return destroyStorage(indexMeta.indexId(), sortedIndexStorage, indexMetaTree);
+
+            default:
+                throw new AssertionError("Unexpected index type: " + indexMeta.indexType());

Review Comment:
   Fixed



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org