Skip to content

Commit

Permalink
IGNITE-12154 Uprising time to await fail node - Fixes #6856.
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>
  • Loading branch information
akalash authored and agoncharuk committed Sep 13, 2019
1 parent c045138 commit ee995b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Expand Up @@ -38,6 +38,7 @@
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;

import static org.apache.ignite.IgniteSystemProperties.IGNITE_DEFAULT_DISK_PAGE_COMPRESSION;
import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;

/**
Expand Down Expand Up @@ -73,14 +74,17 @@ public class CheckpointFailBeforeWriteMarkTest extends GridCommonAbstractTest {

DataStorageConfiguration storageCfg = new DataStorageConfiguration();

//By some reasons in the compression case it is required more memory for reproducing.
boolean isCompression = System.getProperty(IGNITE_DEFAULT_DISK_PAGE_COMPRESSION) != null;

storageCfg.setCheckpointThreads(2)
.setFileIOFactory(interceptorIOFactory)
.setWalSegmentSize(5 * 1024 * 1024)
.setWalSegmentSize((isCompression ? 20 : 5) * 1024 * 1024)
.setWalSegments(3);

storageCfg.getDefaultDataRegionConfiguration()
.setPersistenceEnabled(true)
.setMaxSize(10L * 1024 * 1024);
.setMaxSize((isCompression ? 70 : 10) * 1024 * 1024);

cfg.setDataStorageConfiguration(storageCfg)
.setCacheConfiguration(new CacheConfiguration<>(DEFAULT_CACHE_NAME)
Expand All @@ -106,7 +110,7 @@ private static class InterceptorIOFactory extends AsyncFileIOFactory {

/** {@inheritDoc} */
@Override public FileIO create(File file, OpenOption... modes) throws IOException {
if(file.getName().contains("START.bin"))
if (file.getName().contains("START.bin"))
sleep();

if (failPredicate.test(file)) {
Expand Down Expand Up @@ -167,7 +171,7 @@ public void testCheckpointFailBeforeMarkEntityWrite() throws Exception {
}, 3, "LOAD-DATA");

//and: Page replacement was started.
assertTrue(waitForCondition(() -> U.field(pageMemory, "pageReplacementWarned"), 20_000));
assertTrue(waitForCondition(() -> U.field(pageMemory, "pageReplacementWarned"), 60_000));

//and: Node was failed during checkpoint after write lock was released and before checkpoint marker was stored to disk.
interceptorIOFactory.triggerIOException((file) -> file.getName().contains("START.bin"));
Expand All @@ -184,7 +188,7 @@ public void testCheckpointFailBeforeMarkEntityWrite() throws Exception {
IgniteCache<Integer, Object> cache = ignite(0).cache(DEFAULT_CACHE_NAME);

//WAL mode is 'default' so it is allowable to lost some last data(ex. last 100).
for(int i = 0; i < lastKey.get() - 100; i++)
for (int i = 0; i < lastKey.get() - 100; i++)
assertNotNull(cache.get(i));
}
}
Expand Up @@ -211,10 +211,10 @@ public static void addRealPageStoreTests(List<Class<?>> suite, Collection<Class>

GridTestUtils.addTestIfNeeded(suite, IgnitePdsCorruptedStoreTest.class, ignoredTests);

GridTestUtils.addTestIfNeeded(suite, CheckpointFreeListTest.class, ignoredTests);

GridTestUtils.addTestIfNeeded(suite, CheckpointFailBeforeWriteMarkTest.class, ignoredTests);

GridTestUtils.addTestIfNeeded(suite, CheckpointFreeListTest.class, ignoredTests);

GridTestUtils.addTestIfNeeded(suite, IgniteWalIteratorSwitchSegmentTest.class, ignoredTests);

GridTestUtils.addTestIfNeeded(suite, IgniteWalIteratorExceptionDuringReadTest.class, ignoredTests);
Expand Down

0 comments on commit ee995b4

Please sign in to comment.