PostgreSQL Source Code  git master
reorderbuffer.h
Go to the documentation of this file.
1 /*
2  * reorderbuffer.h
3  * PostgreSQL logical replay/reorder buffer management.
4  *
5  * Copyright (c) 2012-2021, PostgreSQL Global Development Group
6  *
7  * src/include/replication/reorderbuffer.h
8  */
9 #ifndef REORDERBUFFER_H
10 #define REORDERBUFFER_H
11 
12 #include "access/htup_details.h"
13 #include "lib/ilist.h"
14 #include "storage/sinval.h"
15 #include "utils/hsearch.h"
16 #include "utils/relcache.h"
17 #include "utils/snapshot.h"
18 #include "utils/timestamp.h"
19 
21 
22 /* an individual tuple, stored in one chunk of memory */
23 typedef struct ReorderBufferTupleBuf
24 {
25  /* position in preallocated list */
27 
28  /* tuple header, the interesting bit for users of logical decoding */
30 
31  /* pre-allocated size of tuple buffer, different from tuple size */
33 
34  /* actual tuple data follows */
36 
37 /* pointer to the data stored in a TupleBuf */
38 #define ReorderBufferTupleBufData(p) \
39  ((HeapTupleHeader) MAXALIGN(((char *) p) + sizeof(ReorderBufferTupleBuf)))
40 
41 /*
42  * Types of the change passed to a 'change' callback.
43  *
44  * For efficiency and simplicity reasons we want to keep Snapshots, CommandIds
45  * and ComboCids in the same list with the user visible INSERT/UPDATE/DELETE
46  * changes. Users of the decoding facilities will never see changes with
47  * *_INTERNAL_* actions.
48  *
49  * The INTERNAL_SPEC_INSERT and INTERNAL_SPEC_CONFIRM, and INTERNAL_SPEC_ABORT
50  * changes concern "speculative insertions", their confirmation, and abort
51  * respectively. They're used by INSERT .. ON CONFLICT .. UPDATE. Users of
52  * logical decoding don't have to care about these.
53  */
55 {
68 };
69 
70 /* forward declaration */
71 struct ReorderBufferTXN;
72 
73 /*
74  * a single 'change', can be an insert (with one tuple), an update (old, new),
75  * or a delete (old).
76  *
77  * The same struct is also used internally for other purposes but that should
78  * never be visible outside reorderbuffer.c.
79  */
80 typedef struct ReorderBufferChange
81 {
83 
84  /* The type of change. */
86 
87  /* Transaction this change belongs to. */
89 
91 
92  /*
93  * Context data for the change. Which part of the union is valid depends
94  * on action.
95  */
96  union
97  {
98  /* Old, new tuples when action == *_INSERT|UPDATE|DELETE */
99  struct
100  {
101  /* relation that has been changed */
103 
104  /* no previously reassembled toast chunks are necessary anymore */
106 
107  /* valid for DELETE || UPDATE */
109  /* valid for INSERT || UPDATE */
111  } tp;
112 
113  /*
114  * Truncate data for REORDER_BUFFER_CHANGE_TRUNCATE representing one
115  * set of relations to be truncated.
116  */
117  struct
118  {
120  bool cascade;
123  } truncate;
124 
125  /* Message with arbitrary data. */
126  struct
127  {
128  char *prefix;
130  char *message;
131  } msg;
132 
133  /* New snapshot, set when action == *_INTERNAL_SNAPSHOT */
135 
136  /*
137  * New command id for existing snapshot in a catalog changing tx. Set
138  * when action == *_INTERNAL_COMMAND_ID.
139  */
141 
142  /*
143  * New cid mapping for catalog changing transaction, set when action
144  * == *_INTERNAL_TUPLECID.
145  */
146  struct
147  {
153  } tuplecid;
154 
155  /* Invalidation. */
156  struct
157  {
158  uint32 ninvalidations; /* Number of messages */
159  SharedInvalidationMessage *invalidations; /* invalidation message */
160  } inval;
161  } data;
162 
163  /*
164  * While in use this is how a change is linked into a transactions,
165  * otherwise it's the preallocated list.
166  */
169 
170 /* ReorderBufferTXN txn_flags */
171 #define RBTXN_HAS_CATALOG_CHANGES 0x0001
172 #define RBTXN_IS_SUBXACT 0x0002
173 #define RBTXN_IS_SERIALIZED 0x0004
174 #define RBTXN_IS_SERIALIZED_CLEAR 0x0008
175 #define RBTXN_IS_STREAMED 0x0010
176 #define RBTXN_HAS_PARTIAL_CHANGE 0x0020
177 #define RBTXN_PREPARE 0x0040
178 #define RBTXN_SKIPPED_PREPARE 0x0080
179 
180 /* Does the transaction have catalog changes? */
181 #define rbtxn_has_catalog_changes(txn) \
182 ( \
183  ((txn)->txn_flags & RBTXN_HAS_CATALOG_CHANGES) != 0 \
184 )
185 
186 /* Is the transaction known as a subxact? */
187 #define rbtxn_is_known_subxact(txn) \
188 ( \
189  ((txn)->txn_flags & RBTXN_IS_SUBXACT) != 0 \
190 )
191 
192 /* Has this transaction been spilled to disk? */
193 #define rbtxn_is_serialized(txn) \
194 ( \
195  ((txn)->txn_flags & RBTXN_IS_SERIALIZED) != 0 \
196 )
197 
198 /* Has this transaction ever been spilled to disk? */
199 #define rbtxn_is_serialized_clear(txn) \
200 ( \
201  ((txn)->txn_flags & RBTXN_IS_SERIALIZED_CLEAR) != 0 \
202 )
203 
204 /* Has this transaction contains partial changes? */
205 #define rbtxn_has_partial_change(txn) \
206 ( \
207  ((txn)->txn_flags & RBTXN_HAS_PARTIAL_CHANGE) != 0 \
208 )
209 
210 /*
211  * Has this transaction been streamed to downstream?
212  *
213  * (It's not possible to deduce this from nentries and nentries_mem for
214  * various reasons. For example, all changes may be in subtransactions in
215  * which case we'd have nentries==0 for the toplevel one, which would say
216  * nothing about the streaming. So we maintain this flag, but only for the
217  * toplevel transaction.)
218  */
219 #define rbtxn_is_streamed(txn) \
220 ( \
221  ((txn)->txn_flags & RBTXN_IS_STREAMED) != 0 \
222 )
223 
224 /* Has this transaction been prepared? */
225 #define rbtxn_prepared(txn) \
226 ( \
227  ((txn)->txn_flags & RBTXN_PREPARE) != 0 \
228 )
229 
230 /* prepare for this transaction skipped? */
231 #define rbtxn_skip_prepared(txn) \
232 ( \
233  ((txn)->txn_flags & RBTXN_SKIPPED_PREPARE) != 0 \
234 )
235 
236 typedef struct ReorderBufferTXN
237 {
238  /* See above */
240 
241  /* The transaction's transaction id, can be a toplevel or sub xid. */
243 
244  /* Xid of top-level transaction, if known */
246 
247  /*
248  * Global transaction id required for identification of prepared
249  * transactions.
250  */
251  char *gid;
252 
253  /*
254  * LSN of the first data carrying, WAL record with knowledge about this
255  * xid. This is allowed to *not* be first record adorned with this xid, if
256  * the previous records aren't relevant for logical decoding.
257  */
259 
260  /* ----
261  * LSN of the record that lead to this xact to be prepared or committed or
262  * aborted. This can be a
263  * * plain commit record
264  * * plain commit record, of a parent transaction
265  * * prepared tansaction
266  * * prepared transaction commit
267  * * plain abort record
268  * * prepared transaction abort
269  *
270  * This can also become set to earlier values than transaction end when
271  * a transaction is spilled to disk; specifically it's set to the LSN of
272  * the latest change written to disk so far.
273  * ----
274  */
276 
277  /*
278  * LSN pointing to the end of the commit record + 1.
279  */
281 
282  /* Toplevel transaction for this subxact (NULL for top-level). */
284 
285  /*
286  * LSN of the last lsn at which snapshot information reside, so we can
287  * restart decoding from there and fully recover this transaction from
288  * WAL.
289  */
291 
292  /* origin of the change that caused this transaction */
295 
296  /*
297  * Commit or Prepare time, only known when we read the actual commit or
298  * prepare record.
299  */
300  union
301  {
304  } xact_time;
305 
306  /*
307  * The base snapshot is used to decode all changes until either this
308  * transaction modifies the catalog, or another catalog-modifying
309  * transaction commits.
310  */
313  dlist_node base_snapshot_node; /* link in txns_by_base_snapshot_lsn */
314 
315  /*
316  * Snapshot/CID from the previous streaming run. Only valid for already
317  * streamed transactions (NULL/InvalidCommandId otherwise).
318  */
321 
322  /*
323  * How many ReorderBufferChange's do we have in this txn.
324  *
325  * Changes in subtransactions are *not* included but tracked separately.
326  */
327  uint64 nentries;
328 
329  /*
330  * How many of the above entries are stored in memory in contrast to being
331  * spilled to disk.
332  */
333  uint64 nentries_mem;
334 
335  /*
336  * List of ReorderBufferChange structs, including new Snapshots, new
337  * CommandIds and command invalidation messages.
338  */
340 
341  /*
342  * List of (relation, ctid) => (cmin, cmax) mappings for catalog tuples.
343  * Those are always assigned to the toplevel transaction. (Keep track of
344  * #entries to create a hash of the right size)
345  */
347  uint64 ntuplecids;
348 
349  /*
350  * On-demand built hash for looking up the above values.
351  */
353 
354  /*
355  * Hash containing (potentially partial) toast entries. NULL if no toast
356  * tuples have been found for the current change.
357  */
359 
360  /*
361  * non-hierarchical list of subtransactions that are *not* aborted. Only
362  * used in toplevel transactions.
363  */
366 
367  /*
368  * Stored cache invalidations. This is not a linked list because we get
369  * all the invalidations at once.
370  */
373 
374  /* ---
375  * Position in one of three lists:
376  * * list of subtransactions if we are *known* to be subxact
377  * * list of toplevel xacts (can be an as-yet unknown subxact)
378  * * list of preallocated ReorderBufferTXNs (if unused)
379  * ---
380  */
382 
383  /*
384  * Size of this transaction (changes currently in memory, in bytes).
385  */
387 
388  /* Size of top-transaction including sub-transactions. */
390 
391  /* If we have detected concurrent abort then ignore future changes. */
393 
394  /*
395  * Private data pointer of the output plugin.
396  */
399 
400 /* so we can define the callbacks used inside struct ReorderBuffer itself */
402 
403 /* change callback signature */
405  ReorderBufferTXN *txn,
406  Relation relation,
407  ReorderBufferChange *change);
408 
409 /* truncate callback signature */
411  ReorderBufferTXN *txn,
412  int nrelations,
413  Relation relations[],
414  ReorderBufferChange *change);
415 
416 /* begin callback signature */
417 typedef void (*ReorderBufferBeginCB) (ReorderBuffer *rb,
418  ReorderBufferTXN *txn);
419 
420 /* commit callback signature */
422  ReorderBufferTXN *txn,
423  XLogRecPtr commit_lsn);
424 
425 /* message callback signature */
427  ReorderBufferTXN *txn,
428  XLogRecPtr message_lsn,
429  bool transactional,
430  const char *prefix, Size sz,
431  const char *message);
432 
433 /* begin prepare callback signature */
435  ReorderBufferTXN *txn);
436 
437 /* prepare callback signature */
439  ReorderBufferTXN *txn,
440  XLogRecPtr prepare_lsn);
441 
442 /* commit prepared callback signature */
444  ReorderBufferTXN *txn,
445  XLogRecPtr commit_lsn);
446 
447 /* rollback prepared callback signature */
449  ReorderBufferTXN *txn,
450  XLogRecPtr prepare_end_lsn,
451  TimestampTz prepare_time);
452 
453 /* start streaming transaction callback signature */
454 typedef void (*ReorderBufferStreamStartCB) (
455  ReorderBuffer *rb,
456  ReorderBufferTXN *txn,
457  XLogRecPtr first_lsn);
458 
459 /* stop streaming transaction callback signature */
460 typedef void (*ReorderBufferStreamStopCB) (
461  ReorderBuffer *rb,
462  ReorderBufferTXN *txn,
463  XLogRecPtr last_lsn);
464 
465 /* discard streamed transaction callback signature */
466 typedef void (*ReorderBufferStreamAbortCB) (
467  ReorderBuffer *rb,
468  ReorderBufferTXN *txn,
469  XLogRecPtr abort_lsn);
470 
471 /* prepare streamed transaction callback signature */
473  ReorderBuffer *rb,
474  ReorderBufferTXN *txn,
475  XLogRecPtr prepare_lsn);
476 
477 /* commit streamed transaction callback signature */
479  ReorderBuffer *rb,
480  ReorderBufferTXN *txn,
481  XLogRecPtr commit_lsn);
482 
483 /* stream change callback signature */
485  ReorderBuffer *rb,
486  ReorderBufferTXN *txn,
487  Relation relation,
488  ReorderBufferChange *change);
489 
490 /* stream message callback signature */
492  ReorderBuffer *rb,
493  ReorderBufferTXN *txn,
494  XLogRecPtr message_lsn,
495  bool transactional,
496  const char *prefix, Size sz,
497  const char *message);
498 
499 /* stream truncate callback signature */
501  ReorderBuffer *rb,
502  ReorderBufferTXN *txn,
503  int nrelations,
504  Relation relations[],
505  ReorderBufferChange *change);
506 
508 {
509  /*
510  * xid => ReorderBufferTXN lookup table
511  */
513 
514  /*
515  * Transactions that could be a toplevel xact, ordered by LSN of the first
516  * record bearing that xid.
517  */
519 
520  /*
521  * Transactions and subtransactions that have a base snapshot, ordered by
522  * LSN of the record which caused us to first obtain the base snapshot.
523  * This is not the same as toplevel_by_lsn, because we only set the base
524  * snapshot on the first logical-decoding-relevant record (eg. heap
525  * writes), whereas the initial LSN could be set by other operations.
526  */
528 
529  /*
530  * one-entry sized cache for by_txn. Very frequently the same txn gets
531  * looked up over and over again.
532  */
535 
536  /*
537  * Callbacks to be called when a transactions commits.
538  */
544 
545  /*
546  * Callbacks to be called when streaming a transaction at prepare time.
547  */
552 
553  /*
554  * Callbacks to be called when streaming a transaction.
555  */
564 
565  /*
566  * Pointer that will be passed untouched to the callbacks.
567  */
569 
570  /*
571  * Saved output plugin option
572  */
574 
575  /*
576  * Private memory context.
577  */
579 
580  /*
581  * Memory contexts for specific types objects
582  */
586 
588 
589  /* buffer for disk<->memory conversions */
590  char *outbuf;
592 
593  /* memory accounting */
595 
596  /*
597  * Statistics about transactions spilled to disk.
598  *
599  * A single transaction may be spilled repeatedly, which is why we keep
600  * two different counters. For spilling, the transaction counter includes
601  * both toplevel transactions and subtransactions.
602  */
603  int64 spillTxns; /* number of transactions spilled to disk */
604  int64 spillCount; /* spill-to-disk invocation counter */
605  int64 spillBytes; /* amount of data spilled to disk */
606 
607  /* Statistics about transactions streamed to the decoding output plugin */
608  int64 streamTxns; /* number of transactions streamed */
609  int64 streamCount; /* streaming invocation counter */
610  int64 streamBytes; /* amount of data decoded */
611 
612  /*
613  * Statistics about all the transactions sent to the decoding output
614  * plugin
615  */
616  int64 totalTxns; /* total number of transactions sent */
617  int64 totalBytes; /* total amount of data decoded */
618 };
619 
620 
623 
628 
629 Oid *ReorderBufferGetRelids(ReorderBuffer *, int nrelids);
631 
634  bool toast_insert);
636  bool transactional, const char *prefix,
637  Size message_size, const char *message);
639  XLogRecPtr commit_lsn, XLogRecPtr end_lsn,
640  TimestampTz commit_time, RepOriginId origin_id, XLogRecPtr origin_lsn);
642  XLogRecPtr commit_lsn, XLogRecPtr end_lsn,
643  XLogRecPtr two_phase_at,
644  TimestampTz commit_time,
645  RepOriginId origin_id, XLogRecPtr origin_lsn,
646  char *gid, bool is_commit);
649  XLogRecPtr commit_lsn, XLogRecPtr end_lsn);
654 
658  CommandId cid);
661  CommandId cmin, CommandId cmax, CommandId combocid);
663  Size nmsgs, SharedInvalidationMessage *msgs);
665  SharedInvalidationMessage *invalidations);
667 
671 
673  XLogRecPtr prepare_lsn, XLogRecPtr end_lsn,
674  TimestampTz prepare_time,
675  RepOriginId origin_id, XLogRecPtr origin_lsn);
677 void ReorderBufferPrepare(ReorderBuffer *rb, TransactionId xid, char *gid);
680 
682 
683 void StartupReorderBuffer(void);
684 
685 #endif
void(* ReorderBufferStreamTruncateCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, int nrelations, Relation relations[], ReorderBufferChange *change)
ReorderBuffer * ReorderBufferAllocate(void)
XLogRecPtr first_lsn
uint32 CommandId
Definition: c.h:601
bool ReorderBufferRememberPrepareInfo(ReorderBuffer *rb, TransactionId xid, XLogRecPtr prepare_lsn, XLogRecPtr end_lsn, TimestampTz prepare_time, RepOriginId origin_id, XLogRecPtr origin_lsn)
SharedInvalidationMessage * invalidations
TimestampTz commit_time
ReorderBufferTupleBuf * ReorderBufferGetTupleBuf(ReorderBuffer *, Size tuple_len)
void ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid, XLogRecPtr commit_lsn, XLogRecPtr end_lsn, XLogRecPtr two_phase_at, TimestampTz commit_time, RepOriginId origin_id, XLogRecPtr origin_lsn, char *gid, bool is_commit)
void ReorderBufferCommit(ReorderBuffer *, TransactionId, XLogRecPtr commit_lsn, XLogRecPtr end_lsn, TimestampTz commit_time, RepOriginId origin_id, XLogRecPtr origin_lsn)
Snapshot base_snapshot
bool ReorderBufferXidHasCatalogChanges(ReorderBuffer *, TransactionId xid)
void ReorderBufferQueueMessage(ReorderBuffer *, TransactionId, Snapshot snapshot, XLogRecPtr lsn, bool transactional, const char *prefix, Size message_size, const char *message)
ReorderBufferApplyChangeCB apply_change
void * private_data
dlist_node base_snapshot_node
RepOriginId origin_id
ReorderBufferTupleBuf * oldtuple
void(* ReorderBufferStreamMessageCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr message_lsn, bool transactional, const char *prefix, Size sz, const char *message)
void ReorderBufferProcessXid(ReorderBuffer *, TransactionId xid, XLogRecPtr lsn)
uint32 TransactionId
Definition: c.h:587
bool ReorderBufferXidHasBaseSnapshot(ReorderBuffer *, TransactionId xid)
void ReorderBufferAssignChild(ReorderBuffer *, TransactionId, TransactionId, XLogRecPtr commit_lsn)
void(* ReorderBufferCommitPreparedCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr commit_lsn)
TransactionId by_txn_last_xid
void ReorderBufferAddSnapshot(ReorderBuffer *, TransactionId, XLogRecPtr lsn, struct SnapshotData *snap)
int64 TimestampTz
Definition: timestamp.h:39
ReorderBufferStreamAbortCB stream_abort
XLogRecPtr current_restart_decoding_lsn
void(* ReorderBufferStreamAbortCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr abort_lsn)
void(* ReorderBufferBeginCB)(ReorderBuffer *rb, ReorderBufferTXN *txn)
struct ReorderBufferTXN * txn
Definition: reorderbuffer.h:88
void(* ReorderBufferStreamChangeCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change)
PGDLLIMPORT int logical_decoding_work_mem
void StartupReorderBuffer(void)
uint16 RepOriginId
Definition: xlogdefs.h:65
CommandId command_id
Snapshot snapshot_now
void ReorderBufferSkipPrepare(ReorderBuffer *rb, TransactionId xid)
void ReorderBufferForget(ReorderBuffer *, TransactionId, XLogRecPtr lsn)
ReorderBufferCommitCB commit
unsigned int Oid
Definition: postgres_ext.h:31
XLogRecPtr base_snapshot_lsn
ReorderBufferStreamCommitCB stream_commit
Oid * ReorderBufferGetRelids(ReorderBuffer *, int nrelids)
MemoryContext change_context
void ReorderBufferAddInvalidations(ReorderBuffer *, TransactionId, XLogRecPtr lsn, Size nmsgs, SharedInvalidationMessage *msgs)
XLogRecPtr origin_lsn
#define PGDLLIMPORT
Definition: c.h:1317
void(* ReorderBufferPrepareCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr prepare_lsn)
void ReorderBufferCommitChild(ReorderBuffer *, TransactionId, TransactionId, XLogRecPtr commit_lsn, XLogRecPtr end_lsn)
void ReorderBufferReturnTupleBuf(ReorderBuffer *, ReorderBufferTupleBuf *tuple)
ReorderBufferChange * ReorderBufferGetChange(ReorderBuffer *)
Definition: dynahash.c:219
ReorderBufferStreamMessageCB stream_message
ReorderBufferChangeType
Definition: reorderbuffer.h:54
void(* ReorderBufferStreamCommitCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr commit_lsn)
ReorderBufferTupleBuf * newtuple
dlist_head changes
dlist_head txns_by_base_snapshot_lsn
ReorderBufferStreamPrepareCB stream_prepare
void ReorderBufferInvalidate(ReorderBuffer *, TransactionId, XLogRecPtr lsn)
void ReorderBufferSetBaseSnapshot(ReorderBuffer *, TransactionId, XLogRecPtr lsn, struct SnapshotData *snap)
void ReorderBufferSetRestartPoint(ReorderBuffer *, XLogRecPtr ptr)
HeapTupleData tuple
Definition: reorderbuffer.h:29
unsigned int uint32
Definition: c.h:441
XLogRecPtr final_lsn
ReorderBufferBeginCB begin_prepare
struct ReorderBufferTXN * toptxn
ItemPointerData tid
ReorderBufferMessageCB message
void ReorderBufferReturnRelids(ReorderBuffer *, Oid *relids)
ReorderBufferStreamChangeCB stream_change
void(* ReorderBufferCommitCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr commit_lsn)
TransactionId ReorderBufferGetOldestXmin(ReorderBuffer *rb)
void ReorderBufferXidSetCatalogChanges(ReorderBuffer *, TransactionId xid, XLogRecPtr lsn)
void(* ReorderBufferApplyChangeCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change)
RepOriginId origin_id
Definition: reorderbuffer.h:90
ReorderBufferStreamTruncateCB stream_truncate
void ReorderBufferAddNewTupleCids(ReorderBuffer *, TransactionId, XLogRecPtr lsn, RelFileNode node, ItemPointerData pt, CommandId cmin, CommandId cmax, CommandId combocid)
MemoryContext context
void(* ReorderBufferStreamStopCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr last_lsn)
void ReorderBufferFree(ReorderBuffer *)
ReorderBufferTXN * by_txn_last_txn
void ReorderBufferAbort(ReorderBuffer *, TransactionId, XLogRecPtr lsn)
dlist_head toplevel_by_lsn
TransactionId xid
ReorderBufferStreamStartCB stream_start
ReorderBufferTXN * ReorderBufferGetOldestTXN(ReorderBuffer *)
union ReorderBufferTXN::@103 xact_time
void ReorderBufferAddNewCommandId(ReorderBuffer *, TransactionId, XLogRecPtr lsn, CommandId cid)
void(* ReorderBufferStreamPrepareCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr prepare_lsn)
uint32 bits32
Definition: c.h:450
uint64 XLogRecPtr
Definition: xlogdefs.h:21
void(* ReorderBufferBeginPrepareCB)(ReorderBuffer *rb, ReorderBufferTXN *txn)
struct ReorderBufferTupleBuf ReorderBufferTupleBuf
XLogRecPtr end_lsn
ReorderBufferRollbackPreparedCB rollback_prepared
void ReorderBufferAbortOld(ReorderBuffer *, TransactionId xid)
void(* ReorderBufferMessageCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr message_lsn, bool transactional, const char *prefix, Size sz, const char *message)
size_t Size
Definition: c.h:540
SharedInvalidationMessage * invalidations
void(* ReorderBufferRollbackPreparedCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr prepare_end_lsn, TimestampTz prepare_time)
dlist_head subtxns
void ReorderBufferImmediateInvalidation(ReorderBuffer *, uint32 ninvalidations, SharedInvalidationMessage *invalidations)
void(* ReorderBufferApplyTruncateCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, int nrelations, Relation relations[], ReorderBufferChange *change)
void(* ReorderBufferStreamStartCB)(ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr first_lsn)
ReorderBufferApplyTruncateCB apply_truncate
void ReorderBufferQueueChange(ReorderBuffer *, TransactionId, XLogRecPtr lsn, ReorderBufferChange *, bool toast_insert)
void ReorderBufferReturnChange(ReorderBuffer *, ReorderBufferChange *, bool)
XLogRecPtr restart_decoding_lsn
TimestampTz prepare_time
MemoryContext tup_context
void ReorderBufferPrepare(ReorderBuffer *rb, TransactionId xid, char *gid)
ReorderBufferBeginCB begin
ReorderBufferCommitPreparedCB commit_prepared
void * output_plugin_private
TransactionId toplevel_xid
MemoryContext txn_context
dlist_head tuplecids
ReorderBufferPrepareCB prepare
struct ReorderBufferTXN ReorderBufferTXN
struct ReorderBufferChange ReorderBufferChange
ReorderBufferStreamStopCB stream_stop