PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
twophase.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * twophase.h
4  * Two-phase-commit related declarations.
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/access/twophase.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TWOPHASE_H
15 #define TWOPHASE_H
16 
17 #include "access/xlogdefs.h"
18 #include "datatype/timestamp.h"
19 #include "storage/lock.h"
20 
21 /*
22  * GlobalTransactionData is defined in twophase.c; other places have no
23  * business knowing the internal definition.
24  */
26 
27 /* GUC variable */
28 extern int max_prepared_xacts;
29 
30 extern Size TwoPhaseShmemSize(void);
31 extern void TwoPhaseShmemInit(void);
32 
33 extern void AtAbort_Twophase(void);
34 extern void PostPrepare_Twophase(void);
35 
38 
39 extern GlobalTransaction MarkAsPreparing(TransactionId xid, const char *gid,
41  Oid owner, Oid databaseid);
42 
43 extern void StartPrepare(GlobalTransaction gxact);
44 extern void EndPrepare(GlobalTransaction gxact);
46 
48  int *nxids_p);
49 extern void StandbyRecoverPreparedTransactions(bool overwriteOK);
50 extern void RecoverPreparedTransactions(void);
51 
52 extern void RecreateTwoPhaseFile(TransactionId xid, void *content, int len);
53 extern void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning);
54 
55 extern void CheckPointTwoPhase(XLogRecPtr redo_horizon);
56 
57 extern void FinishPreparedTransaction(const char *gid, bool isCommit);
58 
59 #endif /* TWOPHASE_H */
void AtAbort_Twophase(void)
Definition: twophase.c:287
void PostPrepare_Twophase(void)
Definition: twophase.c:332
void FinishPreparedTransaction(const char *gid, bool isCommit)
Definition: twophase.c:1325
uint32 TransactionId
Definition: c.h:397
void EndPrepare(GlobalTransaction gxact)
Definition: twophase.c:1020
int64 TimestampTz
Definition: timestamp.h:39
struct GlobalTransactionData * GlobalTransaction
Definition: twophase.h:25
unsigned int Oid
Definition: postgres_ext.h:31
void CheckPointTwoPhase(XLogRecPtr redo_horizon)
Definition: twophase.c:1605
char gid[GIDSIZE]
Definition: twophase.c:155
void TwoPhaseShmemInit(void)
Definition: twophase.c:222
PGPROC * TwoPhaseGetDummyProc(TransactionId xid)
Definition: twophase.c:824
void StartPrepare(GlobalTransaction gxact)
Definition: twophase.c:947
void RecreateTwoPhaseFile(TransactionId xid, void *content, int len)
Definition: twophase.c:1525
GlobalTransaction MarkAsPreparing(TransactionId xid, const char *gid, TimestampTz prepared_at, Oid owner, Oid databaseid)
Definition: twophase.c:351
int BackendId
Definition: backendid.h:21
void RecoverPreparedTransactions(void)
Definition: twophase.c:1915
uint64 XLogRecPtr
Definition: xlogdefs.h:21
BackendId TwoPhaseGetDummyBackendId(TransactionId xid)
Definition: twophase.c:812
size_t Size
Definition: c.h:356
TimestampTz prepared_at
Definition: twophase.c:139
bool StandbyTransactionIdIsPrepared(TransactionId xid)
Definition: twophase.c:1297
Definition: proc.h:89
TransactionId PrescanPreparedTransactions(TransactionId **xids_p, int *nxids_p)
Definition: twophase.c:1693
void StandbyRecoverPreparedTransactions(bool overwriteOK)
Definition: twophase.c:1834
Size TwoPhaseShmemSize(void)
Definition: twophase.c:206
void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning)
Definition: twophase.c:1505
int max_prepared_xacts
Definition: twophase.c:98