This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 2fb4c818da [fix](tablet clone) delete tablet check other catchup #24038
2fb4c818da is described below
commit 2fb4c818da4a05d2c4e0d5a0c24e3c0944c2eec3
Author: yujun <[email protected]>
AuthorDate: Sat Sep 9 00:42:32 2023 +0800
[fix](tablet clone) delete tablet check other catchup #24038
Sometimes FE replica's version is unreliable. FE's replica may bigger than
BE's real version. Need check if BE missing version (last failed version > 0).
---
.../main/java/org/apache/doris/clone/TabletScheduler.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java
b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java
index d791b53475..8cd3e92131 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java
@@ -1056,14 +1056,11 @@ public class TabletScheduler extends MasterDaemon {
Replica replica, String reason, boolean force) throws
SchedException {
List<Replica> replicas = tabletCtx.getTablet().getReplicas();
- int matchupReplicaCount = 0;
- for (Replica tmpReplica : replicas) {
- if (tmpReplica.getVersion() >= replica.getVersion()) {
- matchupReplicaCount++;
- }
- }
-
- if (matchupReplicaCount <= 1) {
+ boolean otherCatchup = replicas.stream().anyMatch(
+ r -> r.getId() != replica.getId()
+ && (r.getVersion() > replica.getVersion()
+ || (r.getVersion() == replica.getVersion() &&
r.getLastFailedVersion() < 0)));
+ if (!otherCatchup) {
LOG.info("can not delete only one replica, tabletId = {} replicaId
= {}", tabletCtx.getTabletId(),
replica.getId());
throw new SchedException(Status.UNRECOVERABLE, "the only one
latest replia can not be dropped, tabletId = "
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]