You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ga...@apache.org on 2023/04/26 12:09:21 UTC

[doris] branch master updated: [fix](colocate) prohibit dead backend as destination backend in colocate balance (#18970)

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

gabriellee 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 b3b261e052 [fix](colocate) prohibit dead backend as destination backend in colocate balance (#18970)
b3b261e052 is described below

commit b3b261e0521f597e9cc5574a9d9106968c0daaf2
Author: Luwei <81...@qq.com>
AuthorDate: Wed Apr 26 20:09:01 2023 +0800

    [fix](colocate) prohibit dead backend as destination backend in colocate balance (#18970)
---
 .../apache/doris/clone/ColocateTableCheckerAndBalancer.java   | 11 +++++++++++
 .../doris/clone/ColocateTableCheckerAndBalancerTest.java      | 10 ++++++++++
 2 files changed, 21 insertions(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java b/fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java
index 37030dc088..142137e203 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java
@@ -427,6 +427,17 @@ public class ColocateTableCheckerAndBalancer extends MasterDaemon {
                     continue;
                 }
 
+                // Unavailable be has been removed from backendWithReplicaNum,
+                // but the conditions for judging unavailable be by
+                // getUnavailableBeIdsInGroup may be too loose. Under the
+                // default configuration (colocate_group_relocate_delay_second =
+                // 1800), a be that has been out of contact for 20 minutes can
+                // still be selected as the dest be.
+                if (!destBe.isAlive()) {
+                    LOG.info("{} is not alive, not suitable as a dest be", destBe);
+                    continue;
+                }
+
                 for (int seqIndex : seqIndexes) {
                     // the bucket index.
                     // eg: 0 / 3 = 0, so that the bucket index of the 4th backend id in flatBackendsPerBucketSeq is 0.
diff --git a/fe/fe-core/src/test/java/org/apache/doris/clone/ColocateTableCheckerAndBalancerTest.java b/fe/fe-core/src/test/java/org/apache/doris/clone/ColocateTableCheckerAndBalancerTest.java
index a549bd7e08..54ea8a77e7 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/clone/ColocateTableCheckerAndBalancerTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/clone/ColocateTableCheckerAndBalancerTest.java
@@ -74,6 +74,16 @@ public class ColocateTableCheckerAndBalancerTest {
         backend8 = new Backend(8L, "192.168.1.8", 9050);
         backend9 = new Backend(9L, "192.168.1.8", 9050);
 
+        backend1.setAlive(true);
+        backend2.setAlive(true);
+        backend3.setAlive(true);
+        backend4.setAlive(true);
+        backend5.setAlive(true);
+        backend6.setAlive(true);
+        backend7.setAlive(true);
+        backend8.setAlive(true);
+        backend9.setAlive(true);
+
         mixLoadScores = Maps.newHashMap();
         mixLoadScores.put(1L, 0.1);
         mixLoadScores.put(2L, 0.5);


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