You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:00:27 UTC

[GitHub] [ignite] ibessonov commented on a change in pull request #9180: IGNITE-14923

ibessonov commented on a change in pull request #9180:
URL: https://github.com/apache/ignite/pull/9180#discussion_r654355562



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalArchiveSizeConfigurationTest.java
##########
@@ -103,6 +113,39 @@ public void testUnlimitedMaxArchiveSizeConfiguration() throws Exception {
         startGrid(0, (IgniteConfiguration cfg) -> cfg.setDataStorageConfiguration(dataStorageConfiguration));
     }
 
+    /**
+     * Checks that an exception is thrown if min WAL archive size is larger than max WAL archive size.
+     */
+    @Test
+    public void testIncorrectMinArchiveSizeConfiguration() {
+        DataStorageConfiguration dsCfg = new DataStorageConfiguration()
+            .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))
+            .setMinWalArchiveSize(Long.MAX_VALUE);
+
+        assertThrowsAnyCause(
+            log,
+            () -> startGrid(0, (IgniteConfiguration cfg) -> cfg.setDataStorageConfiguration(dsCfg)),
+            IgniteCheckedException.class,
+            "DataRegionConfiguration.minWalArchiveSize must be less than or equal to"

Review comment:
       what?

##########
File path: modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java
##########
@@ -188,6 +188,9 @@
     /** @see IgniteSystemProperties#IGNITE_USE_ASYNC_FILE_IO_FACTORY */
     public static final boolean DFLT_USE_ASYNC_FILE_IO_FACTORY = true;
 
+    /** Value used to indicate the use of half of the {@link #getMaxWalArchiveSize}. */
+    public static final long HALF_MAX_WAL_ARCHIVE_SIZE = -2;

Review comment:
       Please replace it with -1

##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalArchiveSizeConfigurationTest.java
##########
@@ -103,6 +113,39 @@ public void testUnlimitedMaxArchiveSizeConfiguration() throws Exception {
         startGrid(0, (IgniteConfiguration cfg) -> cfg.setDataStorageConfiguration(dataStorageConfiguration));
     }
 
+    /**
+     * Checks that an exception is thrown if min WAL archive size is larger than max WAL archive size.
+     */
+    @Test
+    public void testIncorrectMinArchiveSizeConfiguration() {
+        DataStorageConfiguration dsCfg = new DataStorageConfiguration()
+            .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))
+            .setMinWalArchiveSize(Long.MAX_VALUE);
+
+        assertThrowsAnyCause(
+            log,
+            () -> startGrid(0, (IgniteConfiguration cfg) -> cfg.setDataStorageConfiguration(dsCfg)),
+            IgniteCheckedException.class,
+            "DataRegionConfiguration.minWalArchiveSize must be less than or equal to"

Review comment:
       sorry, everything's fine here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org