morningman commented on a change in pull request #8423:
URL: https://github.com/apache/incubator-doris/pull/8423#discussion_r823607559
##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Database.java
##########
@@ -410,28 +410,26 @@ public void dropTable(String tableName) {
return views;
}
- public List<Table> getTablesOnIdOrderOrThrowException(List<Long>
tableIdList) throws MetaNotFoundException {
- List<Table> tableList = Lists.newArrayList();
+ public List<Table> getTablesOnIdOrderNullable(List<Long> tableIdList) {
Review comment:
Add comment to explain behavior of this method.
And it is strange to just ignore missing table instead of throwing exception.
The method name can not reflect this behavior, may leading misuse
##########
File path:
fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
##########
@@ -17,6 +17,7 @@
package org.apache.doris.transaction;
+import org.apache.commons.lang3.StringUtils;
Review comment:
import order
##########
File path:
fe/fe-core/src/main/java/org/apache/doris/common/util/MetaLockUtils.java
##########
@@ -17,6 +17,7 @@
package org.apache.doris.common.util;
+import com.google.common.collect.Lists;
Review comment:
import order
##########
File path:
fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
##########
@@ -793,22 +794,13 @@ public void finishTransaction(long transactionId,
Set<Long> errorReplicaIds) thr
errorReplicaIds.addAll(originalErrorReplicas);
}
- Database db = catalog.getDbNullable(transactionState.getDbId());
- if (db == null) {
- writeLock();
- try {
-
transactionState.setTransactionStatus(TransactionStatus.ABORTED);
- transactionState.setReason("db is dropped");
- LOG.warn("db is dropped during transaction, abort transaction
{}", transactionState);
- unprotectUpsertTransactionState(transactionState, false);
- return;
- } finally {
- writeUnlock();
- }
- }
+ Database db = catalog.getDbOrMetaException(transactionState.getDbId());
Review comment:
Add comment to describe the logic here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]