This is an automated email from the ASF dual-hosted git repository. tkalkirill pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push: new 2b5b6720cd8 IGNITE-26255 Testing checkpoint after partition destruction in PersistentPageMemory (#6460) 2b5b6720cd8 is described below commit 2b5b6720cd83e15a83a0316b6cd88e10fdde20fd Author: Kirill Tkalenko <tkalkir...@yandex.ru> AuthorDate: Thu Aug 21 12:58:56 2025 +0300 IGNITE-26255 Testing checkpoint after partition destruction in PersistentPageMemory (#6460) --- .../PersistentPageMemoryMvTableStorageTest.java | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryMvTableStorageTest.java b/modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryMvTableStorageTest.java index 66b6c9b371a..2eab623fa0f 100644 --- a/modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryMvTableStorageTest.java +++ b/modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryMvTableStorageTest.java @@ -23,6 +23,7 @@ import static org.apache.ignite.internal.pagememory.persistence.checkpoint.Check import static org.apache.ignite.internal.storage.pagememory.PersistentPageMemoryStorageEngine.ENGINE_NAME; import static org.apache.ignite.internal.testframework.IgniteTestUtils.runRace; import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully; +import static org.apache.ignite.internal.util.ArrayUtils.BYTE_EMPTY_ARRAY; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.equalTo; @@ -33,6 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.mock; import java.nio.file.Path; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import org.apache.ignite.internal.components.LogSyncer; import org.apache.ignite.internal.configuration.testframework.InjectConfiguration; @@ -49,6 +51,7 @@ import org.apache.ignite.internal.storage.MvPartitionStorage; import org.apache.ignite.internal.storage.RowId; import org.apache.ignite.internal.storage.configurations.StorageConfiguration; import org.apache.ignite.internal.storage.configurations.StorageProfileConfiguration; +import org.apache.ignite.internal.storage.engine.MvPartitionMeta; import org.apache.ignite.internal.storage.engine.MvTableStorage; import org.apache.ignite.internal.storage.engine.StorageTableDescriptor; import org.apache.ignite.internal.storage.pagememory.configuration.schema.PersistentPageMemoryProfileConfiguration; @@ -61,6 +64,7 @@ import org.apache.ignite.internal.util.Constants; import org.apache.ignite.internal.util.IgniteUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; @@ -268,4 +272,96 @@ public class PersistentPageMemoryMvTableStorageTest extends AbstractMvTableStora return null; }); } + + @Disabled("https://issues.apache.org/jira/browse/IGNITE-26233") + @Test + void createMvPartitionStorageAndDoCheckpointInParallel() { + for (int i = 0; i < 10; i++) { + runRace( + () -> getOrCreateMvPartition(PARTITION_ID), + () -> assertThat(forceCheckpointAsync(), willCompleteSuccessfully()) + ); + + assertThat(tableStorage.destroyPartition(PARTITION_ID), willCompleteSuccessfully()); + } + } + + @Disabled("https://issues.apache.org/jira/browse/IGNITE-26233") + @Test + void clearMvPartitionStorageAndDoCheckpointInParallel() { + for (int i = 0; i < 10; i++) { + getOrCreateMvPartition(PARTITION_ID); + + runRace( + () -> assertThat(tableStorage.clearPartition(PARTITION_ID), willCompleteSuccessfully()), + () -> assertThat(forceCheckpointAsync(), willCompleteSuccessfully()) + ); + + assertThat(tableStorage.destroyPartition(PARTITION_ID), willCompleteSuccessfully()); + } + } + + @Disabled("https://issues.apache.org/jira/browse/IGNITE-26233") + @Test + void destroyMvPartitionStorageAndDoCheckpointInParallel() { + for (int i = 0; i < 10; i++) { + getOrCreateMvPartition(PARTITION_ID); + + runRace( + () -> assertThat(tableStorage.destroyPartition(PARTITION_ID), willCompleteSuccessfully()), + () -> assertThat(forceCheckpointAsync(), willCompleteSuccessfully()) + ); + } + } + + @Disabled("https://issues.apache.org/jira/browse/IGNITE-26233") + @Test + void startRebalancePartitionAndDoCheckpointInParallel() { + getOrCreateMvPartition(PARTITION_ID); + + for (int i = 0; i < 10; i++) { + runRace( + () -> assertThat(tableStorage.startRebalancePartition(PARTITION_ID), willCompleteSuccessfully()), + () -> assertThat(forceCheckpointAsync(), willCompleteSuccessfully()) + ); + + assertThat(tableStorage.abortRebalancePartition(PARTITION_ID), willCompleteSuccessfully()); + } + } + + @Disabled("https://issues.apache.org/jira/browse/IGNITE-26233") + @Test + void abortRebalancePartitionAndDoCheckpointInParallel() { + getOrCreateMvPartition(PARTITION_ID); + + for (int i = 0; i < 10; i++) { + assertThat(tableStorage.startRebalancePartition(PARTITION_ID), willCompleteSuccessfully()); + + runRace( + () -> assertThat(tableStorage.abortRebalancePartition(PARTITION_ID), willCompleteSuccessfully()), + () -> assertThat(forceCheckpointAsync(), willCompleteSuccessfully()) + ); + } + } + + @Disabled("https://issues.apache.org/jira/browse/IGNITE-26233") + @Test + void finishRebalancePartitionAndDoCheckpointInParallel() { + getOrCreateMvPartition(PARTITION_ID); + + for (int i = 0; i < 10; i++) { + assertThat(tableStorage.startRebalancePartition(PARTITION_ID), willCompleteSuccessfully()); + + var meta = new MvPartitionMeta(1, 1, BYTE_EMPTY_ARRAY, null, BYTE_EMPTY_ARRAY); + + runRace( + () -> assertThat(tableStorage.finishRebalancePartition(PARTITION_ID, meta), willCompleteSuccessfully()), + () -> assertThat(forceCheckpointAsync(), willCompleteSuccessfully()) + ); + } + } + + private CompletableFuture<Void> forceCheckpointAsync() { + return engine.checkpointManager().forceCheckpoint("test").futureFor(FINISHED); + } }