alievmirza commented on code in PR #4138:
URL: https://github.com/apache/ignite-3/pull/4138#discussion_r1699121553


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceRaftGroupEventsListener.java:
##########
@@ -407,31 +310,22 @@ static void doStableKeySwitch(
                             pendingPartAssignmentsKey,
                             stablePartAssignmentsKey,
                             switchReduceKey,
-                            switchAppendKey,
-                            stableChangeTriggerKey
+                            switchAppendKey
                     )
             ).get();
 
-            // TODO: IGNITE-22661 Potentially unsafe to use the latest catalog 
version, as the tables might not already present
-            //  in the catalog. Better to take the version from Assignments.
-            int catalogVersion = catalogService.latestCatalogVersion();
-
-            Set<Assignment> calculatedAssignments =
-                    calculateAssignments(tablePartitionId, catalogService, 
distributionZoneManager, catalogVersion).get();
+            Set<Assignment> calculatedAssignments = 
calculateAssignmentsFn.apply(tablePartitionId).get();

Review Comment:
   fixed



##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceTest.java:
##########
@@ -158,98 +148,6 @@ void assignmentsChangingOnNodeLeaveNodeJoin() throws 
Exception {
         );
     }
 
-    /**
-     * Tests functionality of tables counters for partition rebalances per 
zone. Every partition from zone has tables counter when pending
-     * has changed, and we decrement it every time raft configuration for 
table's partition is rebalanced, and after this counter equals to
-     * zero rewrite stable.
-     *
-     * @throws Exception If failed
-     */
-    @Test
-    void testRebalanceTablesCounterForZone() throws Exception {
-        cluster.startAndInit(3);
-
-        String zoneName = "ZONE";
-
-        createZone(zoneName, 3, 3);
-
-        Set<Integer> tableIds = new HashSet<>();
-
-        tableIds.add(createTestTable("TEST1", zoneName));
-        tableIds.add(createTestTable("TEST2", zoneName));
-        tableIds.add(createTestTable("TEST3", zoneName));
-
-        Set<String> allNodes = 
cluster.runningNodes().map(IgniteImpl::name).collect(Collectors.toSet());
-
-        for (Integer tableId : tableIds) {
-            waitForStableAssignmentsInMetastore(allNodes, tableId);
-        }
-
-        AtomicBoolean dropMessages = new AtomicBoolean(true);
-
-        cluster.runningNodes().forEach(
-                n -> n.dropMessages((nodeName, msg) -> msg instanceof 
ChangePeersAsyncRequest && dropMessages.get())
-        );
-
-        alterZone(zoneName, 2);
-
-        CatalogManager catalogManager = cluster.aliveNode().catalogManager();
-
-        int zoneId = 
catalogManager.catalog(catalogManager.latestCatalogVersion()).zone(zoneName).id();
-
-        waitForTablesCounterInMetastore(3, zoneId, 0);
-        waitForTablesCounterInMetastore(3, zoneId, 1);
-        waitForTablesCounterInMetastore(3, zoneId, 2);
-
-        dropMessages.set(false);
-
-        for (Integer tableId : tableIds) {
-            waitForStableAssignmentsInMetastore(2, tableId);
-        }
-
-        waitForTablesCounterInMetastore(0, zoneId, 0);
-        waitForTablesCounterInMetastore(0, zoneId, 1);
-        waitForTablesCounterInMetastore(0, zoneId, 2);
-    }
-
-    @Test
-    void testRebalanceTablesCounterForZonePrevCatalogVersion() throws 
Exception {
-        cluster.startAndInit(3);
-
-        String zoneName = "ZONE";
-
-        createZone(zoneName, 3, 3);
-
-        Set<Integer> tableIds = new HashSet<>();
-
-        tableIds.add(createTestTable("TEST1", zoneName));
-
-        Set<String> allNodes = 
cluster.runningNodes().map(IgniteImpl::name).collect(Collectors.toSet());
-
-        for (Integer tableId : tableIds) {
-            waitForStableAssignmentsInMetastore(allNodes, tableId);
-        }
-
-        // Block low watermark change with an open ro tx.
-        cluster.aliveNode().transactions().begin(new 
TransactionOptions().readOnly(true));
-
-        alterZone(zoneName, 2);

Review Comment:
   removed



##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceTest.java:
##########
@@ -158,98 +148,6 @@ void assignmentsChangingOnNodeLeaveNodeJoin() throws 
Exception {
         );
     }
 
-    /**
-     * Tests functionality of tables counters for partition rebalances per 
zone. Every partition from zone has tables counter when pending
-     * has changed, and we decrement it every time raft configuration for 
table's partition is rebalanced, and after this counter equals to
-     * zero rewrite stable.
-     *
-     * @throws Exception If failed
-     */
-    @Test
-    void testRebalanceTablesCounterForZone() throws Exception {
-        cluster.startAndInit(3);
-
-        String zoneName = "ZONE";
-
-        createZone(zoneName, 3, 3);
-
-        Set<Integer> tableIds = new HashSet<>();
-
-        tableIds.add(createTestTable("TEST1", zoneName));
-        tableIds.add(createTestTable("TEST2", zoneName));
-        tableIds.add(createTestTable("TEST3", zoneName));
-
-        Set<String> allNodes = 
cluster.runningNodes().map(IgniteImpl::name).collect(Collectors.toSet());
-
-        for (Integer tableId : tableIds) {
-            waitForStableAssignmentsInMetastore(allNodes, tableId);
-        }
-
-        AtomicBoolean dropMessages = new AtomicBoolean(true);
-
-        cluster.runningNodes().forEach(
-                n -> n.dropMessages((nodeName, msg) -> msg instanceof 
ChangePeersAsyncRequest && dropMessages.get())
-        );
-
-        alterZone(zoneName, 2);
-
-        CatalogManager catalogManager = cluster.aliveNode().catalogManager();
-
-        int zoneId = 
catalogManager.catalog(catalogManager.latestCatalogVersion()).zone(zoneName).id();
-
-        waitForTablesCounterInMetastore(3, zoneId, 0);
-        waitForTablesCounterInMetastore(3, zoneId, 1);
-        waitForTablesCounterInMetastore(3, zoneId, 2);
-
-        dropMessages.set(false);
-
-        for (Integer tableId : tableIds) {
-            waitForStableAssignmentsInMetastore(2, tableId);
-        }
-
-        waitForTablesCounterInMetastore(0, zoneId, 0);
-        waitForTablesCounterInMetastore(0, zoneId, 1);
-        waitForTablesCounterInMetastore(0, zoneId, 2);
-    }
-
-    @Test
-    void testRebalanceTablesCounterForZonePrevCatalogVersion() throws 
Exception {
-        cluster.startAndInit(3);
-
-        String zoneName = "ZONE";
-
-        createZone(zoneName, 3, 3);
-
-        Set<Integer> tableIds = new HashSet<>();
-
-        tableIds.add(createTestTable("TEST1", zoneName));
-
-        Set<String> allNodes = 
cluster.runningNodes().map(IgniteImpl::name).collect(Collectors.toSet());
-
-        for (Integer tableId : tableIds) {
-            waitForStableAssignmentsInMetastore(allNodes, tableId);
-        }
-
-        // Block low watermark change with an open ro tx.
-        cluster.aliveNode().transactions().begin(new 
TransactionOptions().readOnly(true));
-
-        alterZone(zoneName, 2);
-
-        dropTestTable("TEST1");

Review Comment:
   removed



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