rpuch commented on code in PR #4733:
URL: https://github.com/apache/ignite-3/pull/4733#discussion_r1846373016


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/DisasterRecoverySystemViews.java:
##########
@@ -65,6 +66,7 @@ static SystemView<?> 
createLocalPartitionStatesSystemView(DisasterRecoveryManage
                 .addColumn("TABLE_NAME", STRING, state -> 
state.state.tableName)
                 .addColumn("PARTITION_ID", INT32, state -> 
state.state.partitionId)
                 .addColumn("STATE", STRING, state -> state.state.state.name())
+                .addColumn("ESTIMATED_SIZE", INT64, state -> 
state.state.estimatedSize)

Review Comment:
   I know that everywhere in our code it's called `estimated size`, but how 
about inventing a more descriptive term for the user-facing places like this 
one, like 'estimatedRows'? A problem with `estimatedSize` is that it's not 
clear in what units it is: maybe it's rows, maybe it's bytes. 'estimatedRows' 
would allow to remove this ambiguity.



##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/disaster/ItDisasterRecoverySystemViewTest.java:
##########
@@ -102,10 +102,40 @@ void testLocalPartitionStatesSystemView() {
         int tableId = getTableId(DEFAULT_SCHEMA_NAME, TABLE_NAME);
 
         assertQuery(localPartitionStatesSystemViewSql())
-                .returns(nodeName0, ZONE_NAME, tableId, DEFAULT_SCHEMA_NAME, 
TABLE_NAME, 0, HEALTHY.name())
-                .returns(nodeName0, ZONE_NAME, tableId, DEFAULT_SCHEMA_NAME, 
TABLE_NAME, 1, HEALTHY.name())
-                .returns(nodeName1, ZONE_NAME, tableId, DEFAULT_SCHEMA_NAME, 
TABLE_NAME, 0, HEALTHY.name())
-                .returns(nodeName1, ZONE_NAME, tableId, DEFAULT_SCHEMA_NAME, 
TABLE_NAME, 1, HEALTHY.name())
+                .returns(nodeName0, ZONE_NAME, tableId, DEFAULT_SCHEMA_NAME, 
TABLE_NAME, 0, HEALTHY.name(), 0L)
+                .returns(nodeName0, ZONE_NAME, tableId, DEFAULT_SCHEMA_NAME, 
TABLE_NAME, 1, HEALTHY.name(), 0L)
+                .returns(nodeName1, ZONE_NAME, tableId, DEFAULT_SCHEMA_NAME, 
TABLE_NAME, 0, HEALTHY.name(), 0L)
+                .returns(nodeName1, ZONE_NAME, tableId, DEFAULT_SCHEMA_NAME, 
TABLE_NAME, 1, HEALTHY.name(), 0L)
+                .check();
+    }
+
+    @Test
+    void testLocalPartitionStatesSystemViewWithUpdatedEstimatedSize() throws 
Exception {
+        assertEquals(2, initialNodes());
+
+        int partitionsCount = 1;
+
+        createZoneAndTable(ZONE_NAME, TABLE_NAME, initialNodes(), 
partitionsCount);
+        
+        waitLeaderOnAllPartitions(TABLE_NAME, partitionsCount);
+
+        insertPeople(
+                TABLE_NAME,
+                new Person(1, "foo_name", 100.0),
+                new Person(2, "bar_name", 200.0)
+        );
+
+        List<String> nodeNames = 
CLUSTER.runningNodes().map(Ignite::name).sorted().collect(toList());
+
+        int tableId = getTableId(DEFAULT_SCHEMA_NAME, TABLE_NAME);
+
+        // Small wait is specially added so that the follower can execute the 
replicated "insert" command and the counter is honestly
+        // increased.
+        Thread.sleep(250);

Review Comment:
   Let's just wait till `MvPartitionStorage#estimatedSize()` returns 2 using 
`waitForCondition()`. Using `sleep()` is unreliable, it will fail from time to 
time on our TC.



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

Reply via email to