sk0x50 commented on a change in pull request #5779: IGNITE-10508 Support the 
new checkpoint feature not wait for the previous operation to complete
URL: https://github.com/apache/ignite/pull/5779#discussion_r253447557
 
 

 ##########
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCheckpointCancelTest.java
 ##########
 @@ -0,0 +1,579 @@
+package org.apache.ignite.internal.processors.cache.persistence;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.file.OpenOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Function;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import 
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.CheckpointProgress;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.AsyncFileIOFactory;
+import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.FileIODecorator;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory;
+import 
org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+import static 
org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.PART_FILE_PREFIX;
+
+@RunWith(JUnit4.class)
+public class IgnitePdsCheckpointCancelTest extends GridCommonAbstractTest {
+    private static final String NODE_CONST_ID = "NODE";
+    private static final String REGION_NAME = "MY_REGION";
+
+    private static final int PAGE_SIZE = 4096;
+    private static final int REGION_SIZE = 400 * 1024 * 1024;
+    private static final int CP_BUFFER_SIZE = 400 * 1024 * 1024;
+
+    private static final int DIRTY_PAGES_BOUND = REGION_SIZE / 2;
+
+    private static final int MIDDLE_PAGE_COUNT = DIRTY_PAGES_BOUND / PAGE_SIZE 
/ 4;
+
+    private List<TestFileIO> partsFilesIO = new ArrayList<>();
+
+    private FileIOFactory ioFactory;
+
+    private boolean cancelCp = true;
+
+    private int partitions;
+
+    private final TimeTracker time = new TimeTracker();
+
+    @Override
+    protected IgniteConfiguration getConfiguration(String name) throws 
Exception {
+        assert partitions != 0;
+
+        IgniteConfiguration cfg = super.getConfiguration(name);
+
+        cfg.setConsistentId(NODE_CONST_ID);
+
+        cfg.setDataStorageConfiguration(
+            new DataStorageConfiguration()
+                .setFileIOFactory(ioFactory != null ? ioFactory : new 
AsyncFileIOFactory())
+                .setCheckpointFrequency(60 * 60 * 1000)
+                .setWalSegments(10)
+                .setWalSegmentSize(REGION_SIZE)
+                .setMaxWalArchiveSize(REGION_SIZE * 10L)
+                .setDefaultDataRegionConfiguration(
+                    new DataRegionConfiguration()
+                        .setName(REGION_NAME)
+                        .setMaxSize(REGION_SIZE)
+                        .setCheckpointPageBufferSize(CP_BUFFER_SIZE)
+                        .setMetricsEnabled(true)
+                        .setPersistenceEnabled(true)
+                )
+        );
+
+        cfg.setCacheConfiguration(
+            new CacheConfiguration(DEFAULT_CACHE_NAME)
+                .setDataRegionName(REGION_NAME)
+                .setAffinity(new RendezvousAffinityFunction(false, partitions))
+        );
+
+        return cfg;
+    }
+
+    @Before
+    public void before() throws Exception {
+        stopAllGrids();
+
+        cleanPersistenceDir();
+
+    }
+
+    @After
+    public void after() throws Exception {
+        stopAllGrids();
+
+        cleanPersistenceDir();
+    }
+
+    public void testCancelOnMarkCheckpointBegin() {
+        //TODO
 
 Review comment:
   Should we implement ` testCancelOnMarkCheckpointBegin` in this PR?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to