Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0e19f12

Browse files
committed
port xtm
1 parent 7a46164 commit 0e19f12

File tree

22 files changed

+1469
-31
lines changed

22 files changed

+1469
-31
lines changed

src/backend/access/transam/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global
1515
OBJS = clog.o commit_ts.o generic_xlog.o multixact.o parallel.o rmgr.o slru.o \
1616
subtrans.o timeline.o transam.o twophase.o twophase_rmgr.o varsup.o \
1717
xact.o xlog.o xlogarchive.o xlogfuncs.o \
18-
xloginsert.o xlogreader.o xlogutils.o
18+
xloginsert.o xlogreader.o xlogutils.o xtm.o global_snapshot.o
1919

2020
include $(top_srcdir)/src/backend/common.mk
2121

src/backend/access/transam/clog.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "access/xlog.h"
3939
#include "access/xloginsert.h"
4040
#include "access/xlogutils.h"
41+
#include "access/xtm.h"
4142
#include "miscadmin.h"
4243
#include "pg_trace.h"
4344

@@ -79,6 +80,12 @@ static SlruCtlData ClogCtlData;
7980

8081
#define ClogCtl (&ClogCtlData)
8182

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+
}
8289

8390
static int ZeroCLOGPage(int64 pageno, bool writeXlog);
8491
static void WriteZeroPageXlogRec(int64 pageno);
@@ -145,7 +152,7 @@ static void set_status_by_pages(int nsubxids, TransactionId *subxids,
145152
* cache yet.
146153
*/
147154
void
148-
TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
155+
PgTransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
149156
TransactionId *subxids, XidStatus status, XLogRecPtr lsn)
150157
{
151158
int64 pageno = TransactionIdToPage(xid); /* get page of parent */
@@ -351,10 +358,10 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i
351358
* Current state change should be from 0 or subcommitted to target state
352359
* or we should already be there when replaying changes during recovery.
353360
*/
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); */
358365

359366
/* note this assumes exclusive access to the clog page */
360367
byteval = *byteptr;
@@ -396,6 +403,12 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i
396403
*/
397404
XidStatus
398405
TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn)
406+
{
407+
return TM->GetTransactionStatus(xid, lsn);
408+
}
409+
410+
XidStatus
411+
PgTransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn)
399412
{
400413
int64 pageno = TransactionIdToPage(xid);
401414
int byteno = TransactionIdToByte(xid);

0 commit comments

Comments
 (0)