|
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(int pageno, bool writeXlog); |
84 | 91 | static bool CLOGPagePrecedes(int page1, int page2); |
@@ -146,7 +153,7 @@ static void set_status_by_pages(int nsubxids, TransactionId *subxids, |
146 | 153 | * cache yet. |
147 | 154 | */ |
148 | 155 | void |
149 | | -TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, |
| 156 | +PgTransactionIdSetTreeStatus(TransactionId xid, int nsubxids, |
150 | 157 | TransactionId *subxids, XidStatus status, XLogRecPtr lsn) |
151 | 158 | { |
152 | 159 | int pageno = TransactionIdToPage(xid); /* get page of parent */ |
@@ -352,10 +359,10 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i |
352 | 359 | * Current state change should be from 0 or subcommitted to target state |
353 | 360 | * or we should already be there when replaying changes during recovery. |
354 | 361 | */ |
355 | | - Assert(curval == 0 || |
356 | | - (curval == TRANSACTION_STATUS_SUB_COMMITTED && |
357 | | - status != TRANSACTION_STATUS_IN_PROGRESS) || |
358 | | - curval == status); |
| 362 | +/* Assert(curval == 0 || */ |
| 363 | +/* (curval == TRANSACTION_STATUS_SUB_COMMITTED && */ |
| 364 | +/* status != TRANSACTION_STATUS_IN_PROGRESS) || */ |
| 365 | +/* curval == status); */ |
359 | 366 |
|
360 | 367 | /* note this assumes exclusive access to the clog page */ |
361 | 368 | byteval = *byteptr; |
@@ -397,6 +404,12 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i |
397 | 404 | */ |
398 | 405 | XidStatus |
399 | 406 | TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn) |
| 407 | +{ |
| 408 | + return TM->GetTransactionStatus(xid, lsn); |
| 409 | +} |
| 410 | + |
| 411 | +XidStatus |
| 412 | +PgTransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn) |
400 | 413 | { |
401 | 414 | int pageno = TransactionIdToPage(xid); |
402 | 415 | int byteno = TransactionIdToByte(xid); |
|
0 commit comments