PostgreSQL Source Code
git master
|
#include "access/htup.h"
#include "access/xlogreader.h"
#include "lib/stringinfo.h"
#include "storage/buf.h"
#include "storage/bufpage.h"
#include "storage/relfilelocator.h"
#include "storage/sinval.h"
#include "utils/relcache.h"
Go to the source code of this file.
Data Structures | |
struct | xl_heap_delete |
struct | xl_heap_truncate |
struct | xl_heap_header |
struct | xl_heap_insert |
struct | xl_heap_multi_insert |
struct | xl_multi_insert_tuple |
struct | xl_heap_update |
struct | xl_heap_prune |
struct | xlhp_freeze_plan |
struct | xlhp_freeze_plans |
struct | xlhp_prune_items |
struct | xl_heap_lock |
struct | xl_heap_lock_updated |
struct | xl_heap_confirm |
struct | xl_heap_inplace |
struct | xl_heap_visible |
struct | xl_heap_new_cid |
struct | xl_heap_rewrite_mapping |
Typedefs | |
typedef struct xl_heap_delete | xl_heap_delete |
typedef struct xl_heap_truncate | xl_heap_truncate |
typedef struct xl_heap_header | xl_heap_header |
typedef struct xl_heap_insert | xl_heap_insert |
typedef struct xl_heap_multi_insert | xl_heap_multi_insert |
typedef struct xl_multi_insert_tuple | xl_multi_insert_tuple |
typedef struct xl_heap_update | xl_heap_update |
typedef struct xl_heap_prune | xl_heap_prune |
typedef struct xlhp_freeze_plan | xlhp_freeze_plan |
typedef struct xlhp_freeze_plans | xlhp_freeze_plans |
typedef struct xlhp_prune_items | xlhp_prune_items |
typedef struct xl_heap_lock | xl_heap_lock |
typedef struct xl_heap_lock_updated | xl_heap_lock_updated |
typedef struct xl_heap_confirm | xl_heap_confirm |
typedef struct xl_heap_inplace | xl_heap_inplace |
typedef struct xl_heap_visible | xl_heap_visible |
typedef struct xl_heap_new_cid | xl_heap_new_cid |
typedef struct xl_heap_rewrite_mapping | xl_heap_rewrite_mapping |
Functions | |
void | HeapTupleHeaderAdvanceConflictHorizon (HeapTupleHeader tuple, TransactionId *snapshotConflictHorizon) |
void | heap_redo (XLogReaderState *record) |
void | heap_desc (StringInfo buf, XLogReaderState *record) |
const char * | heap_identify (uint8 info) |
void | heap_mask (char *pagedata, BlockNumber blkno) |
void | heap2_redo (XLogReaderState *record) |
void | heap2_desc (StringInfo buf, XLogReaderState *record) |
const char * | heap2_identify (uint8 info) |
void | heap_xlog_logical_rewrite (XLogReaderState *r) |
XLogRecPtr | log_heap_visible (Relation rel, Buffer heap_buffer, Buffer vm_buffer, TransactionId snapshotConflictHorizon, uint8 vmflags) |
void | heap_xlog_deserialize_prune_and_freeze (char *cursor, uint8 flags, int *nplans, xlhp_freeze_plan **plans, OffsetNumber **frz_offsets, int *nredirected, OffsetNumber **redirected, int *ndead, OffsetNumber **nowdead, int *nunused, OffsetNumber **nowunused) |
#define MinSizeOfHeapInplace (offsetof(xl_heap_inplace, nmsgs) + sizeof(int)) |
Definition at line 436 of file heapam_xlog.h.
#define SizeOfHeapConfirm (offsetof(xl_heap_confirm, offnum) + sizeof(OffsetNumber)) |
Definition at line 423 of file heapam_xlog.h.
#define SizeOfHeapDelete (offsetof(xl_heap_delete, flags) + sizeof(uint8)) |
Definition at line 121 of file heapam_xlog.h.
#define SizeOfHeapHeader (offsetof(xl_heap_header, t_hoff) + sizeof(uint8)) |
Definition at line 157 of file heapam_xlog.h.
#define SizeOfHeapInsert (offsetof(xl_heap_insert, flags) + sizeof(uint8)) |
Definition at line 168 of file heapam_xlog.h.
#define SizeOfHeapLock (offsetof(xl_heap_lock, flags) + sizeof(uint8)) |
Definition at line 404 of file heapam_xlog.h.
#define SizeOfHeapLockUpdated (offsetof(xl_heap_lock_updated, flags) + sizeof(uint8)) |
Definition at line 415 of file heapam_xlog.h.
#define SizeOfHeapMultiInsert offsetof(xl_heap_multi_insert, offsets) |
Definition at line 188 of file heapam_xlog.h.
#define SizeOfHeapNewCid (offsetof(xl_heap_new_cid, target_tid) + sizeof(ItemPointerData)) |
Definition at line 470 of file heapam_xlog.h.
#define SizeOfHeapPrune (offsetof(xl_heap_prune, flags) + sizeof(uint8)) |
Definition at line 296 of file heapam_xlog.h.
#define SizeOfHeapTruncate (offsetof(xl_heap_truncate, relids)) |
Definition at line 142 of file heapam_xlog.h.
#define SizeOfHeapUpdate (offsetof(xl_heap_update, new_offnum) + sizeof(OffsetNumber)) |
Definition at line 233 of file heapam_xlog.h.
#define SizeOfHeapVisible (offsetof(xl_heap_visible, flags) + sizeof(uint8)) |
Definition at line 450 of file heapam_xlog.h.
#define SizeOfMultiInsertTuple (offsetof(xl_multi_insert_tuple, t_hoff) + sizeof(uint8)) |
Definition at line 199 of file heapam_xlog.h.
#define XLH_DELETE_ALL_VISIBLE_CLEARED (1<<0) |
Definition at line 102 of file heapam_xlog.h.
#define XLH_DELETE_CONTAINS_OLD (XLH_DELETE_CONTAINS_OLD_TUPLE | XLH_DELETE_CONTAINS_OLD_KEY) |
Definition at line 109 of file heapam_xlog.h.
#define XLH_DELETE_CONTAINS_OLD_KEY (1<<2) |
Definition at line 104 of file heapam_xlog.h.
#define XLH_DELETE_CONTAINS_OLD_TUPLE (1<<1) |
Definition at line 103 of file heapam_xlog.h.
#define XLH_DELETE_IS_PARTITION_MOVE (1<<4) |
Definition at line 106 of file heapam_xlog.h.
#define XLH_DELETE_IS_SUPER (1<<3) |
Definition at line 105 of file heapam_xlog.h.
#define XLH_FREEZE_XVAC 0x02 |
Definition at line 339 of file heapam_xlog.h.
#define XLH_INSERT_ALL_FROZEN_SET (1<<5) |
Definition at line 79 of file heapam_xlog.h.
#define XLH_INSERT_ALL_VISIBLE_CLEARED (1<<0) |
Definition at line 72 of file heapam_xlog.h.
#define XLH_INSERT_CONTAINS_NEW_TUPLE (1<<3) |
Definition at line 75 of file heapam_xlog.h.
#define XLH_INSERT_IS_SPECULATIVE (1<<2) |
Definition at line 74 of file heapam_xlog.h.
#define XLH_INSERT_LAST_IN_MULTI (1<<1) |
Definition at line 73 of file heapam_xlog.h.
#define XLH_INSERT_ON_TOAST_RELATION (1<<4) |
Definition at line 76 of file heapam_xlog.h.
#define XLH_INVALID_XVAC 0x04 |
Definition at line 340 of file heapam_xlog.h.
#define XLH_LOCK_ALL_FROZEN_CLEARED 0x01 |
Definition at line 393 of file heapam_xlog.h.
#define XLH_TRUNCATE_CASCADE (1<<0) |
Definition at line 126 of file heapam_xlog.h.
#define XLH_TRUNCATE_RESTART_SEQS (1<<1) |
Definition at line 127 of file heapam_xlog.h.
#define XLH_UPDATE_CONTAINS_NEW_TUPLE (1<<4) |
Definition at line 90 of file heapam_xlog.h.
#define XLH_UPDATE_CONTAINS_OLD (XLH_UPDATE_CONTAINS_OLD_TUPLE | XLH_UPDATE_CONTAINS_OLD_KEY) |
Definition at line 95 of file heapam_xlog.h.
#define XLH_UPDATE_CONTAINS_OLD_KEY (1<<3) |
Definition at line 89 of file heapam_xlog.h.
#define XLH_UPDATE_CONTAINS_OLD_TUPLE (1<<2) |
Definition at line 88 of file heapam_xlog.h.
#define XLH_UPDATE_NEW_ALL_VISIBLE_CLEARED (1<<1) |
Definition at line 87 of file heapam_xlog.h.
#define XLH_UPDATE_OLD_ALL_VISIBLE_CLEARED (1<<0) |
Definition at line 85 of file heapam_xlog.h.
#define XLH_UPDATE_PREFIX_FROM_OLD (1<<5) |
Definition at line 91 of file heapam_xlog.h.
#define XLH_UPDATE_SUFFIX_FROM_OLD (1<<6) |
Definition at line 92 of file heapam_xlog.h.
#define XLHL_KEYS_UPDATED 0x10 |
Definition at line 390 of file heapam_xlog.h.
#define XLHL_XMAX_EXCL_LOCK 0x04 |
Definition at line 388 of file heapam_xlog.h.
#define XLHL_XMAX_IS_MULTI 0x01 |
Definition at line 386 of file heapam_xlog.h.
#define XLHL_XMAX_KEYSHR_LOCK 0x08 |
Definition at line 389 of file heapam_xlog.h.
#define XLHL_XMAX_LOCK_ONLY 0x02 |
Definition at line 387 of file heapam_xlog.h.
#define XLHP_CLEANUP_LOCK (1 << 2) |
Definition at line 309 of file heapam_xlog.h.
#define XLHP_HAS_CONFLICT_HORIZON (1 << 3) |
Definition at line 317 of file heapam_xlog.h.
#define XLHP_HAS_DEAD_ITEMS (1 << 6) |
Definition at line 331 of file heapam_xlog.h.
#define XLHP_HAS_FREEZE_PLANS (1 << 4) |
Definition at line 323 of file heapam_xlog.h.
#define XLHP_HAS_NOW_UNUSED_ITEMS (1 << 7) |
Definition at line 332 of file heapam_xlog.h.
#define XLHP_HAS_REDIRECTIONS (1 << 5) |
Definition at line 330 of file heapam_xlog.h.
#define XLHP_IS_CATALOG_REL (1 << 1) |
Definition at line 299 of file heapam_xlog.h.
#define XLOG_HEAP2_LOCK_UPDATED 0x60 |
Definition at line 65 of file heapam_xlog.h.
#define XLOG_HEAP2_MULTI_INSERT 0x50 |
Definition at line 64 of file heapam_xlog.h.
#define XLOG_HEAP2_NEW_CID 0x70 |
Definition at line 66 of file heapam_xlog.h.
#define XLOG_HEAP2_PRUNE_ON_ACCESS 0x10 |
Definition at line 60 of file heapam_xlog.h.
#define XLOG_HEAP2_PRUNE_VACUUM_CLEANUP 0x30 |
Definition at line 62 of file heapam_xlog.h.
#define XLOG_HEAP2_PRUNE_VACUUM_SCAN 0x20 |
Definition at line 61 of file heapam_xlog.h.
#define XLOG_HEAP2_REWRITE 0x00 |
Definition at line 59 of file heapam_xlog.h.
#define XLOG_HEAP2_VISIBLE 0x40 |
Definition at line 63 of file heapam_xlog.h.
#define XLOG_HEAP_CONFIRM 0x50 |
Definition at line 38 of file heapam_xlog.h.
#define XLOG_HEAP_DELETE 0x10 |
Definition at line 34 of file heapam_xlog.h.
#define XLOG_HEAP_HOT_UPDATE 0x40 |
Definition at line 37 of file heapam_xlog.h.
#define XLOG_HEAP_INIT_PAGE 0x80 |
Definition at line 47 of file heapam_xlog.h.
#define XLOG_HEAP_INPLACE 0x70 |
Definition at line 40 of file heapam_xlog.h.
#define XLOG_HEAP_INSERT 0x00 |
Definition at line 33 of file heapam_xlog.h.
#define XLOG_HEAP_LOCK 0x60 |
Definition at line 39 of file heapam_xlog.h.
#define XLOG_HEAP_OPMASK 0x70 |
Definition at line 42 of file heapam_xlog.h.
#define XLOG_HEAP_TRUNCATE 0x30 |
Definition at line 36 of file heapam_xlog.h.
#define XLOG_HEAP_UPDATE 0x20 |
Definition at line 35 of file heapam_xlog.h.
typedef struct xl_heap_confirm xl_heap_confirm |
typedef struct xl_heap_delete xl_heap_delete |
typedef struct xl_heap_header xl_heap_header |
typedef struct xl_heap_inplace xl_heap_inplace |
typedef struct xl_heap_insert xl_heap_insert |
typedef struct xl_heap_lock xl_heap_lock |
typedef struct xl_heap_lock_updated xl_heap_lock_updated |
typedef struct xl_heap_multi_insert xl_heap_multi_insert |
typedef struct xl_heap_new_cid xl_heap_new_cid |
typedef struct xl_heap_prune xl_heap_prune |
typedef struct xl_heap_rewrite_mapping xl_heap_rewrite_mapping |
typedef struct xl_heap_truncate xl_heap_truncate |
typedef struct xl_heap_update xl_heap_update |
typedef struct xl_heap_visible xl_heap_visible |
typedef struct xl_multi_insert_tuple xl_multi_insert_tuple |
typedef struct xlhp_freeze_plan xlhp_freeze_plan |
typedef struct xlhp_freeze_plans xlhp_freeze_plans |
typedef struct xlhp_prune_items xlhp_prune_items |
void heap2_desc | ( | StringInfo | buf, |
XLogReaderState * | record | ||
) |
Definition at line 264 of file heapdesc.c.
References appendStringInfo(), appendStringInfoString(), array_desc(), buf, xl_heap_new_cid::cmax, xl_heap_new_cid::cmin, xl_heap_new_cid::combocid, RelFileLocator::dbOid, xl_heap_multi_insert::flags, xl_heap_prune::flags, xl_heap_lock_updated::flags, xl_heap_visible::flags, heap_xlog_deserialize_prune_and_freeze(), infobits_desc(), xl_heap_lock_updated::infobits_set, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), xl_heap_multi_insert::ntuples, xl_heap_lock_updated::offnum, offset_elem_desc(), xl_heap_multi_insert::offsets, plan_elem_desc(), redirect_elem_desc(), RelFileLocator::relNumber, SizeOfHeapPrune, xl_heap_visible::snapshotConflictHorizon, RelFileLocator::spcOid, xl_heap_new_cid::target_locator, xl_heap_new_cid::target_tid, XLHP_HAS_CONFLICT_HORIZON, XLHP_IS_CATALOG_REL, XLOG_HEAP2_LOCK_UPDATED, XLOG_HEAP2_MULTI_INSERT, XLOG_HEAP2_NEW_CID, XLOG_HEAP2_PRUNE_ON_ACCESS, XLOG_HEAP2_PRUNE_VACUUM_CLEANUP, XLOG_HEAP2_PRUNE_VACUUM_SCAN, XLOG_HEAP2_VISIBLE, XLOG_HEAP_INIT_PAGE, XLOG_HEAP_OPMASK, XLogRecGetBlockData(), XLogRecGetData, XLogRecGetInfo, XLogRecHasBlockData, XLR_INFO_MASK, and xl_heap_lock_updated::xmax.
const char* heap2_identify | ( | uint8 | info | ) |
Definition at line 434 of file heapdesc.c.
References XLOG_HEAP2_LOCK_UPDATED, XLOG_HEAP2_MULTI_INSERT, XLOG_HEAP2_NEW_CID, XLOG_HEAP2_PRUNE_ON_ACCESS, XLOG_HEAP2_PRUNE_VACUUM_CLEANUP, XLOG_HEAP2_PRUNE_VACUUM_SCAN, XLOG_HEAP2_REWRITE, XLOG_HEAP2_VISIBLE, XLOG_HEAP_INIT_PAGE, and XLR_INFO_MASK.
void heap2_redo | ( | XLogReaderState * | record | ) |
Definition at line 1228 of file heapam_xlog.c.
References elog, heap_xlog_lock_updated(), heap_xlog_logical_rewrite(), heap_xlog_multi_insert(), heap_xlog_prune_freeze(), heap_xlog_visible(), PANIC, XLOG_HEAP2_LOCK_UPDATED, XLOG_HEAP2_MULTI_INSERT, XLOG_HEAP2_NEW_CID, XLOG_HEAP2_PRUNE_ON_ACCESS, XLOG_HEAP2_PRUNE_VACUUM_CLEANUP, XLOG_HEAP2_PRUNE_VACUUM_SCAN, XLOG_HEAP2_REWRITE, XLOG_HEAP2_VISIBLE, XLOG_HEAP_OPMASK, XLogRecGetInfo, and XLR_INFO_MASK.
void heap_desc | ( | StringInfo | buf, |
XLogReaderState * | record | ||
) |
Definition at line 184 of file heapdesc.c.
References appendStringInfo(), appendStringInfoString(), array_desc(), buf, xl_heap_inplace::dbId, xl_heap_delete::flags, xl_heap_truncate::flags, xl_heap_insert::flags, xl_heap_update::flags, xl_heap_lock::flags, infobits_desc(), xl_heap_delete::infobits_set, xl_heap_lock::infobits_set, xl_heap_inplace::msgs, xl_heap_update::new_offnum, xl_heap_update::new_xmax, xl_heap_inplace::nmsgs, xl_heap_truncate::nrelids, xl_heap_delete::offnum, xl_heap_insert::offnum, xl_heap_lock::offnum, xl_heap_confirm::offnum, xl_heap_inplace::offnum, oid_elem_desc(), xl_heap_update::old_infobits_set, xl_heap_update::old_offnum, xl_heap_update::old_xmax, xl_heap_inplace::relcacheInitFileInval, xl_heap_truncate::relids, standby_desc_invalidations(), truncate_flags_desc(), xl_heap_inplace::tsId, XLOG_HEAP_CONFIRM, XLOG_HEAP_DELETE, XLOG_HEAP_HOT_UPDATE, XLOG_HEAP_INPLACE, XLOG_HEAP_INSERT, XLOG_HEAP_LOCK, XLOG_HEAP_OPMASK, XLOG_HEAP_TRUNCATE, XLOG_HEAP_UPDATE, XLogRecGetData, XLogRecGetInfo, XLR_INFO_MASK, xl_heap_delete::xmax, and xl_heap_lock::xmax.
const char* heap_identify | ( | uint8 | info | ) |
Definition at line 389 of file heapdesc.c.
References XLOG_HEAP_CONFIRM, XLOG_HEAP_DELETE, XLOG_HEAP_HOT_UPDATE, XLOG_HEAP_INIT_PAGE, XLOG_HEAP_INPLACE, XLOG_HEAP_INSERT, XLOG_HEAP_LOCK, XLOG_HEAP_TRUNCATE, XLOG_HEAP_UPDATE, and XLR_INFO_MASK.
void heap_mask | ( | char * | pagedata, |
BlockNumber | blkno | ||
) |
Definition at line 1267 of file heapam_xlog.c.
References HEAP_XACT_MASK, HEAP_XMAX_COMMITTED, HEAP_XMAX_INVALID, HeapTupleHeaderIsSpeculative, HeapTupleHeaderXminFrozen, ItemIdGetLength, ItemIdGetOffset, ItemIdHasStorage, ItemIdIsNormal, ItemPointerSet(), len, MASK_MARKER, mask_page_hint_bits(), mask_page_lsn_and_checksum(), mask_unused_space(), MAXALIGN, PageGetItemId(), PageGetMaxOffsetNumber(), and HeapTupleHeaderData::t_infomask.
void heap_redo | ( | XLogReaderState * | record | ) |
Definition at line 1182 of file heapam_xlog.c.
References elog, heap_xlog_confirm(), heap_xlog_delete(), heap_xlog_inplace(), heap_xlog_insert(), heap_xlog_lock(), heap_xlog_update(), PANIC, XLOG_HEAP_CONFIRM, XLOG_HEAP_DELETE, XLOG_HEAP_HOT_UPDATE, XLOG_HEAP_INPLACE, XLOG_HEAP_INSERT, XLOG_HEAP_LOCK, XLOG_HEAP_OPMASK, XLOG_HEAP_TRUNCATE, XLOG_HEAP_UPDATE, XLogRecGetInfo, and XLR_INFO_MASK.
void heap_xlog_deserialize_prune_and_freeze | ( | char * | cursor, |
uint8 | flags, | ||
int * | nplans, | ||
xlhp_freeze_plan ** | plans, | ||
OffsetNumber ** | frz_offsets, | ||
int * | nredirected, | ||
OffsetNumber ** | redirected, | ||
int * | ndead, | ||
OffsetNumber ** | nowdead, | ||
int * | nunused, | ||
OffsetNumber ** | nowunused | ||
) |
Definition at line 105 of file heapdesc.c.
References Assert, xlhp_prune_items::data, data, xlhp_freeze_plans::nplans, xlhp_prune_items::ntargets, xlhp_freeze_plans::plans, XLHP_HAS_DEAD_ITEMS, XLHP_HAS_FREEZE_PLANS, XLHP_HAS_NOW_UNUSED_ITEMS, and XLHP_HAS_REDIRECTIONS.
Referenced by heap2_desc(), and heap_xlog_prune_freeze().
void heap_xlog_logical_rewrite | ( | XLogReaderState * | r | ) |
Definition at line 1073 of file rewriteheap.c.
References CloseTransientFile(), data, data_sync_elevel(), ereport, errcode_for_file_access(), errmsg(), ERROR, fd(), ftruncate, len, LOGICAL_REWRITE_FORMAT, LSN_FORMAT_ARGS, xl_heap_rewrite_mapping::mapped_db, xl_heap_rewrite_mapping::mapped_rel, xl_heap_rewrite_mapping::mapped_xid, MAXPGPATH, xl_heap_rewrite_mapping::num_mappings, xl_heap_rewrite_mapping::offset, OpenTransientFile(), PG_BINARY, pg_fsync(), PG_LOGICAL_MAPPINGS_DIR, pg_pwrite, pgstat_report_wait_end(), pgstat_report_wait_start(), snprintf, xl_heap_rewrite_mapping::start_lsn, XLogRecGetData, and XLogRecGetXid.
Referenced by heap2_redo().
void HeapTupleHeaderAdvanceConflictHorizon | ( | HeapTupleHeader | tuple, |
TransactionId * | snapshotConflictHorizon | ||
) |
Definition at line 7811 of file heapam.c.
References HEAP_MOVED, HeapTupleHeaderGetUpdateXid, HeapTupleHeaderGetXmin, HeapTupleHeaderGetXvac, HeapTupleHeaderXminCommitted, HeapTupleHeaderXminInvalid, HeapTupleHeaderData::t_infomask, TransactionIdDidCommit(), TransactionIdFollows(), and TransactionIdPrecedes().
Referenced by heap_index_delete_tuples(), heap_page_prune_and_freeze(), and heap_prune_chain().
XLogRecPtr log_heap_visible | ( | Relation | rel, |
Buffer | heap_buffer, | ||
Buffer | vm_buffer, | ||
TransactionId | snapshotConflictHorizon, | ||
uint8 | vmflags | ||
) |
Definition at line 8642 of file heapam.c.
References Assert, BufferIsValid(), xl_heap_visible::flags, REGBUF_NO_IMAGE, REGBUF_STANDARD, RelationIsAccessibleInLogicalDecoding, SizeOfHeapVisible, xl_heap_visible::snapshotConflictHorizon, VISIBILITYMAP_XLOG_CATALOG_REL, XLOG_HEAP2_VISIBLE, XLogBeginInsert(), XLogHintBitIsNeeded, XLogInsert(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by visibilitymap_set().