PostgreSQL Source Code  git master
xact.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * xact.h
4  * postgres transaction system definitions
5  *
6  *
7  * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/access/xact.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef XACT_H
15 #define XACT_H
16 
17 #include "access/transam.h"
18 #include "access/xlogreader.h"
19 #include "lib/stringinfo.h"
20 #include "nodes/pg_list.h"
21 #include "storage/relfilenode.h"
22 #include "storage/sinval.h"
23 #include "utils/datetime.h"
24 
25 /*
26  * Maximum size of Global Transaction ID (including '\0').
27  *
28  * Note that the max value of GIDSIZE must fit in the uint16 gidlen,
29  * specified in TwoPhaseFileHeader.
30  */
31 #define GIDSIZE 200
32 
33 /*
34  * Xact isolation levels
35  */
36 #define XACT_READ_UNCOMMITTED 0
37 #define XACT_READ_COMMITTED 1
38 #define XACT_REPEATABLE_READ 2
39 #define XACT_SERIALIZABLE 3
40 
41 extern int DefaultXactIsoLevel;
42 extern PGDLLIMPORT int XactIsoLevel;
43 
44 /*
45  * We implement three isolation levels internally.
46  * The two stronger ones use one snapshot per database transaction;
47  * the others use one snapshot per statement.
48  * Serializable uses predicate locks in addition to snapshots.
49  * These macros should be used to check which isolation level is selected.
50  */
51 #define IsolationUsesXactSnapshot() (XactIsoLevel >= XACT_REPEATABLE_READ)
52 #define IsolationIsSerializable() (XactIsoLevel == XACT_SERIALIZABLE)
53 
54 /* Xact read-only state */
55 extern bool DefaultXactReadOnly;
56 extern bool XactReadOnly;
57 
58 /* flag for logging statements in this transaction */
59 extern bool xact_is_sampled;
60 
61 /*
62  * Xact is deferrable -- only meaningful (currently) for read only
63  * SERIALIZABLE transactions
64  */
65 extern bool DefaultXactDeferrable;
66 extern bool XactDeferrable;
67 
68 typedef enum
69 {
70  SYNCHRONOUS_COMMIT_OFF, /* asynchronous commit */
71  SYNCHRONOUS_COMMIT_LOCAL_FLUSH, /* wait for local flush only */
72  SYNCHRONOUS_COMMIT_REMOTE_WRITE, /* wait for local flush and remote
73  * write */
74  SYNCHRONOUS_COMMIT_REMOTE_FLUSH, /* wait for local and remote flush */
75  SYNCHRONOUS_COMMIT_REMOTE_APPLY /* wait for local flush and remote apply */
77 
78 /* Define the default setting for synchronous_commit */
79 #define SYNCHRONOUS_COMMIT_ON SYNCHRONOUS_COMMIT_REMOTE_FLUSH
80 
81 /* Synchronous commit level */
82 extern int synchronous_commit;
83 
84 /*
85  * Miscellaneous flag bits to record events which occur on the top level
86  * transaction. These flags are only persisted in MyXactFlags and are intended
87  * so we remember to do certain things later in the transaction. This is
88  * globally accessible, so can be set from anywhere in the code which requires
89  * recording flags.
90  */
91 extern int MyXactFlags;
92 
93 /*
94  * XACT_FLAGS_ACCESSEDTEMPNAMESPACE - set when a temporary object is accessed.
95  * We don't allow PREPARE TRANSACTION in that case.
96  */
97 #define XACT_FLAGS_ACCESSEDTEMPNAMESPACE (1U << 0)
98 
99 /*
100  * XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK - records whether the top level xact
101  * logged any Access Exclusive Locks.
102  */
103 #define XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK (1U << 1)
104 
105 /*
106  * start- and end-of-transaction callbacks for dynamically loaded modules
107  */
108 typedef enum
109 {
118 } XactEvent;
119 
120 typedef void (*XactCallback) (XactEvent event, void *arg);
121 
122 typedef enum
123 {
128 } SubXactEvent;
129 
130 typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid,
131  SubTransactionId parentSubid, void *arg);
132 
133 
134 /* ----------------
135  * transaction-related XLOG entries
136  * ----------------
137  */
138 
139 /*
140  * XLOG allows to store some information in high 4 bits of log record xl_info
141  * field. We use 3 for the opcode, and one about an optional flag variable.
142  */
143 #define XLOG_XACT_COMMIT 0x00
144 #define XLOG_XACT_PREPARE 0x10
145 #define XLOG_XACT_ABORT 0x20
146 #define XLOG_XACT_COMMIT_PREPARED 0x30
147 #define XLOG_XACT_ABORT_PREPARED 0x40
148 #define XLOG_XACT_ASSIGNMENT 0x50
149 /* free opcode 0x60 */
150 /* free opcode 0x70 */
151 
152 /* mask for filtering opcodes out of xl_info */
153 #define XLOG_XACT_OPMASK 0x70
154 
155 /* does this record have a 'xinfo' field or not */
156 #define XLOG_XACT_HAS_INFO 0x80
157 
158 /*
159  * The following flags, stored in xinfo, determine which information is
160  * contained in commit/abort records.
161  */
162 #define XACT_XINFO_HAS_DBINFO (1U << 0)
163 #define XACT_XINFO_HAS_SUBXACTS (1U << 1)
164 #define XACT_XINFO_HAS_RELFILENODES (1U << 2)
165 #define XACT_XINFO_HAS_INVALS (1U << 3)
166 #define XACT_XINFO_HAS_TWOPHASE (1U << 4)
167 #define XACT_XINFO_HAS_ORIGIN (1U << 5)
168 #define XACT_XINFO_HAS_AE_LOCKS (1U << 6)
169 #define XACT_XINFO_HAS_GID (1U << 7)
170 
171 /*
172  * Also stored in xinfo, these indicating a variety of additional actions that
173  * need to occur when emulating transaction effects during recovery.
174  *
175  * They are named XactCompletion... to differentiate them from
176  * EOXact... routines which run at the end of the original transaction
177  * completion.
178  */
179 #define XACT_COMPLETION_APPLY_FEEDBACK (1U << 29)
180 #define XACT_COMPLETION_UPDATE_RELCACHE_FILE (1U << 30)
181 #define XACT_COMPLETION_FORCE_SYNC_COMMIT (1U << 31)
182 
183 /* Access macros for above flags */
184 #define XactCompletionApplyFeedback(xinfo) \
185  ((xinfo & XACT_COMPLETION_APPLY_FEEDBACK) != 0)
186 #define XactCompletionRelcacheInitFileInval(xinfo) \
187  ((xinfo & XACT_COMPLETION_UPDATE_RELCACHE_FILE) != 0)
188 #define XactCompletionForceSyncCommit(xinfo) \
189  ((xinfo & XACT_COMPLETION_FORCE_SYNC_COMMIT) != 0)
190 
191 typedef struct xl_xact_assignment
192 {
193  TransactionId xtop; /* assigned XID's top-level XID */
194  int nsubxacts; /* number of subtransaction XIDs */
195  TransactionId xsub[FLEXIBLE_ARRAY_MEMBER]; /* assigned subxids */
197 
198 #define MinSizeOfXactAssignment offsetof(xl_xact_assignment, xsub)
199 
200 /*
201  * Commit and abort records can contain a lot of information. But a large
202  * portion of the records won't need all possible pieces of information. So we
203  * only include what's needed.
204  *
205  * A minimal commit/abort record only consists of a xl_xact_commit/abort
206  * struct. The presence of additional information is indicated by bits set in
207  * 'xl_xact_xinfo->xinfo'. The presence of the xinfo field itself is signalled
208  * by a set XLOG_XACT_HAS_INFO bit in the xl_info field.
209  *
210  * NB: All the individual data chunks should be sized to multiples of
211  * sizeof(int) and only require int32 alignment. If they require bigger
212  * alignment, they need to be copied upon reading.
213  */
214 
215 /* sub-records for commit/abort */
216 
217 typedef struct xl_xact_xinfo
218 {
219  /*
220  * Even though we right now only require 1 byte of space in xinfo we use
221  * four so following records don't have to care about alignment. Commit
222  * records can be large, so copying large portions isn't attractive.
223  */
225 } xl_xact_xinfo;
226 
227 typedef struct xl_xact_dbinfo
228 {
229  Oid dbId; /* MyDatabaseId */
230  Oid tsId; /* MyDatabaseTableSpace */
232 
233 typedef struct xl_xact_subxacts
234 {
235  int nsubxacts; /* number of subtransaction XIDs */
236  TransactionId subxacts[FLEXIBLE_ARRAY_MEMBER];
238 #define MinSizeOfXactSubxacts offsetof(xl_xact_subxacts, subxacts)
239 
240 typedef struct xl_xact_relfilenodes
241 {
242  int nrels; /* number of relations */
243  RelFileNode xnodes[FLEXIBLE_ARRAY_MEMBER];
245 #define MinSizeOfXactRelfilenodes offsetof(xl_xact_relfilenodes, xnodes)
246 
247 typedef struct xl_xact_invals
248 {
249  int nmsgs; /* number of shared inval msgs */
250  SharedInvalidationMessage msgs[FLEXIBLE_ARRAY_MEMBER];
252 #define MinSizeOfXactInvals offsetof(xl_xact_invals, msgs)
253 
254 typedef struct xl_xact_twophase
255 {
258 
259 typedef struct xl_xact_origin
260 {
264 
265 typedef struct xl_xact_commit
266 {
267  TimestampTz xact_time; /* time of commit */
268 
269  /* xl_xact_xinfo follows if XLOG_XACT_HAS_INFO */
270  /* xl_xact_dbinfo follows if XINFO_HAS_DBINFO */
271  /* xl_xact_subxacts follows if XINFO_HAS_SUBXACT */
272  /* xl_xact_relfilenodes follows if XINFO_HAS_RELFILENODES */
273  /* xl_xact_invals follows if XINFO_HAS_INVALS */
274  /* xl_xact_twophase follows if XINFO_HAS_TWOPHASE */
275  /* twophase_gid follows if XINFO_HAS_GID. As a null-terminated string. */
276  /* xl_xact_origin follows if XINFO_HAS_ORIGIN, stored unaligned! */
278 #define MinSizeOfXactCommit (offsetof(xl_xact_commit, xact_time) + sizeof(TimestampTz))
279 
280 typedef struct xl_xact_abort
281 {
282  TimestampTz xact_time; /* time of abort */
283 
284  /* xl_xact_xinfo follows if XLOG_XACT_HAS_INFO */
285  /* xl_xact_dbinfo follows if XINFO_HAS_DBINFO */
286  /* xl_xact_subxacts follows if XINFO_HAS_SUBXACT */
287  /* xl_xact_relfilenodes follows if XINFO_HAS_RELFILENODES */
288  /* No invalidation messages needed. */
289  /* xl_xact_twophase follows if XINFO_HAS_TWOPHASE */
290  /* twophase_gid follows if XINFO_HAS_GID. As a null-terminated string. */
291  /* xl_xact_origin follows if XINFO_HAS_ORIGIN, stored unaligned! */
292 } xl_xact_abort;
293 #define MinSizeOfXactAbort sizeof(xl_xact_abort)
294 
295 typedef struct xl_xact_prepare
296 {
297  uint32 magic; /* format identifier */
298  uint32 total_len; /* actual file length */
299  TransactionId xid; /* original transaction XID */
300  Oid database; /* OID of database it was in */
301  TimestampTz prepared_at; /* time of preparation */
302  Oid owner; /* user running the transaction */
303  int32 nsubxacts; /* number of following subxact XIDs */
304  int32 ncommitrels; /* number of delete-on-commit rels */
305  int32 nabortrels; /* number of delete-on-abort rels */
306  int32 ninvalmsgs; /* number of cache invalidation messages */
307  bool initfileinval; /* does relcache init file need invalidation? */
308  uint16 gidlen; /* length of the GID - GID follows the header */
309  XLogRecPtr origin_lsn; /* lsn of this record at origin node */
310  TimestampTz origin_timestamp; /* time of prepare at origin node */
312 
313 /*
314  * Commit/Abort records in the above form are a bit verbose to parse, so
315  * there's a deconstructed versions generated by ParseCommit/AbortRecord() for
316  * easier consumption.
317  */
318 typedef struct xl_xact_parsed_commit
319 {
322 
323  Oid dbId; /* MyDatabaseId */
324  Oid tsId; /* MyDatabaseTableSpace */
325 
328 
329  int nrels;
331 
332  int nmsgs;
334 
335  TransactionId twophase_xid; /* only for 2PC */
336  char twophase_gid[GIDSIZE]; /* only for 2PC */
337  int nabortrels; /* only for 2PC */
338  RelFileNode *abortnodes; /* only for 2PC */
339 
343 
345 
346 typedef struct xl_xact_parsed_abort
347 {
350 
351  Oid dbId; /* MyDatabaseId */
352  Oid tsId; /* MyDatabaseTableSpace */
353 
356 
357  int nrels;
359 
360  TransactionId twophase_xid; /* only for 2PC */
361  char twophase_gid[GIDSIZE]; /* only for 2PC */
362 
366 
367 
368 /* ----------------
369  * extern definitions
370  * ----------------
371  */
372 extern bool IsTransactionState(void);
373 extern bool IsAbortedTransactionBlockState(void);
384 extern void MarkCurrentTransactionIdLoggedIfAny(void);
385 extern bool SubTransactionIsActive(SubTransactionId subxid);
386 extern CommandId GetCurrentCommandId(bool used);
387 extern void SetParallelStartTimestamps(TimestampTz xact_ts, TimestampTz stmt_ts);
391 extern void SetCurrentStatementStartTimestamp(void);
392 extern int GetCurrentTransactionNestLevel(void);
394 extern void CommandCounterIncrement(void);
395 extern void ForceSyncCommit(void);
396 extern void StartTransactionCommand(void);
397 extern void SaveTransactionCharacteristics(void);
398 extern void RestoreTransactionCharacteristics(void);
399 extern void CommitTransactionCommand(void);
400 extern void AbortCurrentTransaction(void);
401 extern void BeginTransactionBlock(void);
402 extern bool EndTransactionBlock(bool chain);
403 extern bool PrepareTransactionBlock(const char *gid);
404 extern void UserAbortTransactionBlock(bool chain);
405 extern void BeginImplicitTransactionBlock(void);
406 extern void EndImplicitTransactionBlock(void);
407 extern void ReleaseSavepoint(const char *name);
408 extern void DefineSavepoint(const char *name);
409 extern void RollbackToSavepoint(const char *name);
410 extern void BeginInternalSubTransaction(const char *name);
411 extern void ReleaseCurrentSubTransaction(void);
413 extern bool IsSubTransaction(void);
415 extern void SerializeTransactionState(Size maxsize, char *start_address);
416 extern void StartParallelWorkerTransaction(char *tstatespace);
417 extern void EndParallelWorkerTransaction(void);
418 extern bool IsTransactionBlock(void);
419 extern bool IsTransactionOrTransactionBlock(void);
420 extern char TransactionBlockStatusCode(void);
421 extern void AbortOutOfAnyTransaction(void);
422 extern void PreventInTransactionBlock(bool isTopLevel, const char *stmtType);
423 extern void RequireTransactionBlock(bool isTopLevel, const char *stmtType);
424 extern void WarnNoTransactionBlock(bool isTopLevel, const char *stmtType);
425 extern bool IsInTransactionBlock(bool isTopLevel);
426 extern void RegisterXactCallback(XactCallback callback, void *arg);
427 extern void UnregisterXactCallback(XactCallback callback, void *arg);
430 
431 extern int xactGetCommittedChildren(TransactionId **ptr);
432 
433 extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
434  int nsubxacts, TransactionId *subxacts,
435  int nrels, RelFileNode *rels,
436  int nmsgs, SharedInvalidationMessage *msgs,
437  bool relcacheInval, bool forceSync,
438  int xactflags,
439  TransactionId twophase_xid,
440  const char *twophase_gid);
441 
442 extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,
443  int nsubxacts, TransactionId *subxacts,
444  int nrels, RelFileNode *rels,
445  int xactflags, TransactionId twophase_xid,
446  const char *twophase_gid);
447 extern void xact_redo(XLogReaderState *record);
448 
449 /* xactdesc.c */
450 extern void xact_desc(StringInfo buf, XLogReaderState *record);
451 extern const char *xact_identify(uint8 info);
452 
453 /* also in xactdesc.c, so they can be shared between front/backend code */
454 extern void ParseCommitRecord(uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *parsed);
455 extern void ParseAbortRecord(uint8 info, xl_xact_abort *xlrec, xl_xact_parsed_abort *parsed);
456 extern void ParsePrepareRecord(uint8 info, xl_xact_prepare *xlrec, xl_xact_parsed_prepare *parsed);
457 
458 extern void EnterParallelMode(void);
459 extern void ExitParallelMode(void);
460 extern bool IsInParallelMode(void);
461 
462 #endif /* XACT_H */
bool IsTransactionOrTransactionBlock(void)
Definition: xact.c:4653
void EnterParallelMode(void)
Definition: xact.c:963
RelFileNode * xnodes
Definition: xact.h:330
int32 ninvalmsgs
Definition: xact.h:306
void UnregisterSubXactCallback(SubXactCallback callback, void *arg)
Definition: xact.c:3547
struct xl_xact_parsed_commit xl_xact_parsed_commit
uint32 CommandId
Definition: c.h:528
void EndImplicitTransactionBlock(void)
Definition: xact.c:4016
XactEvent
Definition: xact.h:108
const char * xact_identify(uint8 info)
Definition: xactdesc.c:403
void SaveTransactionCharacteristics(void)
Definition: xact.c:2878
struct xl_xact_parsed_abort xl_xact_parsed_abort
void AbortOutOfAnyTransaction(void)
Definition: xact.c:4531
int32 nsubxacts
Definition: xact.h:303
struct xl_xact_xinfo xl_xact_xinfo
FullTransactionId GetTopFullTransactionId(void)
Definition: xact.c:451
void PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
Definition: xact.c:3331
int GetCurrentTransactionNestLevel(void)
Definition: xact.c:841
uint32 TransactionId
Definition: c.h:514
int32 ncommitrels
Definition: xact.h:304
TransactionId GetTopTransactionIdIfAny(void)
Definition: xact.c:409
TimestampTz origin_timestamp
Definition: xact.h:341
bool IsTransactionBlock(void)
Definition: xact.c:4635
TimestampTz GetCurrentTransactionStopTimestamp(void)
Definition: xact.c:803
void ParseCommitRecord(uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *parsed)
Definition: xactdesc.c:34
void UserAbortTransactionBlock(bool chain)
Definition: xact.c:3869
void StartTransactionCommand(void)
Definition: xact.c:2797
void BeginInternalSubTransaction(const char *name)
Definition: xact.c:4359
int64 TimestampTz
Definition: timestamp.h:39
void(* SubXactCallback)(SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg)
Definition: xact.h:130
XLogRecPtr XactLogCommitRecord(TimestampTz commit_time, int nsubxacts, TransactionId *subxacts, int nrels, RelFileNode *rels, int nmsgs, SharedInvalidationMessage *msgs, bool relcacheInval, bool forceSync, int xactflags, TransactionId twophase_xid, const char *twophase_gid)
Definition: xact.c:5445
TransactionId xid
Definition: xact.h:256
TransactionId twophase_xid
Definition: xact.h:335
PGDLLIMPORT int XactIsoLevel
Definition: xact.c:74
unsigned char uint8
Definition: c.h:357
TransactionId * subxacts
Definition: xact.h:327
SharedInvalidationMessage * msgs
Definition: xact.h:333
TransactionId GetCurrentTransactionId(void)
Definition: xact.c:422
void ReleaseSavepoint(const char *name)
Definition: xact.c:4123
TransactionId xtop
Definition: xact.h:193
void SetParallelStartTimestamps(TimestampTz xact_ts, TimestampTz stmt_ts)
Definition: xact.c:771
XLogRecPtr origin_lsn
Definition: xact.h:340
uint16 gidlen
Definition: xact.h:308
TransactionId xsub[FLEXIBLE_ARRAY_MEMBER]
Definition: xact.h:195
void BeginImplicitTransactionBlock(void)
Definition: xact.c:3991
struct xl_xact_prepare xl_xact_prepare
FullTransactionId GetCurrentFullTransactionIdIfAny(void)
Definition: xact.c:498
uint32 SubTransactionId
Definition: c.h:518
struct xl_xact_dbinfo xl_xact_dbinfo
void ParseAbortRecord(uint8 info, xl_xact_abort *xlrec, xl_xact_parsed_abort *parsed)
Definition: xactdesc.c:129
unsigned int Oid
Definition: postgres_ext.h:31
bool XactReadOnly
Definition: xact.c:77
bool XactDeferrable
Definition: xact.c:80
TimestampTz xact_time
Definition: xact.h:282
Oid tsId
Definition: xact.h:230
Oid database
Definition: xact.h:300
struct xl_xact_origin xl_xact_origin
void StartParallelWorkerTransaction(char *tstatespace)
Definition: xact.c:5250
SubTransactionId GetCurrentSubTransactionId(void)
Definition: xact.c:707
xl_xact_parsed_commit xl_xact_parsed_prepare
Definition: xact.h:344
#define PGDLLIMPORT
Definition: c.h:1272
signed int int32
Definition: c.h:347
int synchronous_commit
Definition: xact.c:82
void ParsePrepareRecord(uint8 info, xl_xact_prepare *xlrec, xl_xact_parsed_prepare *parsed)
Definition: xactdesc.c:216
void(* XactCallback)(XactEvent event, void *arg)
Definition: xact.h:120
int32 nabortrels
Definition: xact.h:305
int MyXactFlags
Definition: xact.c:118
void BeginTransactionBlock(void)
Definition: xact.c:3589
unsigned short uint16
Definition: c.h:358
void CommandCounterIncrement(void)
Definition: xact.c:1005
void MarkCurrentTransactionIdLoggedIfAny(void)
Definition: xact.c:509
bool IsSubTransaction(void)
Definition: xact.c:4708
bool IsAbortedTransactionBlockState(void)
Definition: xact.c:375
bool SubTransactionIsActive(SubTransactionId subxid)
Definition: xact.c:721
void SetCurrentStatementStartTimestamp(void)
Definition: xact.c:817
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:48
#define GIDSIZE
Definition: xact.h:31
void AbortCurrentTransaction(void)
Definition: xact.c:3162
bool DefaultXactReadOnly
Definition: xact.c:76
static char * buf
Definition: pg_test_fsync.c:67
TimestampTz xact_time
Definition: xact.h:267
XLogRecPtr origin_lsn
Definition: xact.h:309
bool EndTransactionBlock(bool chain)
Definition: xact.c:3709
struct xl_xact_commit xl_xact_commit
Size EstimateTransactionStateSpace(void)
Definition: xact.c:5152
void RegisterXactCallback(XactCallback callback, void *arg)
Definition: xact.c:3479
uint32 total_len
Definition: xact.h:298
struct xl_xact_twophase xl_xact_twophase
unsigned int uint32
Definition: c.h:359
void RestoreTransactionCharacteristics(void)
Definition: xact.c:2886
void RequireTransactionBlock(bool isTopLevel, const char *stmtType)
Definition: xact.c:3397
XLogRecPtr origin_lsn
Definition: xact.h:261
TransactionId * subxacts
Definition: xact.h:355
struct xl_xact_invals xl_xact_invals
bool DefaultXactDeferrable
Definition: xact.c:79
void ReleaseCurrentSubTransaction(void)
Definition: xact.c:4430
struct xl_xact_abort xl_xact_abort
void UnregisterXactCallback(XactCallback callback, void *arg)
Definition: xact.c:3492
void DefineSavepoint(const char *name)
Definition: xact.c:4038
SubXactEvent
Definition: xact.h:122
void xact_desc(StringInfo buf, XLogReaderState *record)
Definition: xactdesc.c:364
int xactGetCommittedChildren(TransactionId **ptr)
Definition: xact.c:5421
void ForceSyncCommit(void)
Definition: xact.c:1053
uint32 xinfo
Definition: xact.h:224
XLogRecPtr origin_lsn
Definition: xact.h:363
bool PrepareTransactionBlock(const char *gid)
Definition: xact.c:3657
RelFileNode * xnodes
Definition: xact.h:358
int nsubxacts
Definition: xact.h:235
int DefaultXactIsoLevel
Definition: xact.c:73
void ExitParallelMode(void)
Definition: xact.c:976
SyncCommitLevel
Definition: xact.h:68
CommandId GetCurrentCommandId(bool used)
Definition: xact.c:745
void SerializeTransactionState(Size maxsize, char *start_address)
Definition: xact.c:5180
Oid dbId
Definition: xact.h:229
TransactionId twophase_xid
Definition: xact.h:360
struct xl_xact_assignment xl_xact_assignment
bool initfileinval
Definition: xact.h:307
void RollbackAndReleaseCurrentSubTransaction(void)
Definition: xact.c:4464
XLogRecPtr XactLogAbortRecord(TimestampTz abort_time, int nsubxacts, TransactionId *subxacts, int nrels, RelFileNode *rels, int xactflags, TransactionId twophase_xid, const char *twophase_gid)
Definition: xact.c:5600
RelFileNode * abortnodes
Definition: xact.h:338
bool TransactionIdIsCurrentTransactionId(TransactionId xid)
Definition: xact.c:853
uint64 XLogRecPtr
Definition: xlogdefs.h:21
void WarnNoTransactionBlock(bool isTopLevel, const char *stmtType)
Definition: xact.c:3391
TransactionId GetCurrentTransactionIdIfAny(void)
Definition: xact.c:439
TimestampTz origin_timestamp
Definition: xact.h:310
struct xl_xact_subxacts xl_xact_subxacts
TimestampTz GetCurrentStatementStartTimestamp(void)
Definition: xact.c:791
size_t Size
Definition: c.h:467
void CommitTransactionCommand(void)
Definition: xact.c:2898
FullTransactionId GetCurrentFullTransactionId(void)
Definition: xact.c:480
TimestampTz xact_time
Definition: xact.h:348
const char * name
Definition: encode.c:521
TransactionId xid
Definition: xact.h:299
bool IsInTransactionBlock(bool isTopLevel)
Definition: xact.c:3444
TimestampTz origin_timestamp
Definition: xact.h:262
struct xl_xact_relfilenodes xl_xact_relfilenodes
uint32 magic
Definition: xact.h:297
FullTransactionId GetTopFullTransactionIdIfAny(void)
Definition: xact.c:467
TransactionId GetTopTransactionId(void)
Definition: xact.c:394
void RegisterSubXactCallback(SubXactCallback callback, void *arg)
Definition: xact.c:3534
char TransactionBlockStatusCode(void)
Definition: xact.c:4667
void * arg
TimestampTz prepared_at
Definition: xact.h:301
void RollbackToSavepoint(const char *name)
Definition: xact.c:4232
TimestampTz origin_timestamp
Definition: xact.h:364
void EndParallelWorkerTransaction(void)
Definition: xact.c:5275
int nmsgs
Definition: xact.h:249
bool IsInParallelMode(void)
Definition: xact.c:996
void xact_redo(XLogReaderState *record)
Definition: xact.c:5930
bool xact_is_sampled
Definition: xact.c:267
TimestampTz GetCurrentTransactionStartTimestamp(void)
Definition: xact.c:782
TimestampTz xact_time
Definition: xact.h:320
TransactionId GetStableLatestTransactionId(void)
Definition: xact.c:525
bool IsTransactionState(void)
Definition: xact.c:355