From 4d3983335a3c3aff47ea7820bca5be507c963334 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 c3ba8e625a..d2ea70873f 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 class TabletInvertedIndex { // 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)) { @@ -571,7 +572,9 @@ public class TabletInvertedIndex { 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); @@ -585,7 +588,8 @@ public class TabletInvertedIndex { 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()); @@ -606,7 +610,8 @@ public class TabletInvertedIndex { 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); @@ -749,7 +754,7 @@ public class TabletInvertedIndex { 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);