You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2021/09/07 12:51:55 UTC
[incubator-doris] branch branch-0.14 updated: [Bug] fix bug
colocate join table can't repaired (#6544)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-0.14
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/branch-0.14 by this push:
new 9800fd3 [Bug] fix bug colocate join table can't repaired (#6544)
9800fd3 is described below
commit 9800fd332cbf7aa0be66f8ca16e31d75f6c7a354
Author: dh-cloud <60...@users.noreply.github.com>
AuthorDate: Tue Sep 7 20:51:39 2021 +0800
[Bug] fix bug colocate join table can't repaired (#6544)
we found colocate join table replica can't repaired. the tablet status is "COLOCATE_MISMATCH",
schedule failed log is "unable to find dest path for new replica"
repair mis_match status tablet, need clone replica to other host , but each host already have replica,
so it always schedule failed.
so we set should set tablet status to COLOCATE_REDUNDANT, delete one replica, then we can repair mis_match tablet
---
.../main/java/org/apache/doris/catalog/Tablet.java | 38 +++++++++++-----------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
index 361d6ec..a432ff2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
@@ -522,35 +522,40 @@ public class Tablet extends MetaObject implements Writable {
/**
* Check colocate table's tablet health
- * 1. Mismatch:
+ * 1. Redundant:
+ * backends set: 1,2,3
+ * tablet replicas: 1,2,3,4
+ *
+ * backends set: 1,2,3
+ * tablet replicas: 1,2,4,5
+ *
+ * 2. Mismatch:
* backends set: 1,2,3
* tablet replicas: 1,2,5
*
* backends set: 1,2,3
* tablet replicas: 1,2
- *
- * backends set: 1,2,3
- * tablet replicas: 1,2,4,5
- *
- * 2. Version incomplete:
+ *
+ * 3. Version incomplete:
* backend matched, but some replica(in backends set)'s version is incomplete
- *
- * 3. Redundant:
- * backends set: 1,2,3
- * tablet replicas: 1,2,3,4
- *
+ *
* No need to check if backend is available. We consider all backends in 'backendsSet' are available,
* If not, unavailable backends will be relocated by CalocateTableBalancer first.
*/
public TabletStatus getColocateHealthStatus(long visibleVersion, int replicationNum, Set<Long> backendsSet) {
-
- // 1. check if replicas' backends are mismatch
+
+ // 1. check redundant
+ if (replicas.size() > replicationNum) {
+ return TabletStatus.COLOCATE_REDUNDANT;
+ }
+
+ // 2. check if replicas' backends are mismatch
Set<Long> replicaBackendIds = getBackendIds();
if (!replicaBackendIds.containsAll(backendsSet)) {
return TabletStatus.COLOCATE_MISMATCH;
}
- // 2. check version completeness
+ // 3. check version completeness
for (Replica replica : replicas) {
if (!backendsSet.contains(replica.getBackendId())) {
// We don't care about replicas that are not in backendsSet.
@@ -563,11 +568,6 @@ public class Tablet extends MetaObject implements Writable {
}
}
- // 3. check redundant
- if (replicas.size() > replicationNum) {
- return TabletStatus.COLOCATE_REDUNDANT;
- }
-
return TabletStatus.HEALTHY;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org