xtern commented on a change in pull request #9833:
URL: https://github.com/apache/ignite/pull/9833#discussion_r815634967
##########
File path:
modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
##########
@@ -2989,6 +2994,47 @@ public void testMasterKeyChangeOnInactiveCluster()
throws Exception {
assertContains(log, testOut.toString(), "Master key change was
rejected. The cluster is inactive.");
}
+ /** @throws Exception If failed. */
+ @Test
+ @WithSystemProperty(key = SNAPSHOT_LIMITED_TRANSFER_BLOCK_SIZE, value =
"1")
+ public void testChangeSnapshotTransferRateInRuntime() throws Exception {
+ int keysCnt = 10_000;
+ String snpName = "snapshot_02052020";
+
+ StopNodeFailureHandler failHnd = new StopNodeFailureHandler();
+ failHnd.setIgnoredFailureTypes(Collections.emptySet());
+
+ IgniteConfiguration cfg =
optimize(getConfiguration(getTestIgniteInstanceName(0)))
+ .setFailureHandler(failHnd)
+ .setFailureDetectionTimeout(5_000);
+
+ IgniteEx ignite = startGrid(cfg);
+
+ ignite.cluster().state(ACTIVE);
+
+ createCacheAndPreload(ignite, keysCnt);
+
+ // Set transfer rate to 1 byte/sec.
+ assertEquals(EXIT_CODE_OK, execute("--property", "set", "--name",
SNAPSHOT_TRANSFER_RATE_DMS_KEY, "--val", "1"));
+
+ IgniteFuture<Void> snpFut = ignite.snapshot().createSnapshot(snpName);
+
+ // Make sure there are no blocks in critical sections.
+ U.sleep(cfg.getFailureDetectionTimeout());
+
+ assertFalse(snpFut.isDone());
+
+ // Set transfer rate to unlimited.
+ assertEquals(EXIT_CODE_OK, execute("--property", "set", "--name",
SNAPSHOT_TRANSFER_RATE_DMS_KEY, "--val", "0"));
+
+ long totalPartsSize =
((PageStoreCollection)ignite.context().cache().context().pageStore())
+
.getStores(CU.cacheId(DEFAULT_CACHE_NAME)).stream().mapToLong(PageStore::size).sum();
+
+ assertTrue(totalPartsSize >
TimeUnit.MILLISECONDS.toSeconds(getTestTimeout()));
Review comment:
Didn't quite get the idea.
This test checks that we can change the speed limit at runtime.
Specifically, this check is needed so that the test fails by timeout if the
speed is not changed (ie if the limit remains 1 byte per second).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]