zhiqiang-hhhh commented on code in PR #23863:
URL: https://github.com/apache/doris/pull/23863#discussion_r1317155697


##########
fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java:
##########
@@ -1252,6 +1253,92 @@ public RowBatch getNext() throws Exception {
         return resultBatch;
     }
 
+
+    // We use a very conservative cancel strategy.
+    // 0. If backends has zero process epoch, do not cancel. Zero process 
epoch usually arises in cluster upgrading.
+    // 1. If process epoch is same, do not cancel. Means backends does not 
restart or die.
+    public boolean shouldCancel(List<Backend> currentBackends) {
+        Map<Long, Backend> curBeMap = Maps.newHashMap();
+        for (Backend be : currentBackends) {
+            curBeMap.put(be.getId(), be);
+        }
+        lock();
+
+        for (Long id : idToBackend.keySet()) {

Review Comment:
   > 这里为什么要判断这个idToBackend, 按道理说直接BackendExecStates 就行了吧?
   
   idToBackend 是用来记录 某个 coordinator 在 prepare阶段时候 所有 be 信息的 
snapshot。感觉我们这里索引数据结构太多了,很容易用乱,需要一个 multi_index container 这种数据结构



##########
fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java:
##########
@@ -1252,6 +1253,92 @@ public RowBatch getNext() throws Exception {
         return resultBatch;
     }
 
+
+    // We use a very conservative cancel strategy.
+    // 0. If backends has zero process epoch, do not cancel. Zero process 
epoch usually arises in cluster upgrading.
+    // 1. If process epoch is same, do not cancel. Means backends does not 
restart or die.
+    public boolean shouldCancel(List<Backend> currentBackends) {
+        Map<Long, Backend> curBeMap = Maps.newHashMap();
+        for (Backend be : currentBackends) {
+            curBeMap.put(be.getId(), be);
+        }
+        lock();
+
+        for (Long id : idToBackend.keySet()) {

Review Comment:
   > 这里为什么要判断这个idToBackend, 按道理说直接BackendExecStates 就行了吧?
   
   idToBackend 是用来记录 某个 coordinator 在 prepare阶段时候 所有 be 信息的 
snapshot。感觉我们这里索引数据结构太多了,很容易用乱,需要一个 multi_index container 这种数据结构



-- 
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-unsubscr...@doris.apache.org

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


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

Reply via email to