ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpav...@apache.org
Subject [46/50] [abbrv] ignite git commit: IGNITE-7809 fixed stable failures of IgniteWalFlushDefaultSelfTest in Ignite PDS 2 & PDS 2 Direct IO, new tests were added. - Fixes #3569.
Date Thu, 24 May 2018 12:52:09 GMT
IGNITE-7809 fixed stable failures of IgniteWalFlushDefaultSelfTest in Ignite PDS 2 & PDS
2 Direct IO, new tests were added. - Fixes #3569.

Signed-off-by: dpavlov <dpavlov@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fed2c022
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fed2c022
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fed2c022

Branch: refs/heads/ignite-5789-1
Commit: fed2c0226a3031b2ad9ff0816a5933c2eb87ad0f
Parents: b582171
Author: Ilya Lantukh <ilantukh@gridgain.com>
Authored: Wed May 23 18:02:23 2018 +0300
Committer: dpavlov <dpavlov@apache.org>
Committed: Wed May 23 18:02:23 2018 +0300

----------------------------------------------------------------------
 .../wal/FileWriteAheadLogManager.java           |  6 ++-
 .../wal/FsyncModeFileWriteAheadLogManager.java  | 11 +++-
 ...alFlushBackgroundWithMmapBufferSelfTest.java | 28 ++++++++++
 .../db/wal/IgniteWalFlushDefaultSelfTest.java   | 35 ------------
 .../db/wal/IgniteWalFlushFsyncSelfTest.java     | 35 ++++++++++++
 ...alFlushFsyncWithDedicatedWorkerSelfTest.java | 39 ++++++++++++++
 ...niteWalFlushFsyncWithMmapBufferSelfTest.java | 28 ++++++++++
 ...teWalFlushLogOnlyWithMmapBufferSelfTest.java | 28 ++++++++++
 ...lFlushMultiNodeFailoverAbstractSelfTest.java | 56 +++++++++++++-------
 .../ignite/testsuites/IgnitePdsTestSuite2.java  | 16 +++++-
 10 files changed, 223 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
index e095f6a..ec9dae4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
@@ -360,7 +360,11 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter
impl
         evt = ctx.event();
     }
 
-    /** For test purposes only. */
+    /**
+     * For test purposes only.
+     *
+     * @param ioFactory IO factory.
+     */
     public void setFileIOFactory(FileIOFactory ioFactory) {
         this.ioFactory = ioFactory;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FsyncModeFileWriteAheadLogManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FsyncModeFileWriteAheadLogManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FsyncModeFileWriteAheadLogManager.java
index f582f19..3e906d5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FsyncModeFileWriteAheadLogManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FsyncModeFileWriteAheadLogManager.java
@@ -228,7 +228,7 @@ public class FsyncModeFileWriteAheadLogManager extends GridCacheSharedManagerAda
     private volatile long lastTruncatedArchiveIdx = -1L;
 
     /** Factory to provide I/O interfaces for read/write operations with files */
-    private final FileIOFactory ioFactory;
+    private FileIOFactory ioFactory;
 
     /** Updater for {@link #currentHnd}, used for verify there are no concurrent update for
current log segment handle */
     private static final AtomicReferenceFieldUpdater<FsyncModeFileWriteAheadLogManager,
FileWriteHandle> currentHndUpd =
@@ -318,6 +318,15 @@ public class FsyncModeFileWriteAheadLogManager extends GridCacheSharedManagerAda
         assert mode == WALMode.FSYNC : dsCfg;
     }
 
