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 2023/06/10 14:56:36 UTC
[doris] 05/10: [Fix] (tablet) fix tablet queryable set (#20413) (#20414)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 3554187d16c9ac6c3741c35414c38e260a33863c
Author: yujun <yu...@gmail.com>
AuthorDate: Tue Jun 6 15:38:01 2023 +0800
[Fix] (tablet) fix tablet queryable set (#20413) (#20414)
---
fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java | 9 +++++++++
.../src/main/java/org/apache/doris/clone/TabletScheduler.java | 4 ++--
2 files changed, 11 insertions(+), 2 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 fbe60b74c8..003097baa2 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
@@ -216,6 +216,7 @@ public class Tablet extends MetaObject implements Writable {
// for query
public List<Replica> getQueryableReplicas(long visibleVersion) {
List<Replica> allQueryableReplica = Lists.newArrayListWithCapacity(replicas.size());
+ List<Replica> auxiliaryReplica = Lists.newArrayListWithCapacity(replicas.size());
for (Replica replica : replicas) {
if (replica.isBad()) {
continue;
@@ -231,9 +232,17 @@ public class Tablet extends MetaObject implements Writable {
if (replica.checkVersionCatchUp(visibleVersion, false)) {
allQueryableReplica.add(replica);
}
+ } else if (state == ReplicaState.DECOMMISSION) {
+ if (replica.checkVersionCatchUp(visibleVersion, false)) {
+ auxiliaryReplica.add(replica);
+ }
}
}
+ if (allQueryableReplica.isEmpty()) {
+ allQueryableReplica = auxiliaryReplica;
+ }
+
if (Config.skip_compaction_slower_replica && allQueryableReplica.size() > 1) {
long minVersionCount = Long.MAX_VALUE;
for (Replica replica : allQueryableReplica) {
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 8023fe2be5..30d6c23d8a 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
@@ -1123,8 +1123,8 @@ public class TabletScheduler extends MasterDaemon {
replica.setState(ReplicaState.DECOMMISSION);
// set priority to normal because it may wait for a long time. Remain it as VERY_HIGH may block other task.
tabletCtx.setOrigPriority(Priority.NORMAL);
- LOG.debug("set replica {} on backend {} of tablet {} state to DECOMMISSION",
- replica.getId(), replica.getBackendId(), tabletCtx.getTabletId());
+ LOG.info("set replica {} on backend {} of tablet {} state to DECOMMISSION due to reason {}",
+ replica.getId(), replica.getBackendId(), tabletCtx.getTabletId(), reason);
throw new SchedException(Status.SCHEDULE_FAILED, "set watermark txn " + nextTxnId);
} else if (replica.getState() == ReplicaState.DECOMMISSION && replica.getWatermarkTxnId() != -1) {
long watermarkTxnId = replica.getWatermarkTxnId();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org