PostgreSQL Source Code
git master
|
#include "access/htup_details.h"
#include "lib/ilist.h"
#include "lib/pairingheap.h"
#include "storage/sinval.h"
#include "utils/hsearch.h"
#include "utils/relcache.h"
#include "utils/snapshot.h"
#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
struct | ReorderBufferChange |
struct | ReorderBufferTXN |
struct | ReorderBuffer |
Macros | |
#define | PG_LOGICAL_DIR "pg_logical" |
#define | PG_LOGICAL_MAPPINGS_DIR PG_LOGICAL_DIR "/mappings" |
#define | PG_LOGICAL_SNAPSHOTS_DIR PG_LOGICAL_DIR "/snapshots" |
#define | RBTXN_HAS_CATALOG_CHANGES 0x0001 |
#define | RBTXN_IS_SUBXACT 0x0002 |
#define | RBTXN_IS_SERIALIZED 0x0004 |
#define | RBTXN_IS_SERIALIZED_CLEAR 0x0008 |
#define | RBTXN_IS_STREAMED 0x0010 |
#define | RBTXN_HAS_PARTIAL_CHANGE 0x0020 |
#define | RBTXN_PREPARE 0x0040 |
#define | RBTXN_SKIPPED_PREPARE 0x0080 |
#define | RBTXN_HAS_STREAMABLE_CHANGE 0x0100 |
#define | rbtxn_has_catalog_changes(txn) |
#define | rbtxn_is_known_subxact(txn) |
#define | rbtxn_is_serialized(txn) |
#define | rbtxn_is_serialized_clear(txn) |
#define | rbtxn_has_partial_change(txn) |
#define | rbtxn_has_streamable_change(txn) |
#define | rbtxn_is_streamed(txn) |
#define | rbtxn_prepared(txn) |
#define | rbtxn_skip_prepared(txn) |
#define | rbtxn_is_toptxn(txn) |
#define | rbtxn_is_subtxn(txn) |
#define | rbtxn_get_toptxn(txn) |
Variables | |
PGDLLIMPORT int | logical_decoding_work_mem |
PGDLLIMPORT int | debug_logical_replication_streaming |
#define PG_LOGICAL_DIR "pg_logical" |
Definition at line 22 of file reorderbuffer.h.
#define PG_LOGICAL_MAPPINGS_DIR PG_LOGICAL_DIR "/mappings" |
Definition at line 23 of file reorderbuffer.h.
#define PG_LOGICAL_SNAPSHOTS_DIR PG_LOGICAL_DIR "/snapshots" |
Definition at line 24 of file reorderbuffer.h.
#define rbtxn_get_toptxn | ( | txn | ) |
Definition at line 252 of file reorderbuffer.h.
#define RBTXN_HAS_CATALOG_CHANGES 0x0001 |
Definition at line 167 of file reorderbuffer.h.
#define rbtxn_has_catalog_changes | ( | txn | ) |
Definition at line 178 of file reorderbuffer.h.
#define RBTXN_HAS_PARTIAL_CHANGE 0x0020 |
Definition at line 172 of file reorderbuffer.h.
#define rbtxn_has_partial_change | ( | txn | ) |
Definition at line 202 of file reorderbuffer.h.
#define RBTXN_HAS_STREAMABLE_CHANGE 0x0100 |
Definition at line 175 of file reorderbuffer.h.
#define rbtxn_has_streamable_change | ( | txn | ) |
Definition at line 208 of file reorderbuffer.h.
#define rbtxn_is_known_subxact | ( | txn | ) |
Definition at line 184 of file reorderbuffer.h.
#define RBTXN_IS_SERIALIZED 0x0004 |
Definition at line 169 of file reorderbuffer.h.
#define rbtxn_is_serialized | ( | txn | ) |
Definition at line 190 of file reorderbuffer.h.
#define RBTXN_IS_SERIALIZED_CLEAR 0x0008 |
Definition at line 170 of file reorderbuffer.h.
#define rbtxn_is_serialized_clear | ( | txn | ) |
Definition at line 196 of file reorderbuffer.h.
#define RBTXN_IS_STREAMED 0x0010 |
Definition at line 171 of file reorderbuffer.h.
#define rbtxn_is_streamed | ( | txn | ) |
Definition at line 222 of file reorderbuffer.h.
#define rbtxn_is_subtxn | ( | txn | ) |
Definition at line 246 of file reorderbuffer.h.
#define RBTXN_IS_SUBXACT 0x0002 |
Definition at line 168 of file reorderbuffer.h.
#define rbtxn_is_toptxn | ( | txn | ) |
Definition at line 240 of file reorderbuffer.h.
#define RBTXN_PREPARE 0x0040 |
Definition at line 173 of file reorderbuffer.h.
#define rbtxn_prepared | ( | txn | ) |
Definition at line 228 of file reorderbuffer.h.
#define rbtxn_skip_prepared | ( | txn | ) |
Definition at line 234 of file reorderbuffer.h.
#define RBTXN_SKIPPED_PREPARE 0x0080 |
Definition at line 174 of file reorderbuffer.h.
typedef struct ReorderBuffer ReorderBuffer |
Definition at line 28 of file reorderbuffer.h.
typedef void(* ReorderBufferApplyChangeCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change) |
Definition at line 435 of file reorderbuffer.h.
typedef void(* ReorderBufferApplyTruncateCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, int nrelations, Relation relations[], ReorderBufferChange *change) |
Definition at line 441 of file reorderbuffer.h.
typedef void(* ReorderBufferBeginCB) (ReorderBuffer *rb, ReorderBufferTXN *txn) |
Definition at line 448 of file reorderbuffer.h.
typedef void(* ReorderBufferBeginPrepareCB) (ReorderBuffer *rb, ReorderBufferTXN *txn) |
Definition at line 465 of file reorderbuffer.h.
typedef struct ReorderBufferChange ReorderBufferChange |
typedef enum ReorderBufferChangeType ReorderBufferChangeType |
typedef void(* ReorderBufferCommitCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr commit_lsn) |
Definition at line 452 of file reorderbuffer.h.
typedef void(* ReorderBufferCommitPreparedCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr commit_lsn) |
Definition at line 474 of file reorderbuffer.h.
typedef void(* ReorderBufferMessageCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr message_lsn, bool transactional, const char *prefix, Size sz, const char *message) |
Definition at line 457 of file reorderbuffer.h.
typedef void(* ReorderBufferPrepareCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr prepare_lsn) |
Definition at line 469 of file reorderbuffer.h.
typedef void(* ReorderBufferRollbackPreparedCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr prepare_end_lsn, TimestampTz prepare_time) |
Definition at line 479 of file reorderbuffer.h.
typedef void(* ReorderBufferStreamAbortCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr abort_lsn) |
Definition at line 497 of file reorderbuffer.h.
typedef void(* ReorderBufferStreamChangeCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change) |
Definition at line 515 of file reorderbuffer.h.
typedef void(* ReorderBufferStreamCommitCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr commit_lsn) |
Definition at line 509 of file reorderbuffer.h.
typedef void(* ReorderBufferStreamMessageCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr message_lsn, bool transactional, const char *prefix, Size sz, const char *message) |
Definition at line 522 of file reorderbuffer.h.
typedef void(* ReorderBufferStreamPrepareCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr prepare_lsn) |
Definition at line 503 of file reorderbuffer.h.
typedef void(* ReorderBufferStreamStartCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr first_lsn) |
Definition at line 485 of file reorderbuffer.h.
typedef void(* ReorderBufferStreamStopCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr last_lsn) |
Definition at line 491 of file reorderbuffer.h.
typedef void(* ReorderBufferStreamTruncateCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, int nrelations, Relation relations[], ReorderBufferChange *change) |
Definition at line 531 of file reorderbuffer.h.
typedef struct ReorderBufferTXN ReorderBufferTXN |
typedef void(* ReorderBufferUpdateProgressTxnCB) (ReorderBuffer *rb, ReorderBufferTXN *txn, XLogRecPtr lsn) |
Definition at line 539 of file reorderbuffer.h.
Enumerator | |
---|---|
DEBUG_LOGICAL_REP_STREAMING_BUFFERED | |
DEBUG_LOGICAL_REP_STREAMING_IMMEDIATE |
Definition at line 31 of file reorderbuffer.h.
Definition at line 50 of file reorderbuffer.h.
void ReorderBufferAbort | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn, | ||
TimestampTz | abort_time | ||
) |
Definition at line 2931 of file reorderbuffer.c.
References ReorderBufferTXN::abort_time, ReorderBufferTXN::final_lsn, ReorderBufferTXN::invalidations, InvalidXLogRecPtr, ReorderBufferTXN::ninvalidations, rbtxn_is_streamed, ReorderBufferCleanupTXN(), ReorderBufferImmediateInvalidation(), ReorderBufferTXNByXid(), ReorderBuffer::stream_abort, and ReorderBufferTXN::xact_time.
Referenced by DecodeAbort().
void ReorderBufferAbortOld | ( | ReorderBuffer * | rb, |
TransactionId | oldestRunningXid | ||
) |
Definition at line 2976 of file reorderbuffer.c.
References dlist_mutable_iter::cur, DEBUG2, dlist_container, dlist_foreach_modify, elog, InvalidXLogRecPtr, rbtxn_is_streamed, ReorderBufferCleanupTXN(), ReorderBuffer::stream_abort, ReorderBuffer::toplevel_by_lsn, TransactionIdPrecedes(), and ReorderBufferTXN::xid.
Referenced by standby_decode().
void ReorderBufferAddInvalidations | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn, | ||
Size | nmsgs, | ||
SharedInvalidationMessage * | msgs | ||
) |
Definition at line 3329 of file reorderbuffer.c.
References ReorderBufferChange::action, Assert, ReorderBuffer::context, ReorderBufferChange::data, ReorderBufferChange::inval, ReorderBufferTXN::invalidations, MemoryContextSwitchTo(), ReorderBufferTXN::ninvalidations, palloc(), rbtxn_get_toptxn, REORDER_BUFFER_CHANGE_INVALIDATION, ReorderBufferGetChange(), ReorderBufferQueueChange(), ReorderBufferTXNByXid(), and repalloc().
Referenced by xact_decode().
void ReorderBufferAddNewCommandId | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn, | ||
CommandId | cid | ||
) |
Definition at line 3193 of file reorderbuffer.c.
References ReorderBufferChange::action, ReorderBufferChange::command_id, ReorderBufferChange::data, REORDER_BUFFER_CHANGE_INTERNAL_COMMAND_ID, ReorderBufferGetChange(), and ReorderBufferQueueChange().
Referenced by SnapBuildProcessNewCid().
void ReorderBufferAddNewTupleCids | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn, | ||
RelFileLocator | locator, | ||
ItemPointerData | tid, | ||
CommandId | cmin, | ||
CommandId | cmax, | ||
CommandId | combocid | ||
) |
Definition at line 3292 of file reorderbuffer.c.
References ReorderBufferChange::action, ReorderBufferChange::data, dlist_push_tail(), ReorderBufferChange::lsn, ReorderBufferChange::node, ReorderBufferTXN::ntuplecids, REORDER_BUFFER_CHANGE_INTERNAL_TUPLECID, ReorderBufferGetChange(), ReorderBufferTXNByXid(), ReorderBufferChange::tuplecid, ReorderBufferTXN::tuplecids, and ReorderBufferChange::txn.
Referenced by SnapBuildProcessNewCid().
void ReorderBufferAddSnapshot | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn, | ||
Snapshot | snap | ||
) |
Definition at line 3144 of file reorderbuffer.c.
References ReorderBufferChange::action, ReorderBufferChange::data, REORDER_BUFFER_CHANGE_INTERNAL_SNAPSHOT, ReorderBufferGetChange(), ReorderBufferQueueChange(), and ReorderBufferChange::snapshot.
Referenced by SnapBuildDistributeNewCatalogSnapshot().
ReorderBuffer* ReorderBufferAllocate | ( | void | ) |
Definition at line 309 of file reorderbuffer.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, ReorderBuffer::by_txn, ReorderBuffer::by_txn_last_txn, ReorderBuffer::by_txn_last_xid, ReorderBuffer::catchange_txns, ReorderBuffer::change_context, ReorderBuffer::context, ReorderBuffer::current_restart_decoding_lsn, CurrentMemoryContext, ReplicationSlot::data, dclist_init(), dlist_init(), HASHCTL::entrysize, GenerationContextCreate(), HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, HASHCTL::hcxt, InvalidTransactionId, InvalidXLogRecPtr, HASHCTL::keysize, MemoryContextAlloc(), MyReplicationSlot, ReplicationSlotPersistentData::name, NameStr, ReorderBuffer::outbuf, ReorderBuffer::outbufsize, pairingheap_allocate(), ReorderBufferCleanupSerializedTXNs(), ReorderBufferTXNSizeCompare(), ReorderBuffer::size, SLAB_DEFAULT_BLOCK_SIZE, SlabContextCreate(), ReorderBuffer::spillBytes, ReorderBuffer::spillCount, ReorderBuffer::spillTxns, ReorderBuffer::streamBytes, ReorderBuffer::streamCount, ReorderBuffer::streamTxns, ReorderBuffer::toplevel_by_lsn, ReorderBuffer::totalBytes, ReorderBuffer::totalTxns, ReorderBuffer::tup_context, ReorderBuffer::txn_context, ReorderBuffer::txn_heap, and ReorderBuffer::txns_by_base_snapshot_lsn.
Referenced by StartupDecodingContext().
void ReorderBufferAssignChild | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
TransactionId | subxid, | ||
XLogRecPtr | lsn | ||
) |
Definition at line 1077 of file reorderbuffer.c.
References Assert, AssertTXNLsnOrder(), dlist_delete(), dlist_push_tail(), ReorderBufferTXN::node, ReorderBufferTXN::nsubtxns, rbtxn_is_known_subxact, RBTXN_IS_SUBXACT, ReorderBufferTransferSnapToParent(), ReorderBufferTXNByXid(), ReorderBufferTXN::subtxns, ReorderBufferTXN::toplevel_xid, ReorderBufferTXN::toptxn, and ReorderBufferTXN::txn_flags.
Referenced by LogicalDecodingProcessRecord(), and ReorderBufferCommitChild().
void ReorderBufferCommit | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | commit_lsn, | ||
XLogRecPtr | end_lsn, | ||
TimestampTz | commit_time, | ||
RepOriginId | origin_id, | ||
XLogRecPtr | origin_lsn | ||
) |
Definition at line 2740 of file reorderbuffer.c.
References InvalidXLogRecPtr, ReorderBufferReplay(), and ReorderBufferTXNByXid().
Referenced by DecodeCommit().
void ReorderBufferCommitChild | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
TransactionId | subxid, | ||
XLogRecPtr | commit_lsn, | ||
XLogRecPtr | end_lsn | ||
) |
Definition at line 1197 of file reorderbuffer.c.
References ReorderBufferTXN::end_lsn, ReorderBufferTXN::final_lsn, InvalidXLogRecPtr, ReorderBufferAssignChild(), and ReorderBufferTXNByXid().
Referenced by DecodeCommit(), and DecodePrepare().
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 | ||
) |
Definition at line 2846 of file reorderbuffer.c.
References Assert, ReorderBuffer::commit_prepared, ReorderBufferTXN::commit_time, ReorderBufferTXN::end_lsn, ReorderBufferTXN::final_lsn, ReorderBufferTXN::gid, ReorderBufferTXN::invalidations, InvalidXLogRecPtr, ReorderBufferTXN::ninvalidations, ReorderBufferTXN::origin_id, ReorderBufferTXN::origin_lsn, ReorderBufferTXN::prepare_time, pstrdup(), RBTXN_PREPARE, ReorderBufferCleanupTXN(), ReorderBufferExecuteInvalidations(), ReorderBufferReplay(), ReorderBufferTXNByXid(), ReorderBuffer::rollback_prepared, ReorderBufferTXN::txn_flags, and ReorderBufferTXN::xact_time.
Referenced by DecodeAbort(), and DecodeCommit().
void ReorderBufferForget | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn | ||
) |
Definition at line 3023 of file reorderbuffer.c.
References Assert, ReorderBufferTXN::base_snapshot, ReorderBufferTXN::final_lsn, ReorderBufferTXN::invalidations, InvalidXLogRecPtr, ReorderBufferTXN::ninvalidations, rbtxn_is_streamed, ReorderBufferCleanupTXN(), ReorderBufferImmediateInvalidation(), and ReorderBufferTXNByXid().
Referenced by DecodeCommit().
void ReorderBufferFree | ( | ReorderBuffer * | rb | ) |
Definition at line 401 of file reorderbuffer.c.
References context, ReorderBuffer::context, ReplicationSlot::data, MemoryContextDelete(), MyReplicationSlot, ReplicationSlotPersistentData::name, NameStr, and ReorderBufferCleanupSerializedTXNs().
Referenced by FreeDecodingContext().
TransactionId* ReorderBufferGetCatalogChangesXacts | ( | ReorderBuffer * | rb | ) |
Definition at line 3438 of file reorderbuffer.c.
References Assert, ReorderBuffer::catchange_txns, dlist_iter::cur, dclist_container, dclist_count(), dclist_foreach, palloc(), qsort, rbtxn_has_catalog_changes, ReorderBufferTXN::xid, and xidComparator().
Referenced by SnapBuildSerialize().
ReorderBufferChange* ReorderBufferGetChange | ( | ReorderBuffer * | rb | ) |
Definition at line 485 of file reorderbuffer.c.
References ReorderBuffer::change_context, and MemoryContextAlloc().
Referenced by DecodeDelete(), DecodeInsert(), DecodeMultiInsert(), DecodeSpecConfirm(), DecodeTruncate(), DecodeUpdate(), ReorderBufferAddInvalidations(), ReorderBufferAddNewCommandId(), ReorderBufferAddNewTupleCids(), ReorderBufferAddSnapshot(), ReorderBufferQueueMessage(), and ReorderBufferRestoreChange().
ReorderBufferTXN* ReorderBufferGetOldestTXN | ( | ReorderBuffer * | rb | ) |
Definition at line 1022 of file reorderbuffer.c.
References Assert, AssertTXNLsnOrder(), dlist_head_element, dlist_is_empty(), ReorderBufferTXN::first_lsn, InvalidXLogRecPtr, rbtxn_is_known_subxact, and ReorderBuffer::toplevel_by_lsn.
Referenced by SnapBuildProcessRunningXacts().
TransactionId ReorderBufferGetOldestXmin | ( | ReorderBuffer * | rb | ) |
Definition at line 1050 of file reorderbuffer.c.
References AssertTXNLsnOrder(), ReorderBufferTXN::base_snapshot, dlist_head_element, dlist_is_empty(), InvalidTransactionId, ReorderBuffer::txns_by_base_snapshot_lsn, and SnapshotData::xmin.
Referenced by SnapBuildProcessRunningXacts().
Oid* ReorderBufferGetRelids | ( | ReorderBuffer * | rb, |
int | nrelids | ||
) |
Definition at line 603 of file reorderbuffer.c.
References ReorderBuffer::context, and MemoryContextAlloc().
Referenced by DecodeTruncate(), and ReorderBufferRestoreChange().
HeapTuple ReorderBufferGetTupleBuf | ( | ReorderBuffer * | rb, |
Size | tuple_len | ||
) |
Definition at line 570 of file reorderbuffer.c.
References HEAPTUPLESIZE, MemoryContextAlloc(), SizeofHeapTupleHeader, HeapTupleData::t_data, and ReorderBuffer::tup_context.
Referenced by DecodeDelete(), DecodeInsert(), DecodeMultiInsert(), DecodeUpdate(), and ReorderBufferRestoreChange().
void ReorderBufferImmediateInvalidation | ( | ReorderBuffer * | rb, |
uint32 | ninvalidations, | ||
SharedInvalidationMessage * | invalidations | ||
) |
Definition at line 3095 of file reorderbuffer.c.
References AbortCurrentTransaction(), BeginInternalSubTransaction(), i, IsTransactionOrTransactionBlock(), LocalExecuteInvalidationMessage(), and RollbackAndReleaseCurrentSubTransaction().
Referenced by ReorderBufferAbort(), ReorderBufferForget(), ReorderBufferInvalidate(), and xact_decode().
void ReorderBufferInvalidate | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn | ||
) |
Definition at line 3064 of file reorderbuffer.c.
References Assert, ReorderBufferTXN::base_snapshot, ReorderBufferTXN::invalidations, InvalidXLogRecPtr, ReorderBufferTXN::ninvalidations, ReorderBufferImmediateInvalidation(), and ReorderBufferTXNByXid().
Referenced by DecodePrepare().
void ReorderBufferPrepare | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
char * | gid | ||
) |
Definition at line 2809 of file reorderbuffer.c.
References Assert, ReorderBufferTXN::concurrent_abort, ReorderBufferTXN::end_lsn, ReorderBufferTXN::final_lsn, ReorderBufferTXN::gid, InvalidXLogRecPtr, ReorderBufferTXN::origin_id, ReorderBufferTXN::origin_lsn, ReorderBuffer::prepare, ReorderBufferTXN::prepare_time, pstrdup(), rbtxn_is_streamed, RBTXN_PREPARE, ReorderBufferReplay(), ReorderBufferTXNByXid(), ReorderBufferTXN::txn_flags, and ReorderBufferTXN::xact_time.
Referenced by DecodePrepare().
void ReorderBufferProcessXid | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn | ||
) |
Definition at line 3131 of file reorderbuffer.c.
References InvalidTransactionId, and ReorderBufferTXNByXid().
Referenced by heap2_decode(), heap_decode(), LogicalDecodingProcessRecord(), logicalmsg_decode(), standby_decode(), xact_decode(), and xlog_decode().
void ReorderBufferQueueChange | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn, | ||
ReorderBufferChange * | change, | ||
bool | toast_insert | ||
) |
Definition at line 788 of file reorderbuffer.c.
References ReorderBufferChange::action, Assert, ReorderBufferTXN::changes, ReorderBufferTXN::concurrent_abort, dlist_push_tail(), InvalidXLogRecPtr, ReorderBufferChange::lsn, ReorderBufferTXN::nentries, ReorderBufferTXN::nentries_mem, ReorderBufferChange::node, rbtxn_get_toptxn, RBTXN_HAS_STREAMABLE_CHANGE, REORDER_BUFFER_CHANGE_DELETE, REORDER_BUFFER_CHANGE_INSERT, REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT, REORDER_BUFFER_CHANGE_MESSAGE, REORDER_BUFFER_CHANGE_TRUNCATE, REORDER_BUFFER_CHANGE_UPDATE, ReorderBufferChangeMemoryUpdate(), ReorderBufferChangeSize(), ReorderBufferCheckMemoryLimit(), ReorderBufferProcessPartialChange(), ReorderBufferReturnChange(), ReorderBufferTXNByXid(), ReorderBufferChange::txn, and ReorderBufferTXN::txn_flags.
Referenced by DecodeDelete(), DecodeInsert(), DecodeMultiInsert(), DecodeSpecConfirm(), DecodeTruncate(), DecodeUpdate(), ReorderBufferAddInvalidations(), ReorderBufferAddNewCommandId(), ReorderBufferAddSnapshot(), and ReorderBufferQueueMessage().
void ReorderBufferQueueMessage | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
Snapshot | snap, | ||
XLogRecPtr | lsn, | ||
bool | transactional, | ||
const char * | prefix, | ||
Size | message_size, | ||
const char * | message | ||
) |
Definition at line 851 of file reorderbuffer.c.
References ReorderBufferChange::action, Assert, ReorderBuffer::context, ReorderBufferChange::data, InvalidTransactionId, MemoryContextSwitchTo(), ReorderBuffer::message, ReorderBufferChange::msg, palloc(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pstrdup(), REORDER_BUFFER_CHANGE_MESSAGE, ReorderBufferGetChange(), ReorderBufferQueueChange(), ReorderBufferTXNByXid(), SetupHistoricSnapshot(), and TeardownHistoricSnapshot().
Referenced by logicalmsg_decode().
bool ReorderBufferRememberPrepareInfo | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | prepare_lsn, | ||
XLogRecPtr | end_lsn, | ||
TimestampTz | prepare_time, | ||
RepOriginId | origin_id, | ||
XLogRecPtr | origin_lsn | ||
) |
Definition at line 2762 of file reorderbuffer.c.
References ReorderBufferTXN::end_lsn, ReorderBufferTXN::final_lsn, InvalidXLogRecPtr, ReorderBufferTXN::origin_id, ReorderBufferTXN::origin_lsn, ReorderBufferTXN::prepare_time, ReorderBufferTXNByXid(), and ReorderBufferTXN::xact_time.
Referenced by DecodePrepare().
void ReorderBufferReturnChange | ( | ReorderBuffer * | rb, |
ReorderBufferChange * | change, | ||
bool | upd_mem | ||
) |
Definition at line 500 of file reorderbuffer.c.
References ReorderBufferChange::action, ReorderBufferChange::data, ReorderBufferChange::inval, ReorderBufferChange::msg, pfree(), REORDER_BUFFER_CHANGE_DELETE, REORDER_BUFFER_CHANGE_INSERT, REORDER_BUFFER_CHANGE_INTERNAL_COMMAND_ID, REORDER_BUFFER_CHANGE_INTERNAL_SNAPSHOT, REORDER_BUFFER_CHANGE_INTERNAL_SPEC_ABORT, REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM, REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT, REORDER_BUFFER_CHANGE_INTERNAL_TUPLECID, REORDER_BUFFER_CHANGE_INVALIDATION, REORDER_BUFFER_CHANGE_MESSAGE, REORDER_BUFFER_CHANGE_TRUNCATE, REORDER_BUFFER_CHANGE_UPDATE, ReorderBufferChangeMemoryUpdate(), ReorderBufferChangeSize(), ReorderBufferFreeSnap(), ReorderBufferReturnRelids(), ReorderBufferReturnTupleBuf(), ReorderBufferChange::snapshot, ReorderBufferChange::tp, and ReorderBufferChange::truncate.
Referenced by ReorderBufferCleanupTXN(), ReorderBufferIterTXNFinish(), ReorderBufferIterTXNNext(), ReorderBufferProcessTXN(), ReorderBufferQueueChange(), ReorderBufferResetTXN(), ReorderBufferRestoreChanges(), ReorderBufferSerializeTXN(), ReorderBufferToastReset(), and ReorderBufferTruncateTXN().
void ReorderBufferReturnRelids | ( | ReorderBuffer * | rb, |
Oid * | relids | ||
) |
Definition at line 619 of file reorderbuffer.c.
References pfree().
Referenced by ReorderBufferReturnChange().
void ReorderBufferReturnTupleBuf | ( | HeapTuple | tuple | ) |
Definition at line 588 of file reorderbuffer.c.
References pfree().
Referenced by ReorderBufferReturnChange().
void ReorderBufferSetBaseSnapshot | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn, | ||
Snapshot | snap | ||
) |
Definition at line 3162 of file reorderbuffer.c.
References Assert, AssertTXNLsnOrder(), ReorderBufferTXN::base_snapshot, ReorderBufferTXN::base_snapshot_lsn, ReorderBufferTXN::base_snapshot_node, dlist_push_tail(), InvalidXLogRecPtr, rbtxn_is_known_subxact, ReorderBufferTXNByXid(), ReorderBufferTXN::toplevel_xid, and ReorderBuffer::txns_by_base_snapshot_lsn.
Referenced by SnapBuildCommitTxn(), and SnapBuildProcessChange().
void ReorderBufferSetRestartPoint | ( | ReorderBuffer * | rb, |
XLogRecPtr | ptr | ||
) |
Definition at line 1065 of file reorderbuffer.c.
References ReorderBuffer::current_restart_decoding_lsn.
Referenced by SnapBuildRestore(), and SnapBuildSerialize().
void ReorderBufferSkipPrepare | ( | ReorderBuffer * | rb, |
TransactionId | xid | ||
) |
Definition at line 2790 of file reorderbuffer.c.
References InvalidXLogRecPtr, RBTXN_SKIPPED_PREPARE, ReorderBufferTXNByXid(), and ReorderBufferTXN::txn_flags.
Referenced by DecodePrepare().
bool ReorderBufferXidHasBaseSnapshot | ( | ReorderBuffer * | rb, |
TransactionId | xid | ||
) |
Definition at line 3490 of file reorderbuffer.c.
References ReorderBufferTXN::base_snapshot, InvalidXLogRecPtr, rbtxn_is_known_subxact, ReorderBufferTXNByXid(), and ReorderBufferTXN::toplevel_xid.
Referenced by SnapBuildCommitTxn(), SnapBuildDistributeNewCatalogSnapshot(), and SnapBuildProcessChange().
bool ReorderBufferXidHasCatalogChanges | ( | ReorderBuffer * | rb, |
TransactionId | xid | ||
) |
Definition at line 3473 of file reorderbuffer.c.
References InvalidXLogRecPtr, rbtxn_has_catalog_changes, and ReorderBufferTXNByXid().
Referenced by SnapBuildXidHasCatalogChanges().
void ReorderBufferXidSetCatalogChanges | ( | ReorderBuffer * | rb, |
TransactionId | xid, | ||
XLogRecPtr | lsn | ||
) |
Definition at line 3400 of file reorderbuffer.c.
References ReorderBufferTXN::catchange_node, ReorderBuffer::catchange_txns, dclist_push_tail(), rbtxn_get_toptxn, RBTXN_HAS_CATALOG_CHANGES, rbtxn_has_catalog_changes, rbtxn_is_subtxn, ReorderBufferTXNByXid(), and ReorderBufferTXN::txn_flags.
Referenced by SnapBuildProcessNewCid(), and xact_decode().
void StartupReorderBuffer | ( | void | ) |
Definition at line 4655 of file reorderbuffer.c.
References AllocateDir(), dirent::d_name, DEBUG2, FreeDir(), PG_REPLSLOT_DIR, ReadDir(), ReorderBufferCleanupSerializedTXNs(), and ReplicationSlotValidateName().
Referenced by StartupXLOG().
|
extern |
Definition at line 216 of file reorderbuffer.c.
Referenced by pa_send_data(), and ReorderBufferCheckMemoryLimit().
|
extern |
Definition at line 212 of file reorderbuffer.c.
Referenced by ReorderBufferCheckMemoryLimit().