Skip to content

Commit bd6b1ee

Browse files
committed
add preconditition check failed log
1 parent 2712bb9 commit bd6b1ee

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ public void tabletReport(long backendId, Map<Long, TTablet> backendTablets,
142142
// traverse replicas in meta with this backend
143143
replicaMetaWithBackend.entrySet().parallelStream().forEach(entry -> {
144144
long tabletId = entry.getKey();
145-
Preconditions.checkState(tabletMetaMap.containsKey(tabletId));
145+
Preconditions.checkState(tabletMetaMap.containsKey(tabletId),
146+
"tablet " + tabletId + " not exists, backend " + backendId);
146147
TabletMeta tabletMeta = tabletMetaMap.get(tabletId);
147148

148149
if (backendTablets.containsKey(tabletId)) {
@@ -571,7 +572,9 @@ public void deleteTablet(long tabletId) {
571572
public void addReplica(long tabletId, Replica replica) {
572573
long stamp = writeLock();
573574
try {
574-
Preconditions.checkState(tabletMetaMap.containsKey(tabletId));
575+
Preconditions.checkState(tabletMetaMap.containsKey(tabletId),
576+
"tablet " + tabletId + " not exists, replica " + replica.getId()
577+
+ ", backend " + replica.getBackendId());
575578
replicaMetaTable.put(tabletId, replica.getBackendId(), replica);
576579
replicaToTabletMap.put(replica.getId(), tabletId);
577580
backingReplicaMetaTable.put(replica.getBackendId(), tabletId, replica);
@@ -585,7 +588,8 @@ public void addReplica(long tabletId, Replica replica) {
585588
public void deleteReplica(long tabletId, long backendId) {
586589
long stamp = writeLock();
587590
try {
588-
Preconditions.checkState(tabletMetaMap.containsKey(tabletId));
591+
Preconditions.checkState(tabletMetaMap.containsKey(tabletId),
592+
"tablet " + tabletId + " not exists, backend " + backendId);
589593
if (replicaMetaTable.containsRow(tabletId)) {
590594
Replica replica = replicaMetaTable.remove(tabletId, backendId);
591595
replicaToTabletMap.remove(replica.getId());
@@ -606,7 +610,8 @@ public void deleteReplica(long tabletId, long backendId) {
606610
public Replica getReplica(long tabletId, long backendId) {
607611
long stamp = readLock();
608612
try {
609-
Preconditions.checkState(tabletMetaMap.containsKey(tabletId), tabletId);
613+
Preconditions.checkState(tabletMetaMap.containsKey(tabletId),
614+
"tablet " + tabletId + " not exists, backend " + backendId);
610615
return replicaMetaTable.get(tabletId, backendId);
611616
} finally {
612617
readUnlock(stamp);
@@ -749,7 +754,7 @@ public Map<TStorageMedium, TreeMultimap<Long, PartitionBalanceInfo>> buildPartit
749754
Preconditions.checkNotNull(tabletMeta, "invalid tablet " + tabletId);
750755
Preconditions.checkState(
751756
!Env.getCurrentColocateIndex().isColocateTable(tabletMeta.getTableId()),
752-
"should not be the colocate table");
757+
"table " + tabletMeta.getTableId() + " should not be the colocate table");
753758

754759
TStorageMedium medium = tabletMeta.getStorageMedium();
755760
Table<Long, Long, Map<Long, Long>> partitionReplicasInfo = partitionReplicasInfoMaps.get(medium);

0 commit comments

Comments
 (0)