|
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 "pg_trace.h"
|
43 | 44 |
|
@@ -79,6 +80,12 @@ static SlruCtlData ClogCtlData;
|
79 | 80 |
|
80 | 81 | #define ClogCtl (&ClogCtlData)
|
81 | 82 |
|
| 83 | +void |
| 84 | +TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, |
| 85 | + TransactionId *subxids, XidStatus status, XLogRecPtr lsn) |
| 86 | +{ |
| 87 | + return TM->SetTransactionStatus(xid, nsubxids, subxids, status, lsn); |
| 88 | +} |
82 | 89 |
|
83 | 90 | static int ZeroCLOGPage(int64 pageno, bool writeXlog);
|
84 | 91 | static void WriteZeroPageXlogRec(int64 pageno);
|
@@ -145,7 +152,7 @@ static void set_status_by_pages(int nsubxids, TransactionId *subxids,
|
145 | 152 | * cache yet.
|
146 | 153 | */
|
147 | 154 | void
|
148 |
| -TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, |
| 155 | +PgTransactionIdSetTreeStatus(TransactionId xid, int nsubxids, |
149 | 156 | TransactionId *subxids, XidStatus status, XLogRecPtr lsn)
|
150 | 157 | {
|
151 | 158 | int64 pageno = TransactionIdToPage(xid); /* get page of parent */
|
@@ -351,10 +358,10 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i
|
351 | 358 | * Current state change should be from 0 or subcommitted to target state
|
352 | 359 | * or we should already be there when replaying changes during recovery.
|
353 | 360 | */
|
354 |
| - Assert(curval == 0 || |
355 |
| - (curval == TRANSACTION_STATUS_SUB_COMMITTED && |
356 |
| - status != TRANSACTION_STATUS_IN_PROGRESS) || |
357 |
| - curval == status); |
| 361 | +/* Assert(curval == 0 || */ |
| 362 | +/* (curval == TRANSACTION_STATUS_SUB_COMMITTED && */ |
| 363 | +/* status != TRANSACTION_STATUS_IN_PROGRESS) || */ |
| 364 | +/* curval == status); */ |
358 | 365 |
|
359 | 366 | /* note this assumes exclusive access to the clog page */
|
360 | 367 | byteval = *byteptr;
|
@@ -396,6 +403,12 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i
|
396 | 403 | */
|
397 | 404 | XidStatus
|
398 | 405 | TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn)
|
| 406 | +{ |
| 407 | + return TM->GetTransactionStatus(xid, lsn); |
| 408 | +} |
| 409 | + |
| 410 | +XidStatus |
| 411 | +PgTransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn) |
399 | 412 | {
|
400 | 413 | int64 pageno = TransactionIdToPage(xid);
|
401 | 414 | int byteno = TransactionIdToByte(xid);
|
|
0 commit comments