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 92a4a9770c2 [improvement](hint) query fail print tablet detail info
(#28476)
92a4a9770c2 is described below
commit 92a4a9770c2e2d944f1092fd38cda2e2a8c7c47a
Author: yujun <[email protected]>
AuthorDate: Sat Dec 16 12:54:25 2023 +0800
[improvement](hint) query fail print tablet detail info (#28476)
---
.../main/java/org/apache/doris/common/Config.java | 2 +-
.../java/org/apache/doris/catalog/Replica.java | 27 ++++++++++++++++++++--
.../main/java/org/apache/doris/catalog/Tablet.java | 17 ++++----------
3 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
index c7b6c611a5a..768de71da43 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
@@ -2107,7 +2107,7 @@ public class Config extends ConfigBase {
"When set to true, if a query is unable to select a healthy
replica, "
+ "the detailed information of all the replicas of the
tablet,"
+ " including the specific reason why they are
unqueryable, will be printed out."})
- public static boolean show_details_for_unaccessible_tablet = false;
+ public static boolean show_details_for_unaccessible_tablet = true;
@ConfField(mutable = false, masterOnly = false, varType =
VariableAnnotation.EXPERIMENTAL, description = {
"是否启用binlog特性",
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java
index 94608308208..66d84d117f9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java
@@ -21,6 +21,7 @@ import org.apache.doris.common.Config;
import org.apache.doris.common.io.Text;
import org.apache.doris.common.io.Writable;
import org.apache.doris.common.util.DebugPointUtil;
+import org.apache.doris.system.Backend;
import org.apache.doris.thrift.TUniqueId;
import com.google.gson.annotations.SerializedName;
@@ -597,8 +598,16 @@ public class Replica implements Writable {
strBuffer.append(", backendId=");
strBuffer.append(backendId);
if (checkBeAlive) {
- strBuffer.append(", backendAlive=");
-
strBuffer.append(Env.getCurrentSystemInfo().checkBackendAlive(backendId));
+ Backend backend = Env.getCurrentSystemInfo().getBackend(backendId);
+ if (backend == null) {
+ strBuffer.append(", backend=null");
+ } else {
+ strBuffer.append(", backendAlive=");
+ strBuffer.append(backend.isAlive());
+ if (backend.isDecommissioned()) {
+ strBuffer.append(", backendDecommission=true");
+ }
+ }
}
strBuffer.append(", version=");
strBuffer.append(version);
@@ -610,6 +619,20 @@ public class Replica implements Writable {
strBuffer.append(", lastFailedTimestamp=");
strBuffer.append(lastFailedTimestamp);
}
+ if (isBad()) {
+ strBuffer.append(", isBad=true");
+ Backend backend = Env.getCurrentSystemInfo().getBackend(backendId);
+ if (backend != null && pathHash != -1) {
+ DiskInfo diskInfo = backend.getDisks().values().stream()
+ .filter(disk -> disk.getPathHash() == pathHash)
+ .findFirst().orElse(null);
+ if (diskInfo == null) {
+ strBuffer.append(", disk with path hash " + pathHash + "
not exists");
+ } else if (diskInfo.getState() == DiskInfo.DiskState.OFFLINE) {
+ strBuffer.append(", disk " + diskInfo.getRootPath() + " is
bad");
+ }
+ }
+ }
strBuffer.append(", state=");
strBuffer.append(state.name());
strBuffer.append("]");
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 851932b721b..e579c6b9a48 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
@@ -31,6 +31,7 @@ import org.apache.doris.resource.Tag;
import org.apache.doris.system.Backend;
import org.apache.doris.system.SystemInfoService;
+import com.google.common.base.Joiner;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -287,18 +288,10 @@ public class Tablet extends MetaObject implements
Writable {
StringBuilder sb = new StringBuilder("Visible Replicas:");
sb.append("Visible version: ").append(visibleVersion);
sb.append(", Replicas: ");
- for (Replica replica : replicas) {
- sb.append(replica.toString());
- }
- sb.append(", Backends: ");
- for (Replica replica : replicas) {
- Backend be =
Env.getCurrentSystemInfo().getBackend(replica.getBackendId());
- if (be == null) {
- sb.append("Backend [id=" + id + ", not exists]");
- } else {
- sb.append(be.getHealthyStatus());
- }
- }
+ sb.append(Joiner.on(", ").join(replicas.stream().map(replica ->
replica.toStringSimple(true))
+ .collect(Collectors.toList())));
+ sb.append(".");
+
return sb.toString();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]