You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by il...@apache.org on 2020/05/29 09:40:35 UTC

[ignite] branch master updated: IGNITE-13048 Fix of WAL segments validation if archiver is not enabled. - Fixes #7829.

This is an automated email from the ASF dual-hosted git repository.

ilyak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 09a50e0  IGNITE-13048 Fix of WAL segments validation if archiver is not enabled. - Fixes #7829.
09a50e0 is described below

commit 09a50e0ef3a0ef03ab5f87b5b65e26d7c07c60cf
Author: ibessonov <be...@gmail.com>
AuthorDate: Fri May 29 12:25:24 2020 +0300

    IGNITE-13048 Fix of WAL segments validation if archiver is not enabled. - Fixes #7829.
    
    Signed-off-by: Ilya Kasnacheev <il...@gmail.com>
---
 .../persistence/wal/FileWriteAheadLogManager.java  |  4 ++--
 .../db/wal/IgniteWalReplayingAfterRestartTest.java | 26 +++++++++++++++++++++-
 2 files changed, 27 insertions(+), 3 deletions(-)

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 cfdb30c..81787fb 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
@@ -1478,7 +1478,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
 
             createFile(first);
         }
-        else
+        else if (isArchiverEnabled())
             checkFiles(0, false, null, null);
     }
 
@@ -2515,7 +2515,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
                         "(WAL segment size change is not supported in 'DEFAULT' WAL mode) " +
                         "[filePath=" + checkFile.getAbsolutePath() +
                         ", fileSize=" + checkFile.length() +
-                        ", configSize=" + dsCfg.getWalSegments() + ']');
+                        ", configSize=" + dsCfg.getWalSegmentSize() + ']');
             }
             else if (create)
                 createFile(checkFile);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalReplayingAfterRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalReplayingAfterRestartTest.java
index db7263f..30db98a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalReplayingAfterRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalReplayingAfterRestartTest.java
@@ -66,6 +66,9 @@ public class IgniteWalReplayingAfterRestartTest extends GridCommonAbstractTest {
     public static final int PART_NUM = 32;
 
     /** */
+    private WALMode logMode = WALMode.LOG_ONLY;
+
+    /** */
     @Before
     public void beforeIgniteWalReplayingAfterRestartTest() throws Exception {
         U.delete(Paths.get(U.defaultWorkDirectory()));
@@ -92,7 +95,7 @@ public class IgniteWalReplayingAfterRestartTest extends GridCommonAbstractTest {
         cfg.setCacheConfiguration(ccfg);
 
         DataStorageConfiguration dbCfg = new DataStorageConfiguration()
-            .setWalMode(WALMode.LOG_ONLY)
+            .setWalMode(logMode)
             .setWalSegments(SEGMENTS_CNT)
             .setWalSegmentSize(512 * 1024)
             .setWalHistorySize(100)
@@ -175,4 +178,25 @@ public class IgniteWalReplayingAfterRestartTest extends GridCommonAbstractTest {
             }
         }
     }
+
+    /**
+     * Verifies that validation of WAL segment sizes isn't triggered when WAL archive is disabled.
+     */
+    @Test
+    public void testFsyncWalValidationAfterRestart() throws Exception {
+        logMode = WALMode.FSYNC;
+
+        IgniteEx ignite = startGrid(0);
+
+        ignite.cluster().active(true);
+
+        IgniteCache<Object, Object> cache = ignite.getOrCreateCache(DEFAULT_CACHE_NAME);
+
+        for (int i = 0; i < 128; i++)
+            cache.put("key" + i, new byte[1024]);
+
+        stopGrid(0);
+
+        startGrid(0);
+    }
 }