You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morrySnow (via GitHub)" <gi...@apache.org> on 2023/07/17 12:39:54 UTC

[GitHub] [doris] morrySnow commented on a diff in pull request #21849: [enhancement](nereids) Retry when loading stats

morrySnow commented on code in PR #21849:
URL: https://github.com/apache/doris/pull/21849#discussion_r1265292459


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatisticsCacheLoader.java:
##########
@@ -67,4 +82,43 @@ private Optional<ColumnStatistic> loadFromStatsTable(long tableId, long idxId, S
             return Optional.of(columnStatistics);
         }
     }
+
+    private void retryLoad(StatisticsCacheKey key) {
+
+        singleThreadPool.submit(new RetryTask(key, 1));
+    }
+
+    private static class RetryTask implements Runnable {
+        StatisticsCacheKey key;
+        int retryTimes;
+
+        public RetryTask(StatisticsCacheKey key, int retryTimes) {
+            this.key = key;
+            this.retryTimes = retryTimes;
+        }
+
+        @Override
+        public void run() {
+            List<ResultRow> columnResults = null;
+            try {
+                columnResults = StatisticsRepository.loadColStats(key.tableId, key.idxId, key.colName);
+            } catch (InternalQueryExecutionException e) {
+                if (this.retryTimes < StatisticConstants.LOAD_RETRY_TIMES) {

Review Comment:
   what will happen if retryTimes >= LOAD_RETRY_TIMES? why not retry until load success or detected key aready been loaded into cache?



##########
fe/fe-core/src/main/java/org/apache/doris/common/ThreadPoolManager.java:
##########
@@ -134,6 +134,15 @@ public static ThreadPoolExecutor newDaemonFixedThreadPool(int numThread, int que
                 poolName, needRegisterMetric);
     }
 
+    public static ThreadPoolExecutor newDaemonFixedThreadPool(int numThread, int queueSize,
+                                                              String poolName, int timeoutSeconds,

Review Comment:
   unuse arg `timeoutSeconds` 



##########
fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatisticsCacheLoader.java:
##########
@@ -67,4 +82,43 @@ private Optional<ColumnStatistic> loadFromStatsTable(long tableId, long idxId, S
             return Optional.of(columnStatistics);
         }
     }
+
+    private void retryLoad(StatisticsCacheKey key) {
+

Review Comment:
   remove this blank line



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org