Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[branch-2.0](tablet invert) add preconditition check failed log #26770 #27171

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public void tabletReport(long backendId, Map<Long, TTablet> 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)) {
Expand Down Expand Up @@ -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);
Expand All @@ -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());
Expand All @@ -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);
Expand Down Expand Up @@ -731,7 +736,7 @@ public Map<TStorageMedium, TreeMultimap<Long, PartitionBalanceInfo>> 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<Long, Long, Map<Long, Long>> partitionReplicasInfo = partitionReplicasInfoMaps.get(medium);
Expand Down