sashapolo commented on code in PR #2698:
URL: https://github.com/apache/ignite-3/pull/2698#discussion_r1371813223


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceDistributedTest.java:
##########
@@ -587,6 +587,61 @@ void testRebalanceWithTheSameNodes() throws Exception {
         verifyThatRaftNodesAndReplicasWereStartedOnlyOnce();
     }
 
+    @Test
+    void testRaftClientsUpdatesAfterRebalance() throws Exception {
+        Node node = getNode(0);
+
+        createZone(node, ZONE_NAME, 1, 1);
+
+        createTable(node, ZONE_NAME, TABLE_NAME);
+
+        assertTrue(waitForCondition(() -> getPartitionClusterNodes(node, 
0).size() == 1, AWAIT_TIMEOUT_MILLIS));
+
+        Set<Assignment> assignmentsBeforeRebalance = 
getPartitionClusterNodes(node, 0);
+
+        String newNodeNameForAssignment = nodes.stream()
+                .map(n -> Assignment.forPeer(n.clusterService.nodeName()))
+                .filter(assignment -> 
!assignmentsBeforeRebalance.contains(assignment))
+                .findFirst()
+                .orElseThrow()
+                .consistentId();
+
+        Set<Assignment> newAssignment = 
Set.of(Assignment.forPeer(newNodeNameForAssignment));
+
+        // Write the new assignments to metastore as a pending assignments.
+        {
+            TablePartitionId partId = new TablePartitionId(getTableId(node, 
TABLE_NAME), 0);
+
+            ByteArray partAssignmentsPendingKey = 
pendingPartAssignmentsKey(partId);
+
+            byte[] bytesPendingAssignments = ByteUtils.toBytes(newAssignment);
+
+            node.metaStorageManager
+                    .putAll(Map.of(partAssignmentsPendingKey, 
bytesPendingAssignments))

Review Comment:
   actually, why are we using `putAll` to insert one key? Looks like a simple 
`put` is enough =)



-- 
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]

Reply via email to