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

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new c798c20f0b9 [fix](replica) Get tablet replica infos should return all 
primary backends except for warmup jobs (#54132)
c798c20f0b9 is described below

commit c798c20f0b90c9deb5071514340738cccc3734f4
Author: Siyang Tang <[email protected]>
AuthorDate: Mon Aug 4 09:58:44 2025 +0800

    [fix](replica) Get tablet replica infos should return all primary backends 
except for warmup jobs (#54132)
    
    Fix logic conflict of #52538 and #52715
---
 .../apache/doris/service/FrontendServiceImpl.java  | 35 +++++++++++++---------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java 
b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
index 2883bc9c5c9..b304f533aed 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
@@ -2807,23 +2807,30 @@ public class FrontendServiceImpl implements 
FrontendService.Iface {
                     LOG.warn("replica {} not normal", replica.getId());
                     continue;
                 }
-                Backend backend;
+                List<Backend> backends;
                 if (Config.isCloudMode()) {
-                    CloudReplica cloudReplica = (CloudReplica) replica;
-                    backend = cloudReplica.getPrimaryBackend(clusterId);
+                    if (request.isSetWarmUpJobId()) {
+                        CloudReplica cloudReplica = (CloudReplica) replica;
+                        Backend primaryBackend = 
cloudReplica.getPrimaryBackend(clusterId);
+                        backends = Lists.newArrayList(primaryBackend);
+                    } else {
+                        CloudReplica cloudReplica = (CloudReplica) replica;
+                        backends = cloudReplica.getAllPrimaryBes();
+                    }
                 } else {
-                    backend = 
Env.getCurrentSystemInfo().getBackend(replica.getBackendIdWithoutException());
+                    Backend backend = 
Env.getCurrentSystemInfo().getBackend(replica.getBackendIdWithoutException());
+                    backends = Lists.newArrayList(backend);
                 }
-                if (backend != null) {
-                    TReplicaInfo replicaInfo = new TReplicaInfo();
-                    replicaInfo.setHost(backend.getHost());
-                    replicaInfo.setBePort(backend.getBePort());
-                    replicaInfo.setHttpPort(backend.getHttpPort());
-                    replicaInfo.setBrpcPort(backend.getBrpcPort());
-                    replicaInfo.setIsAlive(backend.isAlive());
-                    replicaInfo.setBackendId(backend.getId());
-                    replicaInfo.setReplicaId(replica.getId());
-                    replicaInfos.add(replicaInfo);
+                for (Backend backend : backends) {
+                    if (backend != null) {
+                        TReplicaInfo replicaInfo = new TReplicaInfo();
+                        replicaInfo.setHost(backend.getHost());
+                        replicaInfo.setBePort(backend.getBePort());
+                        replicaInfo.setHttpPort(backend.getHttpPort());
+                        replicaInfo.setBrpcPort(backend.getBrpcPort());
+                        replicaInfo.setReplicaId(replica.getId());
+                        replicaInfos.add(replicaInfo);
+                    }
                 }
             }
             tabletReplicaInfos.put(tabletId, replicaInfos);


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

Reply via email to