You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ygerzhedovich (via GitHub)" <gi...@apache.org> on 2023/04/07 14:37:03 UTC
[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #1915: IGNITE-19187 Sql. Handle StorageRebalanceException during rowsCount estimation.
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org