ygerzhedovich commented on code in PR #1915:
URL: https://github.com/apache/ignite-3/pull/1915#discussion_r1160746068


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/schema/IgniteTableImpl.java:
##########
@@ -539,20 +540,33 @@ private class StatisticsImpl implements Statistic {
         /** {@inheritDoc} */
         @Override
         public Double getRowCount() {
-            if (statReqCnt.getAndIncrement() % STATS_CLI_UPDATE_THRESHOLD == 
0) {
+            int prevCnt = statReqCnt.getAndIncrement();
+
+            if (prevCnt % STATS_CLI_UPDATE_THRESHOLD == 0) {
                 int parts = 
table.storage().distributionZoneConfiguration().partitions().value();
 
                 long size = 0L;
+                boolean noCache = false;
 
                 for (int p = 0; p < parts; ++p) {
                     @Nullable MvPartitionStorage part = 
table.storage().getMvPartition(p);
 
-                    if (part != null) {
+                    if (part == null) {
+                        continue;
+                    }
+
+                    try {
                         size += part.rowsCount();
+                    } catch (StorageRebalanceException ignore) {
+                        noCache = true;
                     }
                 }
 
-                localRowCnt = size;
+                if (noCache) {

Review Comment:
   in case the first calculation is fallen we will use zero as the rows 
counter, I'm not sure but maybe will be better to use incorrectly calculated 
value for the case



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