alievmirza commented on code in PR #4905: URL: https://github.com/apache/ignite-3/pull/4905#discussion_r1896725024
########## modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/ZoneRebalanceUtil.java: ########## @@ -155,7 +158,33 @@ public static CompletableFuture<Void> updatePendingAssignmentsKeys( ByteArray partAssignmentsStableKey = stablePartAssignmentsKey(zonePartitionId); - Set<Assignment> partAssignments = calculateAssignmentForPartition(dataNodes, partNum, replicas); + Set<Assignment> calculatedAssignments = calculateAssignmentForPartition(dataNodes, partNum, replicas); + + Set<Assignment> partAssignments; + + if (consistencyMode == ConsistencyMode.HIGH_AVAILABILITY) { Review Comment: improved javadocs ########## modules/table/src/integrationTest/java/org/apache/ignite/internal/table/distributed/disaster/ItHighAvailablePartitionsRecoveryTest.java: ########## @@ -230,4 +230,64 @@ void testNoHaRecoveryForScZone() throws InterruptedException { assertRecoveryKeyIsEmpty(node); } + + @Test + void testScaleUpAfterHaRecoveryWhenMajorityLoss() throws Exception { + startNode(3); + + startNode(4); + + createHaZoneWithTable(); + + IgniteImpl node = igniteImpl(0); + + assertRecoveryKeyIsEmpty(node); + + stopNodes(1, 2, 3, 4); + + waitAndAssertRecoveryKeyIsNotEmpty(node); + + assertRecoveryRequestForHaZoneTable(node); + + waitAndAssertStableAssignmentsOfPartitionEqualTo(node, HA_TABLE_NAME, Set.of(0, 1), Set.of(node.name())); Review Comment: done ########## modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GroupUpdateRequest.java: ########## @@ -337,7 +336,43 @@ private static CompletableFuture<Integer> partitionUpdate( : Assignments.toBytes(partAssignments, assignmentsTimestamp) ); - return metaStorageMgr.invoke(invokeClosure).thenApply(StatementResult::getAsInt); + return metaStorageMgr.invoke(invokeClosure).thenApply(sr -> { + switch (UpdateStatus.valueOf(sr.getAsInt())) { + case PENDING_KEY_UPDATED: + LOG.info( + "Force update metastore pending partitions key [key={}, partition={}, table={}, newVal={}]", + pendingChangeTriggerKey(partId).toString(), + partId.partitionId(), + partId.tableId(), + nextAssignment + ); + + break; + case ASSIGNMENT_NOT_UPDATED: Review Comment: removede -- 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-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org