From f5e2ea1699c14e378aa0c51c12d240e0911d8b95 Mon Sep 17 00:00:00 2001 From: lw112 <131352377+felixwluo@users.noreply.github.com> Date: Sat, 30 Dec 2023 20:49:01 +0800 Subject: [PATCH] [fix][fe]Fixed show proc tablet inaccuracies (#29186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both tables simply need to change the tablet id to get the same result from the show proc statement. before: image Just change the tablet id to get the result, 10139 does not belong to the tablet in the table id of 10127 later: image --- .../org/apache/doris/common/proc/TabletsProcDir.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java b/fe/fe-core/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java index e13d1846a5..d4c79db92d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/proc/TabletsProcDir.java @@ -22,7 +22,6 @@ import org.apache.doris.catalog.MaterializedIndex; import org.apache.doris.catalog.Replica; import org.apache.doris.catalog.Table; import org.apache.doris.catalog.Tablet; -import org.apache.doris.catalog.TabletInvertedIndex; import org.apache.doris.common.AnalysisException; import org.apache.doris.common.Config; import org.apache.doris.common.FeConstants; @@ -209,8 +208,12 @@ public class TabletsProcDir implements ProcDirInterface { throw new AnalysisException("Invalid tablet id format: " + tabletIdStr); } - TabletInvertedIndex invertedIndex = Env.getCurrentInvertedIndex(); - List replicas = invertedIndex.getReplicasByTabletId(tabletId); + Tablet tablet = index.getTablet(tabletId); + if (tablet == null) { + throw new AnalysisException("Tablet[" + tabletId + "] does not exist"); + } + + List replicas = tablet.getReplicas(); return new ReplicasProcNode(tabletId, replicas); }