wangbo commented on a change in pull request #8423:
URL: https://github.com/apache/incubator-doris/pull/8423#discussion_r823358665



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
##########
@@ -793,19 +793,7 @@ 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:
       Why not abort transaction when db is droped? Because it maybe recovered?

##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
##########
@@ -793,19 +793,7 @@ 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:
       Why not abort transaction when db is dropped? Because it maybe recovered?




-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to