This is an automated email from the ASF dual-hosted git repository.

meiyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 36311d42300 [fix](group commit) group commit select backend should 
consider isLoadAvailable (#61555)
36311d42300 is described below

commit 36311d42300faa71efd96091c16876524d7633a6
Author: meiyi <[email protected]>
AuthorDate: Tue Mar 31 18:45:18 2026 +0800

    [fix](group commit) group commit select backend should consider 
isLoadAvailable (#61555)
    
    1. extracts backend availability checks into a shared
    isBackendAvailable() method
    2. adds the missing isLoadAvailable() check to group commit backend
    selection. Previously, backends with isLoadDisabled=true or
    isShutDown=true could still be selected for group commit, which is
    incorrect.
---
 .../org/apache/doris/load/GroupCommitManager.java  | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java 
b/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
index a2234c5366a..bea5cd03c7d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
@@ -357,10 +357,7 @@ public class GroupCommitManager {
                     return null;
                 }
                 Backend backend = 
Env.getCurrentSystemInfo().getBackend(backendId);
-                if (backend != null && backend.isAlive() && 
!backend.isDecommissioned()
-                        && (!Config.isCloudMode() || 
!backend.isDecommissioning())
-                        && (!Config.isCloudMode() || cluster == null
-                                || 
cluster.equals(backend.getCloudClusterName()))) {
+                if (isBackendAvailable(backend, cluster)) {
                     return backend.getId();
                 } else {
                     tableToBeMap.remove(encode(cluster, tableId));
@@ -372,13 +369,26 @@ public class GroupCommitManager {
         return null;
     }
 
+    private boolean isBackendAvailable(Backend backend, String cluster) {
+        if (backend == null || !backend.isAlive() || 
backend.isDecommissioned() || !backend.isLoadAvailable()) {
+            return false;
+        }
+        if (!Config.isCloudMode()) {
+            return true;
+        }
+        // for cloud mode
+        if (backend.isDecommissioning()) {
+            return false;
+        }
+        return cluster == null || 
cluster.equals(backend.getCloudClusterName());
+    }
+
     @Nullable
     private Long getRandomBackend(String cluster, long tableId, List<Backend> 
backends) {
         OlapTable table = (OlapTable) 
Env.getCurrentEnv().getInternalCatalog().getTableByTableId(tableId);
         Collections.shuffle(backends);
         for (Backend backend : backends) {
-            if (backend.isAlive() && !backend.isDecommissioned() && 
(!Config.isCloudMode()
-                    || !backend.isDecommissioning())) {
+            if (isBackendAvailable(backend, cluster)) {
                 tableToBeMap.put(encode(cluster, tableId), backend.getId());
                 tableToPressureMap.put(tableId,
                         new 
SlidingWindowCounter(table.getGroupCommitIntervalMs() / 1000 + 1));


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to