This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 17d53e99cf IGNITE-19707 Fix AssertionError in
DistributionZoneManagerScaleUpTest (#2180)
17d53e99cf is described below
commit 17d53e99cfe708375c8f2fcfb164a928a895a619
Author: Mirza Aliev <[email protected]>
AuthorDate: Tue Jun 13 10:18:35 2023 +0400
IGNITE-19707 Fix AssertionError in DistributionZoneManagerScaleUpTest
(#2180)
---
.../DistributionZoneManagerScaleUpTest.java | 27 +++++++++++++++-------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git
a/modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/DistributionZoneManagerScaleUpTest.java
b/modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/DistributionZoneManagerScaleUpTest.java
index 18eabf32b4..753358bccd 100644
---
a/modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/DistributionZoneManagerScaleUpTest.java
+++
b/modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/DistributionZoneManagerScaleUpTest.java
@@ -26,6 +26,7 @@ import static
org.apache.ignite.internal.distributionzones.DistributionZonesTest
import static
org.apache.ignite.internal.distributionzones.DistributionZonesTestUtil.assertLogicalTopology;
import static
org.apache.ignite.internal.distributionzones.DistributionZonesTestUtil.assertZoneScaleDownChangeTriggerKey;
import static
org.apache.ignite.internal.distributionzones.DistributionZonesTestUtil.assertZoneScaleUpChangeTriggerKey;
+import static
org.apache.ignite.internal.distributionzones.DistributionZonesUtil.zoneDataNodesKey;
import static
org.apache.ignite.internal.distributionzones.DistributionZonesUtil.zoneScaleDownChangeTriggerKey;
import static
org.apache.ignite.internal.distributionzones.DistributionZonesUtil.zoneScaleUpChangeTriggerKey;
import static
org.apache.ignite.internal.testframework.IgniteTestUtils.waitForCondition;
@@ -796,10 +797,15 @@ public class DistributionZoneManagerScaleUpTest extends
BaseDistributionZoneMana
// Emulate a situation when one of the scale up keys gets
concurrently updated during a Meta Storage invoke. We then expect
// that the invoke call will be retried.
- byte[] key = zoneScaleUpChangeTriggerKey(ZONE_1_ID).bytes();
-
- if (Arrays.stream(iif.cond().keys()).anyMatch(k ->
Arrays.equals(key, k))) {
- keyValueStorage.put(key, longToBytes(100),
HybridTimestamp.MIN_VALUE);
+ byte[] keyScaleUp = zoneScaleUpChangeTriggerKey(ZONE_1_ID).bytes();
+ byte[] keyDataNodes = zoneDataNodesKey(ZONE_1_ID).bytes();
+
+ if (Arrays.stream(iif.cond().keys()).anyMatch(k ->
Arrays.equals(keyScaleUp, k))) {
+ keyValueStorage.putAll(
+ List.of(keyScaleUp, keyDataNodes),
+ List.of(longToBytes(100),
keyValueStorage.get(zoneDataNodesKey(ZONE_1_ID).bytes()).value()),
+ HybridTimestamp.MIN_VALUE
+ );
}
return invocation.callRealMethod();
@@ -837,10 +843,15 @@ public class DistributionZoneManagerScaleUpTest extends
BaseDistributionZoneMana
// Emulate a situation when one of the scale down keys gets
concurrently updated during a Meta Storage invoke. We then expect
// that the invoke call will be retried.
- byte[] key = zoneScaleDownChangeTriggerKey(ZONE_1_ID).bytes();
-
- if (Arrays.stream(iif.cond().keys()).anyMatch(k ->
Arrays.equals(key, k))) {
- keyValueStorage.put(key, longToBytes(100),
HybridTimestamp.MIN_VALUE);
+ byte[] keyScaleDown =
zoneScaleDownChangeTriggerKey(ZONE_1_ID).bytes();
+ byte[] keyDataNodes = zoneDataNodesKey(ZONE_1_ID).bytes();
+
+ if (Arrays.stream(iif.cond().keys()).anyMatch(k ->
Arrays.equals(keyScaleDown, k))) {
+ keyValueStorage.putAll(
+ List.of(keyScaleDown, keyDataNodes),
+ List.of(longToBytes(100),
keyValueStorage.get(zoneDataNodesKey(ZONE_1_ID).bytes()).value()),
+ HybridTimestamp.MIN_VALUE
+ );
}
return invocation.callRealMethod();