diff options
Diffstat (limited to 'src/backend/access/transam')
-rw-r--r-- | src/backend/access/transam/twophase.c | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index 712e842b904..b3ad0d08e30 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -910,23 +910,7 @@ TwoPhaseGetDummyProc(TransactionId xid, bool lock_held) */ #define TWOPHASE_MAGIC 0x57F94534 /* format identifier */ -typedef struct TwoPhaseFileHeader -{ - uint32 magic; /* format identifier */ - uint32 total_len; /* actual file length */ - TransactionId xid; /* original transaction XID */ - Oid database; /* OID of database it was in */ - TimestampTz prepared_at; /* time of preparation */ - Oid owner; /* user running the transaction */ - int32 nsubxacts; /* number of following subxact XIDs */ - int32 ncommitrels; /* number of delete-on-commit rels */ - int32 nabortrels; /* number of delete-on-abort rels */ - int32 ninvalmsgs; /* number of cache invalidation messages */ - bool initfileinval; /* does relcache init file need invalidation? */ - uint16 gidlen; /* length of the GID - GID follows the header */ - XLogRecPtr origin_lsn; /* lsn of this record at origin node */ - TimestampTz origin_timestamp; /* time of prepare at origin node */ -} TwoPhaseFileHeader; +typedef xl_xact_prepare TwoPhaseFileHeader; /* * Header for each record in a state file @@ -1331,44 +1315,6 @@ ReadTwoPhaseFile(TransactionId xid, bool missing_ok) return buf; } -/* - * ParsePrepareRecord - */ -void -ParsePrepareRecord(uint8 info, char *xlrec, xl_xact_parsed_prepare *parsed) -{ - TwoPhaseFileHeader *hdr; - char *bufptr; - - hdr = (TwoPhaseFileHeader *) xlrec; - bufptr = xlrec + MAXALIGN(sizeof(TwoPhaseFileHeader)); - - parsed->origin_lsn = hdr->origin_lsn; - parsed->origin_timestamp = hdr->origin_timestamp; - parsed->twophase_xid = hdr->xid; - parsed->dbId = hdr->database; - parsed->nsubxacts = hdr->nsubxacts; - parsed->nrels = hdr->ncommitrels; - parsed->nabortrels = hdr->nabortrels; - parsed->nmsgs = hdr->ninvalmsgs; - - strncpy(parsed->twophase_gid, bufptr, hdr->gidlen); - bufptr += MAXALIGN(hdr->gidlen); - - parsed->subxacts = (TransactionId *) bufptr; - bufptr += MAXALIGN(hdr->nsubxacts * sizeof(TransactionId)); - - parsed->xnodes = (RelFileNode *) bufptr; - bufptr += MAXALIGN(hdr->ncommitrels * sizeof(RelFileNode)); - - parsed->abortnodes = (RelFileNode *) bufptr; - bufptr += MAXALIGN(hdr->nabortrels * sizeof(RelFileNode)); - - parsed->msgs = (SharedInvalidationMessage *) bufptr; - bufptr += MAXALIGN(hdr->ninvalmsgs * sizeof(SharedInvalidationMessage)); -} - - /* * Reads 2PC data from xlog. During checkpoint this data will be moved to |