From e5c2b913ba4463a3fcdff9e19ea5f4ef7ca616f7 Mon Sep 17 00:00:00 2001 From: Vinoth Veeraraghavan Date: Wed, 4 Jan 2023 09:49:26 +0800 Subject: [PATCH] Revert a minor change for MOT --- .../storage/access/transam/xact.cpp | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/gausskernel/storage/access/transam/xact.cpp b/src/gausskernel/storage/access/transam/xact.cpp index 0e510adf5..f01fc08c7 100755 --- a/src/gausskernel/storage/access/transam/xact.cpp +++ b/src/gausskernel/storage/access/transam/xact.cpp @@ -7210,6 +7210,13 @@ static void xact_redo_commit_internal(TransactionId xid, XLogRecPtr lsn, Transac } if (t_thrd.xlog_cxt.standbyState == STANDBY_DISABLED) { +#ifdef ENABLE_MOT + /* + * Report committed transaction to MOT Engine. + */ + CallRedoCommitCallback(xid); +#endif + /* * Mark the transaction committed in pg_xact. We don't bother updating * pg_csnlog during replay. @@ -7243,6 +7250,13 @@ static void xact_redo_commit_internal(TransactionId xid, XLogRecPtr lsn, Transac } else { CSNLogRecordAssignedTransactionId(max_xid); +#ifdef ENABLE_MOT + /* + * Report committed transaction to MOT Engine. + */ + CallRedoCommitCallback(xid); +#endif + /* * Mark the transaction committed in pg_clog. We use async commit * protocol during recovery to provide information on database @@ -7302,17 +7316,6 @@ static void xact_redo_commit_internal(TransactionId xid, XLogRecPtr lsn, Transac StandbyReleaseLockTree(xid, 0, NULL); } -#ifdef ENABLE_MOT - /* - * Report committed transaction to MOT Engine. - * If (XactMOTEngineUsed(xinfo)) - This is an optimization to avoid calling - * MOT redo commit callbacks in case of commit does not have MOT records. - * It is disabled for the time being since data used to identify storage - * engine type is cleared in 2phase commit prepare phase. - */ - CallRedoCommitCallback(xid); -#endif - xact_redo_forget_alloc_segs(xid, sub_xids, nsubxacts, lsn); /* Make sure files supposed to be dropped are dropped */