[fix][fe]Fixed show proc tablet inaccuracies (#29186)

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
This commit is contained in:
lw112
2023-12-30 20:49:01 +08:00
committed by GitHub
parent 673a0137ce
commit f5e2ea1699

View File

@ -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<Replica> replicas = invertedIndex.getReplicasByTabletId(tabletId);
Tablet tablet = index.getTablet(tabletId);
if (tablet == null) {
throw new AnalysisException("Tablet[" + tabletId + "] does not exist");
}
List<Replica> replicas = tablet.getReplicas();
return new ReplicasProcNode(tabletId, replicas);
}