[BugFix] Fix db is null when replaying batch transactions upsert (backport #62715) (#62736)

Signed-off-by: wyb <wybb86@gmail.com>
Co-authored-by: wyb <wybb86@gmail.com>
This commit is contained in:
mergify[bot] 2025-09-04 17:07:36 +08:00 committed by GitHub
parent 8bf9df6f65
commit 96b335c9ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -1938,7 +1938,10 @@ public class DatabaseTransactionMgr {
LOG.debug("replay a transaction state batch{}", transactionStateBatch);
transactionStateBatch.replaySetTransactionStatus();
Database db = globalStateMgr.getLocalMetastore().getDb(transactionStateBatch.getDbId());
updateCatalogAfterVisibleBatch(transactionStateBatch, db);
// db may be dropped when doing finishTransactionBatch
if (db != null) {
updateCatalogAfterVisibleBatch(transactionStateBatch, db);
}
unprotectSetTransactionStateBatch(transactionStateBatch);
} finally {