@@ -1135,6 +1135,7 @@ RecordTransactionCommit(void)
11351135 SharedInvalidationMessage * invalMessages = NULL ;
11361136 bool RelcacheInitFileInval = false;
11371137 bool wrote_xlog ;
1138+ bool committed = false;
11381139
11391140 /* Get data needed for commit record */
11401141 nrels = smgrGetPendingDeletes (true, & rels );
@@ -1273,8 +1274,9 @@ RecordTransactionCommit(void)
12731274 /*
12741275 * Now we may update the CLOG, if we wrote a COMMIT record above
12751276 */
1276- if (markXidCommitted )
1277- TransactionIdCommitTree (xid , nchildren , children );
1277+ if (markXidCommitted ) {
1278+ committed = TransactionIdCommitTree (xid , nchildren , children );
1279+ }
12781280 }
12791281 else
12801282 {
@@ -1296,8 +1298,9 @@ RecordTransactionCommit(void)
12961298 * XLOG. Instead, we store the LSN up to which the XLOG must be
12971299 * flushed before the CLOG may be updated.
12981300 */
1299- if (markXidCommitted )
1300- TransactionIdAsyncCommitTree (xid , nchildren , children , XactLastRecEnd );
1301+ if (markXidCommitted ) {
1302+ committed = TransactionIdAsyncCommitTree (xid , nchildren , children , XactLastRecEnd );
1303+ }
13011304 }
13021305
13031306 /*
@@ -1308,6 +1311,9 @@ RecordTransactionCommit(void)
13081311 {
13091312 MyPgXact -> delayChkpt = false;
13101313 END_CRIT_SECTION ();
1314+ if (!committed ) {
1315+ elog (ERROR , "Transaction commit rejected by XTM" );
1316+ }
13111317 }
13121318
13131319 /* Compute latestXid while we have the child XIDs handy */
@@ -5310,6 +5316,7 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
53105316 TransactionId max_xid ;
53115317 int i ;
53125318 TimestampTz commit_time ;
5319+ bool committed ;
53135320
53145321 max_xid = TransactionIdLatest (xid , parsed -> nsubxacts , parsed -> subxacts );
53155322
@@ -5345,7 +5352,7 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
53455352 /*
53465353 * Mark the transaction committed in pg_clog.
53475354 */
5348- TransactionIdCommitTree (xid , parsed -> nsubxacts , parsed -> subxacts );
5355+ committed = TransactionIdCommitTree (xid , parsed -> nsubxacts , parsed -> subxacts );
53495356 }
53505357 else
53515358 {
@@ -5369,8 +5376,8 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
53695376 * bits set on changes made by transactions that haven't yet
53705377 * recovered. It's unlikely but it's good to be safe.
53715378 */
5372- TransactionIdAsyncCommitTree (
5373- xid , parsed -> nsubxacts , parsed -> subxacts , lsn );
5379+ committed = TransactionIdAsyncCommitTree (
5380+ xid , parsed -> nsubxacts , parsed -> subxacts , lsn );
53745381
53755382 /*
53765383 * We must mark clog before we update the ProcArray.
@@ -5397,7 +5404,9 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
53975404 */
53985405 StandbyReleaseLockTree (xid , 0 , NULL );
53995406 }
5400-
5407+ if (!committed ) {
5408+ elog (NOTICE , "XTM rejected recovert of tran saction %u" , xid );
5409+ }
54015410 if (parsed -> xinfo & XACT_XINFO_HAS_ORIGIN )
54025411 {
54035412 /* recover apply progress */
0 commit comments