You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "sergeyuttsel (via GitHub)" <gi...@apache.org> on 2023/12/14 14:41:09 UTC
[PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
sergeyuttsel opened a new pull request, #2957:
URL: https://github.com/apache/ignite-3/pull/2957
https://issues.apache.org/jira/browse/IGNITE-20412
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "sergeyuttsel (via GitHub)" <gi...@apache.org>.
sergeyuttsel commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1433007247
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,62 +996,128 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
+
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+
+ AtomicLong topologyUpdateRevision = new AtomicLong();
+
+ WatchListener testListener = createLogicalTopologyWatchListenerToCheckDataNodes(
+ topologyUpdateRevision,
+ latch,
+ reached,
+ expectedDefaultZoneDataNodes,
+ expectedZone1DataNodes,
+ expectedZone2DataNodes,
+ expectedZone3DataNodes
+ );
+
+ metaStorageManager.registerPrefixWatch(zonesLogicalTopologyPrefix(), testListener);
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ blockDataNodesUpdatesInMetaStorage(latch);
Set<LogicalNode> topology1 = Set.of(NODE_0, NODE_1, NODE_2);
- Set<LogicalNode> topology2 = Set.of(NODE_0, NODE_2);
// Change logical topology. NODE_2 is added.
- long topologyRevision1 = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision1, TIMEOUT);
+ long topologyRevision = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
+ waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision, TIMEOUT);
- // Change logical topology. NODE_1 is removed.
- long topologyRevision2 = removeNodeInLogicalTopologyAndGetRevision(Set.of(NODE_1), topology2);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision2, TIMEOUT);
+ assertEquals(topologyRevision, topologyUpdateRevision.get());
- Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_2.name());
- Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
- Set<String> expectedZone2DataNodes = Set.of(NODE_0.name());
- Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ latch.await();
+
+ // Check that data nodes values are idempotented.
+ // Data nodes from the meta storage manager only used to calculate current data nodes because the meta storage are updated and
+ // topology augmentation maps were cleared.
+ checkDataNodes(
+ topologyUpdateRevision.get(),
+ expectedDefaultZoneDataNodes,
+ expectedZone1DataNodes,
+ expectedZone2DataNodes,
+ expectedZone3DataNodes
+ );
- // Check that data nodes values are changed according to scale up and down timers.
- // Data nodes from the meta storage manager and topology augmentation maps are used to calculate current data nodes.
checkDataNodes(
- topologyRevision2,
+ metaStorageManager.appliedRevision(),
expectedDefaultZoneDataNodes,
expectedZone1DataNodes,
expectedZone2DataNodes,
expectedZone3DataNodes
);
+ }
+
+ /**
+ * Check that data nodes calculation is idempotented.
+ * The current data nodes value which was calculated by data nodes from the meta storage manager and topology augmentation maps equals
+ * to the data nodes value which were calculated by data nodes from the meta storage manager after topology augmentation maps
+ * were cleared.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ void checkDataNodesRepeatedOnNodeRemoved() throws Exception {
+ prepareZonesWithTwoDataNodes();
+
+ prepareZonesTimerValuesToTest();
Review Comment:
Fixed. Added this zone.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "sergeyuttsel (via GitHub)" <gi...@apache.org>.
sergeyuttsel commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1433007849
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,62 +996,128 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
Review Comment:
Fixed
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "alievmirza (via GitHub)" <gi...@apache.org>.
alievmirza commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1432757088
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,62 +996,128 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
Review Comment:
This flag is not asserted
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,62 +996,128 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
+
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+
+ AtomicLong topologyUpdateRevision = new AtomicLong();
+
+ WatchListener testListener = createLogicalTopologyWatchListenerToCheckDataNodes(
+ topologyUpdateRevision,
+ latch,
+ reached,
+ expectedDefaultZoneDataNodes,
+ expectedZone1DataNodes,
+ expectedZone2DataNodes,
+ expectedZone3DataNodes
+ );
+
+ metaStorageManager.registerPrefixWatch(zonesLogicalTopologyPrefix(), testListener);
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ blockDataNodesUpdatesInMetaStorage(latch);
Set<LogicalNode> topology1 = Set.of(NODE_0, NODE_1, NODE_2);
- Set<LogicalNode> topology2 = Set.of(NODE_0, NODE_2);
// Change logical topology. NODE_2 is added.
- long topologyRevision1 = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision1, TIMEOUT);
+ long topologyRevision = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
+ waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision, TIMEOUT);
- // Change logical topology. NODE_1 is removed.
- long topologyRevision2 = removeNodeInLogicalTopologyAndGetRevision(Set.of(NODE_1), topology2);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision2, TIMEOUT);
+ assertEquals(topologyRevision, topologyUpdateRevision.get());
- Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_2.name());
- Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
- Set<String> expectedZone2DataNodes = Set.of(NODE_0.name());
- Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ latch.await();
+
+ // Check that data nodes values are idempotented.
+ // Data nodes from the meta storage manager only used to calculate current data nodes because the meta storage are updated and
+ // topology augmentation maps were cleared.
+ checkDataNodes(
+ topologyUpdateRevision.get(),
+ expectedDefaultZoneDataNodes,
+ expectedZone1DataNodes,
+ expectedZone2DataNodes,
+ expectedZone3DataNodes
+ );
- // Check that data nodes values are changed according to scale up and down timers.
- // Data nodes from the meta storage manager and topology augmentation maps are used to calculate current data nodes.
checkDataNodes(
- topologyRevision2,
+ metaStorageManager.appliedRevision(),
expectedDefaultZoneDataNodes,
expectedZone1DataNodes,
expectedZone2DataNodes,
expectedZone3DataNodes
);
+ }
+
+ /**
+ * Check that data nodes calculation is idempotented.
+ * The current data nodes value which was calculated by data nodes from the meta storage manager and topology augmentation maps equals
+ * to the data nodes value which were calculated by data nodes from the meta storage manager after topology augmentation maps
+ * were cleared.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ void checkDataNodesRepeatedOnNodeRemoved() throws Exception {
+ prepareZonesWithTwoDataNodes();
+
+ prepareZonesTimerValuesToTest();
Review Comment:
Lets add zone with non-immediate timers, but not infinite (1 second)
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,62 +996,128 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
+
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+
+ AtomicLong topologyUpdateRevision = new AtomicLong();
+
+ WatchListener testListener = createLogicalTopologyWatchListenerToCheckDataNodes(
+ topologyUpdateRevision,
+ latch,
+ reached,
+ expectedDefaultZoneDataNodes,
+ expectedZone1DataNodes,
+ expectedZone2DataNodes,
+ expectedZone3DataNodes
+ );
+
+ metaStorageManager.registerPrefixWatch(zonesLogicalTopologyPrefix(), testListener);
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ blockDataNodesUpdatesInMetaStorage(latch);
Set<LogicalNode> topology1 = Set.of(NODE_0, NODE_1, NODE_2);
- Set<LogicalNode> topology2 = Set.of(NODE_0, NODE_2);
// Change logical topology. NODE_2 is added.
- long topologyRevision1 = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision1, TIMEOUT);
+ long topologyRevision = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
+ waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision, TIMEOUT);
- // Change logical topology. NODE_1 is removed.
- long topologyRevision2 = removeNodeInLogicalTopologyAndGetRevision(Set.of(NODE_1), topology2);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision2, TIMEOUT);
+ assertEquals(topologyRevision, topologyUpdateRevision.get());
- Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_2.name());
- Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
- Set<String> expectedZone2DataNodes = Set.of(NODE_0.name());
- Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ latch.await();
+
+ // Check that data nodes values are idempotented.
+ // Data nodes from the meta storage manager only used to calculate current data nodes because the meta storage are updated and
+ // topology augmentation maps were cleared.
+ checkDataNodes(
+ topologyUpdateRevision.get(),
+ expectedDefaultZoneDataNodes,
+ expectedZone1DataNodes,
+ expectedZone2DataNodes,
+ expectedZone3DataNodes
+ );
- // Check that data nodes values are changed according to scale up and down timers.
- // Data nodes from the meta storage manager and topology augmentation maps are used to calculate current data nodes.
checkDataNodes(
- topologyRevision2,
+ metaStorageManager.appliedRevision(),
expectedDefaultZoneDataNodes,
expectedZone1DataNodes,
expectedZone2DataNodes,
expectedZone3DataNodes
);
+ }
+
+ /**
+ * Check that data nodes calculation is idempotented.
+ * The current data nodes value which was calculated by data nodes from the meta storage manager and topology augmentation maps equals
+ * to the data nodes value which were calculated by data nodes from the meta storage manager after topology augmentation maps
+ * were cleared.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ void checkDataNodesRepeatedOnNodeRemoved() throws Exception {
+ prepareZonesWithTwoDataNodes();
+
+ prepareZonesTimerValuesToTest();
+
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
- // Check that data nodes values are not changed in the meta storage.
- checkThatDataNodesIsNotChangedInMetastorage();
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
- // Unblock scale up and down tasks.
- scaleUpLatch.countDown();
- scaleDownLatch.countDown();
+ AtomicLong topologyUpdateRevision = new AtomicLong();
- // Check that data nodes values are changed in the meta storage after scale up and scale down tasks updated the meta storage.
- checkThatDataNodesIsChangedInMetastorage(
+ WatchListener testListener = createLogicalTopologyWatchListenerToCheckDataNodes(
Review Comment:
`checkThatDataNodesIsChangedInMetastorage` is not used anymore, looks strange
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "alievmirza (via GitHub)" <gi...@apache.org>.
alievmirza commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1434818742
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,73 +997,116 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
- prepareZonesTimerValuesToTest();
+ Map<Integer, Set<String>> expectedDataNodes = new HashMap<>();
+ expectedDataNodes.put(getZoneId(DEFAULT_ZONE_NAME), Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME), Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME_2), Set.of(NODE_0.name(), NODE_1.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME_3), Set.of(NODE_0.name(), NODE_1.name()));
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ Map<Integer, Set<String>> expectedDataNodes1 = new HashMap<>(expectedDataNodes);
+ expectedDataNodes1.put(getZoneId(ZONE_NAME_4), Set.of(NODE_0.name(), NODE_1.name()));
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ Map<Integer, Set<String>> expectedDataNodes2 = new HashMap<>(expectedDataNodes);
+ expectedDataNodes2.put(getZoneId(ZONE_NAME_4), Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name()));
- Set<LogicalNode> topology1 = Set.of(NODE_0, NODE_1, NODE_2);
- Set<LogicalNode> topology2 = Set.of(NODE_0, NODE_2);
+ checkDataNodesRepeated(expectedDataNodes1, expectedDataNodes2, true);
+ }
- // Change logical topology. NODE_2 is added.
- long topologyRevision1 = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision1, TIMEOUT);
+ /**
+ * Check that data nodes calculation is idempotented.
+ * The current data nodes value which was calculated by data nodes from the meta storage manager and topology augmentation maps equals
+ * to the data nodes value which were calculated by data nodes from the meta storage manager after topology augmentation maps
+ * were cleared.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ void checkDataNodesRepeatedOnNodeRemoved() throws Exception {
+ prepareZonesWithTwoDataNodes();
- // Change logical topology. NODE_1 is removed.
- long topologyRevision2 = removeNodeInLogicalTopologyAndGetRevision(Set.of(NODE_1), topology2);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision2, TIMEOUT);
-
- Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_2.name());
- Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
- Set<String> expectedZone2DataNodes = Set.of(NODE_0.name());
- Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
-
- // Check that data nodes values are changed according to scale up and down timers.
- // Data nodes from the meta storage manager and topology augmentation maps are used to calculate current data nodes.
- checkDataNodes(
- topologyRevision2,
- expectedDefaultZoneDataNodes,
- expectedZone1DataNodes,
- expectedZone2DataNodes,
- expectedZone3DataNodes
- );
+ Map<Integer, Set<String>> expectedDataNodes = new HashMap<>();
+ expectedDataNodes.put(getZoneId(DEFAULT_ZONE_NAME), Set.of(NODE_0.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME), Set.of(NODE_0.name(), NODE_1.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME_2), Set.of(NODE_0.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME_3), Set.of(NODE_0.name(), NODE_1.name()));
+
+ Map<Integer, Set<String>> expectedDataNodes1 = new HashMap<>(expectedDataNodes);
Review Comment:
Let's add meaningful names to these expected data nodes, as we did for `DistributionZoneCausalityDataNodesTest#checkDataNodesRepeated` method params
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "sergeyuttsel (via GitHub)" <gi...@apache.org>.
sergeyuttsel commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1433006534
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,62 +996,128 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
+
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+
+ AtomicLong topologyUpdateRevision = new AtomicLong();
+
+ WatchListener testListener = createLogicalTopologyWatchListenerToCheckDataNodes(
+ topologyUpdateRevision,
+ latch,
+ reached,
+ expectedDefaultZoneDataNodes,
+ expectedZone1DataNodes,
+ expectedZone2DataNodes,
+ expectedZone3DataNodes
+ );
+
+ metaStorageManager.registerPrefixWatch(zonesLogicalTopologyPrefix(), testListener);
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ blockDataNodesUpdatesInMetaStorage(latch);
Set<LogicalNode> topology1 = Set.of(NODE_0, NODE_1, NODE_2);
- Set<LogicalNode> topology2 = Set.of(NODE_0, NODE_2);
// Change logical topology. NODE_2 is added.
- long topologyRevision1 = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision1, TIMEOUT);
+ long topologyRevision = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
+ waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision, TIMEOUT);
- // Change logical topology. NODE_1 is removed.
- long topologyRevision2 = removeNodeInLogicalTopologyAndGetRevision(Set.of(NODE_1), topology2);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision2, TIMEOUT);
+ assertEquals(topologyRevision, topologyUpdateRevision.get());
- Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_2.name());
- Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
- Set<String> expectedZone2DataNodes = Set.of(NODE_0.name());
- Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ latch.await();
+
+ // Check that data nodes values are idempotented.
+ // Data nodes from the meta storage manager only used to calculate current data nodes because the meta storage are updated and
+ // topology augmentation maps were cleared.
+ checkDataNodes(
+ topologyUpdateRevision.get(),
+ expectedDefaultZoneDataNodes,
+ expectedZone1DataNodes,
+ expectedZone2DataNodes,
+ expectedZone3DataNodes
+ );
- // Check that data nodes values are changed according to scale up and down timers.
- // Data nodes from the meta storage manager and topology augmentation maps are used to calculate current data nodes.
checkDataNodes(
- topologyRevision2,
+ metaStorageManager.appliedRevision(),
expectedDefaultZoneDataNodes,
expectedZone1DataNodes,
expectedZone2DataNodes,
expectedZone3DataNodes
);
+ }
+
+ /**
+ * Check that data nodes calculation is idempotented.
+ * The current data nodes value which was calculated by data nodes from the meta storage manager and topology augmentation maps equals
+ * to the data nodes value which were calculated by data nodes from the meta storage manager after topology augmentation maps
+ * were cleared.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ void checkDataNodesRepeatedOnNodeRemoved() throws Exception {
+ prepareZonesWithTwoDataNodes();
+
+ prepareZonesTimerValuesToTest();
+
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
- // Check that data nodes values are not changed in the meta storage.
- checkThatDataNodesIsNotChangedInMetastorage();
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
- // Unblock scale up and down tasks.
- scaleUpLatch.countDown();
- scaleDownLatch.countDown();
+ AtomicLong topologyUpdateRevision = new AtomicLong();
- // Check that data nodes values are changed in the meta storage after scale up and scale down tasks updated the meta storage.
- checkThatDataNodesIsChangedInMetastorage(
+ WatchListener testListener = createLogicalTopologyWatchListenerToCheckDataNodes(
Review Comment:
Fixed. Now it is used.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "alievmirza (via GitHub)" <gi...@apache.org>.
alievmirza commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1433924773
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,73 +996,171 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone4DataNodes1 = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone4DataNodes2 = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
Review Comment:
instead of list you can pass even map (zoneId -> expectedValue)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "sergeyuttsel (via GitHub)" <gi...@apache.org>.
sergeyuttsel commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1434169624
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,73 +996,171 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone4DataNodes1 = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone4DataNodes2 = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
Review Comment:
Fixed
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "alievmirza (via GitHub)" <gi...@apache.org>.
alievmirza commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1433916923
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,73 +996,171 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone4DataNodes1 = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone4DataNodes2 = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
Review Comment:
let's add this expected nodes to list and pass this as a value to all related methods like `createLogicalTopologyWatchListenerToCheckDataNodes`, `checkThatDataNodesIsChangedInMetastorage` etc
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,73 +996,171 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
prepareZonesTimerValuesToTest();
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ CountDownLatch latch = new CountDownLatch(1);
+
+ AtomicBoolean reached = new AtomicBoolean();
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
+ Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone4DataNodes1 = Set.of(NODE_0.name(), NODE_1.name());
+ Set<String> expectedZone4DataNodes2 = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
Review Comment:
Please also refactor all `createLogicalTopologyWatchListenerToCheckDataNodes`, `checkThatDataNodesIsChangedInMetastorage`, `checkDataNodes` etc, so they just iterate through the list and check, but not copy-paste `assertValueInStorage` call
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "sergeyuttsel (via GitHub)" <gi...@apache.org>.
sergeyuttsel commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1434830313
##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,73 +997,116 @@ void simpleTopologyChanges() throws Exception {
* @throws Exception If failed.
*/
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412")
- void checkDataNodesRepeated() throws Exception {
- prepareZonesWithOneDataNodes();
+ void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+ prepareZonesWithTwoDataNodes();
- prepareZonesTimerValuesToTest();
+ Map<Integer, Set<String>> expectedDataNodes = new HashMap<>();
+ expectedDataNodes.put(getZoneId(DEFAULT_ZONE_NAME), Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME), Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME_2), Set.of(NODE_0.name(), NODE_1.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME_3), Set.of(NODE_0.name(), NODE_1.name()));
- CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+ Map<Integer, Set<String>> expectedDataNodes1 = new HashMap<>(expectedDataNodes);
+ expectedDataNodes1.put(getZoneId(ZONE_NAME_4), Set.of(NODE_0.name(), NODE_1.name()));
- CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+ Map<Integer, Set<String>> expectedDataNodes2 = new HashMap<>(expectedDataNodes);
+ expectedDataNodes2.put(getZoneId(ZONE_NAME_4), Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name()));
- Set<LogicalNode> topology1 = Set.of(NODE_0, NODE_1, NODE_2);
- Set<LogicalNode> topology2 = Set.of(NODE_0, NODE_2);
+ checkDataNodesRepeated(expectedDataNodes1, expectedDataNodes2, true);
+ }
- // Change logical topology. NODE_2 is added.
- long topologyRevision1 = putNodeInLogicalTopologyAndGetRevision(NODE_2, topology1);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision1, TIMEOUT);
+ /**
+ * Check that data nodes calculation is idempotented.
+ * The current data nodes value which was calculated by data nodes from the meta storage manager and topology augmentation maps equals
+ * to the data nodes value which were calculated by data nodes from the meta storage manager after topology augmentation maps
+ * were cleared.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ void checkDataNodesRepeatedOnNodeRemoved() throws Exception {
+ prepareZonesWithTwoDataNodes();
- // Change logical topology. NODE_1 is removed.
- long topologyRevision2 = removeNodeInLogicalTopologyAndGetRevision(Set.of(NODE_1), topology2);
- waitForCondition(() -> metaStorageManager.appliedRevision() >= topologyRevision2, TIMEOUT);
-
- Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), NODE_2.name());
- Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), NODE_1.name(), NODE_2.name());
- Set<String> expectedZone2DataNodes = Set.of(NODE_0.name());
- Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), NODE_1.name());
-
- // Check that data nodes values are changed according to scale up and down timers.
- // Data nodes from the meta storage manager and topology augmentation maps are used to calculate current data nodes.
- checkDataNodes(
- topologyRevision2,
- expectedDefaultZoneDataNodes,
- expectedZone1DataNodes,
- expectedZone2DataNodes,
- expectedZone3DataNodes
- );
+ Map<Integer, Set<String>> expectedDataNodes = new HashMap<>();
+ expectedDataNodes.put(getZoneId(DEFAULT_ZONE_NAME), Set.of(NODE_0.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME), Set.of(NODE_0.name(), NODE_1.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME_2), Set.of(NODE_0.name()));
+ expectedDataNodes.put(getZoneId(ZONE_NAME_3), Set.of(NODE_0.name(), NODE_1.name()));
+
+ Map<Integer, Set<String>> expectedDataNodes1 = new HashMap<>(expectedDataNodes);
Review Comment:
Fixed
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20412 Unmute some tests for DistributionZoneManager. [ignite-3]
Posted by "vldpyatkov (via GitHub)" <gi...@apache.org>.
vldpyatkov merged PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org