@@ -1135,6 +1135,7 @@ RecordTransactionCommit(void)
1135
1135
SharedInvalidationMessage * invalMessages = NULL ;
1136
1136
bool RelcacheInitFileInval = false;
1137
1137
bool wrote_xlog ;
1138
+ bool committed = false;
1138
1139
1139
1140
/* Get data needed for commit record */
1140
1141
nrels = smgrGetPendingDeletes (true,& rels );
@@ -1273,8 +1274,9 @@ RecordTransactionCommit(void)
1273
1274
/*
1274
1275
* Now we may update the CLOG, if we wrote a COMMIT record above
1275
1276
*/
1276
- if (markXidCommitted )
1277
- TransactionIdCommitTree (xid ,nchildren ,children );
1277
+ if (markXidCommitted ) {
1278
+ committed = TransactionIdCommitTree (xid ,nchildren ,children );
1279
+ }
1278
1280
}
1279
1281
else
1280
1282
{
@@ -1296,8 +1298,9 @@ RecordTransactionCommit(void)
1296
1298
* XLOG. Instead, we store the LSN up to which the XLOG must be
1297
1299
* flushed before the CLOG may be updated.
1298
1300
*/
1299
- if (markXidCommitted )
1300
- TransactionIdAsyncCommitTree (xid ,nchildren ,children ,XactLastRecEnd );
1301
+ if (markXidCommitted ) {
1302
+ committed = TransactionIdAsyncCommitTree (xid ,nchildren ,children ,XactLastRecEnd );
1303
+ }
1301
1304
}
1302
1305
1303
1306
/*
@@ -1308,6 +1311,9 @@ RecordTransactionCommit(void)
1308
1311
{
1309
1312
MyPgXact -> delayChkpt = false;
1310
1313
END_CRIT_SECTION ();
1314
+ if (!committed ) {
1315
+ elog (ERROR ,"Transaction commit rejected by XTM" );
1316
+ }
1311
1317
}
1312
1318
1313
1319
/* Compute latestXid while we have the child XIDs handy */
@@ -5310,6 +5316,7 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
5310
5316
TransactionId max_xid ;
5311
5317
int i ;
5312
5318
TimestampTz commit_time ;
5319
+ bool committed ;
5313
5320
5314
5321
max_xid = TransactionIdLatest (xid ,parsed -> nsubxacts ,parsed -> subxacts );
5315
5322
@@ -5345,7 +5352,7 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
5345
5352
/*
5346
5353
* Mark the transaction committed in pg_clog.
5347
5354
*/
5348
- TransactionIdCommitTree (xid ,parsed -> nsubxacts ,parsed -> subxacts );
5355
+ committed = TransactionIdCommitTree (xid ,parsed -> nsubxacts ,parsed -> subxacts );
5349
5356
}
5350
5357
else
5351
5358
{
@@ -5369,8 +5376,8 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
5369
5376
* bits set on changes made by transactions that haven't yet
5370
5377
* recovered. It's unlikely but it's good to be safe.
5371
5378
*/
5372
- TransactionIdAsyncCommitTree (
5373
- xid ,parsed -> nsubxacts ,parsed -> subxacts ,lsn );
5379
+ committed = TransactionIdAsyncCommitTree (
5380
+ xid ,parsed -> nsubxacts ,parsed -> subxacts ,lsn );
5374
5381
5375
5382
/*
5376
5383
* We must mark clog before we update the ProcArray.
@@ -5397,7 +5404,9 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
5397
5404
*/
5398
5405
StandbyReleaseLockTree (xid ,0 ,NULL );
5399
5406
}
5400
-
5407
+ if (!committed ) {
5408
+ elog (NOTICE ,"XTM rejected recovert of tran saction %u" ,xid );
5409
+ }
5401
5410
if (parsed -> xinfo & XACT_XINFO_HAS_ORIGIN )
5402
5411
{
5403
5412
/* recover apply progress */