From 6b0e9092d7df1458ff42f4efbb4737abbb07b23e Mon Sep 17 00:00:00 2001 From: yujun Date: Mon, 13 Nov 2023 21:47:33 +0800 Subject: [PATCH] [log](tablet invert) add preconditition check failed log (#26770) --- .../apache/doris/catalog/TabletInvertedIndex.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java index 39818d52bc62f9..2d51c2a89a505f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java @@ -142,7 +142,8 @@ public void tabletReport(long backendId, Map backendTablets, // traverse replicas in meta with this backend replicaMetaWithBackend.entrySet().parallelStream().forEach(entry -> { long tabletId = entry.getKey(); - Preconditions.checkState(tabletMetaMap.containsKey(tabletId)); + Preconditions.checkState(tabletMetaMap.containsKey(tabletId), + "tablet " + tabletId + " not exists, backend " + backendId); TabletMeta tabletMeta = tabletMetaMap.get(tabletId); if (backendTablets.containsKey(tabletId)) { @@ -553,7 +554,9 @@ public void deleteTablet(long tabletId) { public void addReplica(long tabletId, Replica replica) { long stamp = writeLock(); try { - Preconditions.checkState(tabletMetaMap.containsKey(tabletId)); + Preconditions.checkState(tabletMetaMap.containsKey(tabletId), + "tablet " + tabletId + " not exists, replica " + replica.getId() + + ", backend " + replica.getBackendId()); replicaMetaTable.put(tabletId, replica.getBackendId(), replica); replicaToTabletMap.put(replica.getId(), tabletId); backingReplicaMetaTable.put(replica.getBackendId(), tabletId, replica); @@ -567,7 +570,8 @@ public void addReplica(long tabletId, Replica replica) { public void deleteReplica(long tabletId, long backendId) { long stamp = writeLock(); try { - Preconditions.checkState(tabletMetaMap.containsKey(tabletId)); + Preconditions.checkState(tabletMetaMap.containsKey(tabletId), + "tablet " + tabletId + " not exists, backend " + backendId); if (replicaMetaTable.containsRow(tabletId)) { Replica replica = replicaMetaTable.remove(tabletId, backendId); replicaToTabletMap.remove(replica.getId()); @@ -588,7 +592,8 @@ public void deleteReplica(long tabletId, long backendId) { public Replica getReplica(long tabletId, long backendId) { long stamp = readLock(); try { - Preconditions.checkState(tabletMetaMap.containsKey(tabletId), tabletId); + Preconditions.checkState(tabletMetaMap.containsKey(tabletId), + "tablet " + tabletId + " not exists, backend " + backendId); return replicaMetaTable.get(tabletId, backendId); } finally { readUnlock(stamp); @@ -731,7 +736,7 @@ public Map> buildPartit Preconditions.checkNotNull(tabletMeta, "invalid tablet " + tabletId); Preconditions.checkState( !Env.getCurrentColocateIndex().isColocateTable(tabletMeta.getTableId()), - "should not be the colocate table"); + "table " + tabletMeta.getTableId() + " should not be the colocate table"); TStorageMedium medium = tabletMeta.getStorageMedium(); Table> partitionReplicasInfo = partitionReplicasInfoMaps.get(medium);