xtern commented on code in PR #1915:
URL: https://github.com/apache/ignite-3/pull/1915#discussion_r1160782990
##########
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:
I decided to revert this change completely... currently any concurrent call
can see a zero in localRowCnt (if it is calculated for the first time), but may
be it's ok.
--
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]