|
38 | 38 | #include "access/xlog.h" |
39 | 39 | #include "access/xloginsert.h" |
40 | 40 | #include "access/xlogutils.h" |
| 41 | +#include "access/xtm.h" |
41 | 42 | #include "miscadmin.h" |
42 | 43 | #include "pgstat.h" |
43 | 44 | #include "pg_trace.h" |
@@ -87,6 +88,12 @@ static SlruCtlData ClogCtlData; |
87 | 88 |
|
88 | 89 | #define ClogCtl (&ClogCtlData) |
89 | 90 |
|
| 91 | +void |
| 92 | +TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, |
| 93 | + TransactionId *subxids, XidStatus status, XLogRecPtr lsn) |
| 94 | +{ |
| 95 | + return TM->SetTransactionStatus(xid, nsubxids, subxids, status, lsn); |
| 96 | +} |
90 | 97 |
|
91 | 98 | static int ZeroCLOGPage(int pageno, bool writeXlog); |
92 | 99 | static bool CLOGPagePrecedes(int page1, int page2); |
@@ -160,7 +167,7 @@ static void TransactionIdSetPageStatusInternal(TransactionId xid, int nsubxids, |
160 | 167 | * cache yet. |
161 | 168 | */ |
162 | 169 | void |
163 | | -TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, |
| 170 | +PgTransactionIdSetTreeStatus(TransactionId xid, int nsubxids, |
164 | 171 | TransactionId *subxids, XidStatus status, XLogRecPtr lsn) |
165 | 172 | { |
166 | 173 | int pageno = TransactionIdToPage(xid); /* get page of parent */ |
@@ -594,10 +601,10 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i |
594 | 601 | * Current state change should be from 0 or subcommitted to target state |
595 | 602 | * or we should already be there when replaying changes during recovery. |
596 | 603 | */ |
597 | | - Assert(curval == 0 || |
598 | | - (curval == TRANSACTION_STATUS_SUB_COMMITTED && |
599 | | - status != TRANSACTION_STATUS_IN_PROGRESS) || |
600 | | - curval == status); |
| 604 | +/* Assert(curval == 0 || */ |
| 605 | +/* (curval == TRANSACTION_STATUS_SUB_COMMITTED && */ |
| 606 | +/* status != TRANSACTION_STATUS_IN_PROGRESS) || */ |
| 607 | +/* curval == status); */ |
601 | 608 |
|
602 | 609 | /* note this assumes exclusive access to the clog page */ |
603 | 610 | byteval = *byteptr; |
@@ -639,6 +646,12 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i |
639 | 646 | */ |
640 | 647 | XidStatus |
641 | 648 | TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn) |
| 649 | +{ |
| 650 | + return TM->GetTransactionStatus(xid, lsn); |
| 651 | +} |
| 652 | + |
| 653 | +XidStatus |
| 654 | +PgTransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn) |
642 | 655 | { |
643 | 656 | int pageno = TransactionIdToPage(xid); |
644 | 657 | int byteno = TransactionIdToByte(xid); |
|
0 commit comments