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 c7b6c611a5..768de71da4 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 9460830820..66d84d117f 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 851932b721..e579c6b9a4 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(); }