+    /**
+     * For test purposes only.
+     *
+     * @param ioFactory IO factory.
+     */
+    public void setFileIOFactory(FileIOFactory ioFactory) {
+        this.ioFactory = ioFactory;
+    }
+
     /** {@inheritDoc} */
     @Override public void start0() throws IgniteCheckedException {
         if (!cctx.kernalContext().clientNode()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushBackgroundWithMmapBufferSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushBackgroundWithMmapBufferSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushBackgroundWithMmapBufferSelfTest.java
new file mode 100644
index 0000000..4f021cb
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushBackgroundWithMmapBufferSelfTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.processors.cache.persistence.db.wal;
+
+/**
+ *
+ */
+public class IgniteWalFlushBackgroundWithMmapBufferSelfTest extends IgniteWalFlushBackgroundSelfTest
{
+    /** {@inheritDoc} */
+    @Override protected boolean mmap() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushDefaultSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushDefaultSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushDefaultSelfTest.java
deleted file mode 100644
index 94e7e25..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushDefaultSelfTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.processors.cache.persistence.db.wal;
-
-import org.apache.ignite.configuration.WALMode;
-
-/**
- *
- */
-public class IgniteWalFlushDefaultSelfTest extends IgniteWalFlushMultiNodeFailoverAbstractSelfTest
{
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected WALMode walMode() {
-        return WALMode.FSYNC;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncSelfTest.java
new file mode 100644
index 0000000..453064a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * 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.processors.cache.persistence.db.wal;
+
+import org.apache.ignite.configuration.WALMode;
+
+/**
+ *
+ */
+public class IgniteWalFlushFsyncSelfTest extends IgniteWalFlushMultiNodeFailoverAbstractSelfTest
{
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected WALMode walMode() {
+        return WALMode.FSYNC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncWithDedicatedWorkerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncWithDedicatedWorkerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncWithDedicatedWorkerSelfTest.java
new file mode 100644
index 0000000..4360fe5
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncWithDedicatedWorkerSelfTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.processors.cache.persistence.db.wal;
+
+import org.apache.ignite.IgniteSystemProperties;
+
+/**
+ *
+ */
+public class IgniteWalFlushFsyncWithDedicatedWorkerSelfTest extends IgniteWalFlushFsyncSelfTest
{
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        System.setProperty(IgniteSystemProperties.IGNITE_WAL_FSYNC_WITH_DEDICATED_WORKER,
"true");
+
+        super.beforeTest();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        System.clearProperty(IgniteSystemProperties.IGNITE_WAL_FSYNC_WITH_DEDICATED_WORKER);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncWithMmapBufferSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncWithMmapBufferSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncWithMmapBufferSelfTest.java
new file mode 100644
index 0000000..63872ba
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFsyncWithMmapBufferSelfTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.processors.cache.persistence.db.wal;
+
+/**
+ *
+ */
+public class IgniteWalFlushFsyncWithMmapBufferSelfTest extends IgniteWalFlushFsyncSelfTest
{
+    /** {@inheritDoc} */
+    @Override protected boolean mmap() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushLogOnlyWithMmapBufferSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushLogOnlyWithMmapBufferSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushLogOnlyWithMmapBufferSelfTest.java
new file mode 100644
index 0000000..d1f5075
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushLogOnlyWithMmapBufferSelfTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.processors.cache.persistence.db.wal;
+
+/**
+ *
+ */
+public class IgniteWalFlushLogOnlyWithMmapBufferSelfTest extends IgniteWalFlushLogOnlySelfTest
{
+    /** {@inheritDoc} */
+    @Override protected boolean mmap() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java
index cc0986a..c47b046 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java
@@ -24,20 +24,20 @@ import java.nio.ByteBuffer;
 import java.nio.MappedByteBuffer;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.cache.CacheAtomicityMode;
 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.configuration.WALMode;
-import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager;
 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.file.RandomAccessFileIOFactory;
 import org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager;
+import org.apache.ignite.internal.processors.cache.persistence.wal.FsyncModeFileWriteAheadLogManager;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
@@ -72,9 +72,13 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest extends
Gr
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
+        super.beforeTest();
+
         stopAllGrids();
 
         cleanPersistenceDir();
+
+        System.setProperty(IgniteSystemProperties.IGNITE_WAL_MMAP, Boolean.toString(mmap()));
     }
 
     /** {@inheritDoc} */
@@ -82,6 +86,10 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest extends
Gr
         stopAllGrids();
 
         cleanPersistenceDir();
+
+        System.clearProperty(IgniteSystemProperties.IGNITE_WAL_MMAP);
+
+        super.afterTest();
     }
 
     /** {@inheritDoc} */
@@ -89,9 +97,18 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest extends
Gr
         return 60_000;
     }
 
-    /** {@inheritDoc} */
+    /**
+     * @return WAL mode used in test.
+     */
     protected abstract WALMode walMode();
 
+    /**
+     * @return {@code True} if test should use MMAP buffer mode.
+     */
+    protected boolean mmap() {
+        return false;
+    }
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -138,14 +155,7 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest
extends Gr
     public void failWhilePut(boolean failWhileStart) throws Exception {
         final Ignite grid = startGridsMultiThreaded(gridCount());
 
-        IgniteWriteAheadLogManager wal = ((IgniteKernal)grid).context().cache().context().wal();
-
-        boolean mmap = GridTestUtils.getFieldValue(wal, "mmap");
-
-        if (mmap)
-            return;
-
-        grid.active(true);
+        grid.cluster().active(true);
 
         IgniteCache<Object, Object> cache = grid.cache(TEST_CACHE);
 
@@ -170,9 +180,7 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest
extends Gr
 
                     startGrid(gridCount());
 
-                    FileWriteAheadLogManager wal0 = (FileWriteAheadLogManager)grid(gridCount()).context().cache().context().wal();
-
-                    wal0.setFileIOFactory(new FailingFileIOFactory(canFail));
+                    setFileIOFactory(grid(gridCount()).context().cache().context().wal());
 
                     grid.cluster().setBaselineTopology(grid.cluster().topologyVersion());
 
@@ -186,7 +194,6 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest
extends Gr
                 canFail.set(true);
         }
 
-
         // We should await successful stop of node.
         GridTestUtils.waitForCondition(new GridAbsPredicate() {
             @Override public boolean apply() {
@@ -200,11 +207,9 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest
extends Gr
 
         Ignite grid0 = startGrids(gridCount() + 1);
 
-        FileWriteAheadLogManager wal0 = (FileWriteAheadLogManager)grid(gridCount()).context().cache().context().wal();
+        setFileIOFactory(grid(gridCount()).context().cache().context().wal());
 
-        wal0.setFileIOFactory(new FailingFileIOFactory(canFail));
-
-        grid0.active(true);
+        grid0.cluster().active(true);
 
         cache = grid0.cache(TEST_CACHE);
 
@@ -212,6 +217,16 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest
extends Gr
             assertEquals(cache.get(i), "testValue" + i);
     }
 
+    /** */
+    private void setFileIOFactory(IgniteWriteAheadLogManager wal) {
+        if (wal instanceof FileWriteAheadLogManager)
+            ((FileWriteAheadLogManager)wal).setFileIOFactory(new FailingFileIOFactory(canFail));
+        else if (wal instanceof FsyncModeFileWriteAheadLogManager)
+            ((FsyncModeFileWriteAheadLogManager)wal).setFileIOFactory(new FailingFileIOFactory(canFail));
+        else
+            fail(wal.getClass().toString());
+    }
+
     /**
      * Create File I/O which fails after second attempt to write to File
      */
@@ -220,7 +235,7 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest
extends Gr
         private static final long serialVersionUID = 0L;
 
         /** */
-        private AtomicBoolean fail;
+        private final AtomicBoolean fail;
 
         /** */
         private final FileIOFactory delegateFactory = new RandomAccessFileIOFactory();
@@ -242,6 +257,7 @@ public abstract class IgniteWalFlushMultiNodeFailoverAbstractSelfTest
extends Gr
             return new FileIODecorator(delegate) {
                 int writeAttempts = 2;
 
+                /** {@inheritDoc} */
                 @Override public int write(ByteBuffer srcBuf) throws IOException {
                     if (--writeAttempts <= 0 && fail != null && fail.get())
                         throw new IOException("No space left on device");

http://git-wip-us.apache.org/repos/asf/ignite/blob/fed2c022/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
index 5a2abe8..95a9529 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
@@ -41,9 +41,13 @@ import org.apache.ignite.internal.processors.cache.persistence.db.checkpoint.Ign
 import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsUnusedWalSegmentsTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.filename.IgniteUidAsConsistentIdMigrationTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushBackgroundSelfTest;
-import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushDefaultSelfTest;
+import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushBackgroundWithMmapBufferSelfTest;
+import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushFsyncSelfTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushFailoverTest;
+import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushFsyncWithDedicatedWorkerSelfTest;
+import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushFsyncWithMmapBufferSelfTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushLogOnlySelfTest;
+import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalFlushLogOnlyWithMmapBufferSelfTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalHistoryReservationsTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalSerializerVersionTest;
 import org.apache.ignite.internal.processors.cache.persistence.db.wal.WalCompactionTest;
@@ -125,12 +129,20 @@ public class IgnitePdsTestSuite2 extends TestSuite {
         // Failover test
         suite.addTestSuite(IgniteWalFlushFailoverTest.class);
 
-        suite.addTestSuite(IgniteWalFlushDefaultSelfTest.class);
+        suite.addTestSuite(IgniteWalFlushFsyncSelfTest.class);
+
+        suite.addTestSuite(IgniteWalFlushFsyncWithDedicatedWorkerSelfTest.class);
+
+        suite.addTestSuite(IgniteWalFlushFsyncWithMmapBufferSelfTest.class);
 
         suite.addTestSuite(IgniteWalFlushBackgroundSelfTest.class);
 
+        suite.addTestSuite(IgniteWalFlushBackgroundWithMmapBufferSelfTest.class);
+
         suite.addTestSuite(IgniteWalFlushLogOnlySelfTest.class);
 
+        suite.addTestSuite(IgniteWalFlushLogOnlyWithMmapBufferSelfTest.class);
+
         // Test suite uses Standalone WAL iterator to verify PDS content.
         suite.addTestSuite(IgniteWalReaderTest.class);
 


Mime
View raw message