64 memcpy(&snapshot_conflict_horizon, maindataptr,
sizeof(
TransactionId));
95 &nplans, &plans, &frz_offsets,
96 &nredirected, &redirected,
98 &nunused, &nowunused);
104 if (nredirected > 0 || ndead > 0 || nunused > 0)
107 redirected, nredirected,
112 for (
int p = 0; p < nplans; p++)
139 Assert((
char *) frz_offsets == dataptr + datalen);
321 *infomask2 &= ~HEAP_KEYS_UPDATED;
405 htup->
t_ctid = target_tid;
477 elog(
PANIC,
"invalid max offset number");
493 htup->t_infomask2 = xlhdr.t_infomask2;
494 htup->t_infomask = xlhdr.t_infomask;
495 htup->t_hoff = xlhdr.t_hoff;
498 htup->t_ctid = target_tid;
601 endptr = tupdata +
len;
620 elog(
PANIC,
"invalid max offset number");
638 htup->t_hoff = xlhdr->
t_hoff;
648 if (tupdata != endptr)
649 elog(
PANIC,
"total tuple length mismatch");
797 if (oldblk == newblk)
800 newaction = oldaction;
836 recdata_end = recdata + datalen;
842 elog(
PANIC,
"invalid max offset number");
847 memcpy(&prefixlen, recdata,
sizeof(
uint16));
848 recdata +=
sizeof(
uint16);
853 memcpy(&suffixlen, recdata,
sizeof(
uint16));
854 recdata +=
sizeof(
uint16);
860 tuplen = recdata_end - recdata;
877 memcpy(newp, recdata,
len);
887 memcpy(newp, recdata,
len);
897 memcpy(newp, recdata, tuplen);
901 Assert(recdata == recdata_end);
905 memcpy(newp, (
char *) oldtup.
t_data + oldtup.
t_len - suffixlen, suffixlen);
908 htup->t_infomask2 = xlhdr.t_infomask2;
909 htup->t_infomask = xlhdr.t_infomask;
910 htup->t_hoff = xlhdr.t_hoff;
916 htup->t_ctid = newtid;
951 if (newaction ==
BLK_NEEDS_REDO && !hot_update && freespace < BLCKSZ / 5)
1163 if (oldlen != newlen)
1166 memcpy((
char *) htup + htup->
t_hoff, newtup, newlen);
1223 elog(
PANIC,
"heap_redo: unknown op code %u", info);
1259 elog(
PANIC,
"heap2_redo: unknown op code %u", info);
1306 page_htup->t_choice.t_heap.t_field3.t_cid =
MASK_MARKER;
void mask_page_lsn_and_checksum(Page page)
void mask_unused_space(Page page)
void mask_page_hint_bits(Page page)
BlockNumber BufferGetBlockNumber(Buffer buffer)
void ReleaseBuffer(Buffer buffer)
void UnlockReleaseBuffer(Buffer buffer)
void MarkBufferDirty(Buffer buffer)
void LockBuffer(Buffer buffer, int mode)
#define BUFFER_LOCK_UNLOCK
static Page BufferGetPage(Buffer buffer)
static Size BufferGetPageSize(Buffer buffer)
static bool BufferIsValid(Buffer bufnum)
Size PageGetHeapFreeSpace(Page page)
void PageInit(Page page, Size pageSize, Size specialSize)
Size PageGetFreeSpace(Page page)
static Item PageGetItem(Page page, ItemId itemId)
static void PageClearAllVisible(Page page)
static void PageSetAllVisible(Page page)
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
static bool PageIsNew(Page page)
static void PageSetLSN(Page page, XLogRecPtr lsn)
static OffsetNumber PageGetMaxOffsetNumber(Page page)
#define PageSetPrunable(page, xid)
#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap)
#define Assert(condition)
#define MemSet(start, val, len)
void XLogRecordPageWithFreeSpace(RelFileLocator rlocator, BlockNumber heapBlk, Size spaceAvail)
static void heap_execute_freeze_tuple(HeapTupleHeader tuple, HeapTupleFreeze *frz)
void heap_redo(XLogReaderState *record)
static void heap_xlog_prune_freeze(XLogReaderState *record)
void heap_mask(char *pagedata, BlockNumber blkno)
static void heap_xlog_insert(XLogReaderState *record)
static void fix_infomask_from_infobits(uint8 infobits, uint16 *infomask, uint16 *infomask2)
static void heap_xlog_update(XLogReaderState *record, bool hot_update)
static void heap_xlog_delete(XLogReaderState *record)
static void heap_xlog_lock_updated(XLogReaderState *record)
static void heap_xlog_lock(XLogReaderState *record)
static void heap_xlog_multi_insert(XLogReaderState *record)
static void heap_xlog_visible(XLogReaderState *record)
static void heap_xlog_inplace(XLogReaderState *record)
static void heap_xlog_confirm(XLogReaderState *record)
void heap2_redo(XLogReaderState *record)
#define XLOG_HEAP2_MULTI_INSERT
#define XLH_UPDATE_NEW_ALL_VISIBLE_CLEARED
#define XLOG_HEAP_HOT_UPDATE
#define XLHP_HAS_CONFLICT_HORIZON
#define XLOG_HEAP2_REWRITE
#define XLH_LOCK_ALL_FROZEN_CLEARED
#define XLOG_HEAP_TRUNCATE
#define XLH_INSERT_ALL_FROZEN_SET
#define XLHL_XMAX_KEYSHR_LOCK
#define XLH_DELETE_ALL_VISIBLE_CLEARED
#define XLHP_HAS_NOW_UNUSED_ITEMS
#define XLHL_XMAX_IS_MULTI
#define XLHP_HAS_REDIRECTIONS
#define XLH_INSERT_ALL_VISIBLE_CLEARED
#define XLOG_HEAP2_PRUNE_VACUUM_SCAN
#define XLH_DELETE_IS_PARTITION_MOVE
#define XLH_UPDATE_OLD_ALL_VISIBLE_CLEARED
#define XLHL_XMAX_LOCK_ONLY
#define XLOG_HEAP_INPLACE
#define XLOG_HEAP2_LOCK_UPDATED
#define XLH_UPDATE_SUFFIX_FROM_OLD
#define XLH_UPDATE_PREFIX_FROM_OLD
#define SizeOfMultiInsertTuple
#define XLHL_XMAX_EXCL_LOCK
#define XLOG_HEAP2_PRUNE_ON_ACCESS
#define XLOG_HEAP2_NEW_CID
#define XLHP_CLEANUP_LOCK
#define XLHP_HAS_DEAD_ITEMS
#define XLOG_HEAP2_PRUNE_VACUUM_CLEANUP
#define XLH_DELETE_IS_SUPER
#define XLHL_KEYS_UPDATED
#define XLOG_HEAP2_VISIBLE
#define XLHP_IS_CATALOG_REL
#define XLOG_HEAP_INIT_PAGE
#define XLOG_HEAP_CONFIRM
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)
HeapTupleHeaderData * HeapTupleHeader
#define HEAP_XMAX_IS_LOCKED_ONLY(infomask)
#define SizeofHeapTupleHeader
#define HEAP_KEYS_UPDATED
#define HeapTupleHeaderSetXmin(tup, xid)
#define HeapTupleHeaderSetXmax(tup, xid)
#define HEAP_XMAX_LOCK_ONLY
#define HeapTupleHeaderClearHotUpdated(tup)
#define HeapTupleHeaderSetCmin(tup, cid)
#define HeapTupleHeaderSetHotUpdated(tup)
#define HEAP_XMAX_IS_MULTI
#define HEAP_XMAX_COMMITTED
#define HeapTupleHeaderXminFrozen(tup)
#define HEAP_XMAX_EXCL_LOCK
#define HEAP_XMAX_INVALID
#define HeapTupleHeaderSetMovedPartitions(tup)
#define HEAP_XMAX_KEYSHR_LOCK
#define HeapTupleHeaderIsSpeculative(tup)
#define HeapTupleHeaderSetCmax(tup, cid, iscombo)
void ProcessCommittedInvalidationMessages(SharedInvalidationMessage *msgs, int nmsgs, bool RelcacheInitFileInval, Oid dbid, Oid tsid)
#define ItemIdGetLength(itemId)
#define ItemIdIsNormal(itemId)
#define ItemIdGetOffset(itemId)
#define ItemIdHasStorage(itemId)
static void ItemPointerSet(ItemPointerData *pointer, BlockNumber blockNumber, OffsetNumber offNum)
static void ItemPointerSetOffsetNumber(ItemPointerData *pointer, OffsetNumber offsetNumber)
static void ItemPointerSetBlockNumber(ItemPointerData *pointer, BlockNumber blockNumber)
#define InvalidOffsetNumber
#define FirstOffsetNumber
void heap_page_prune_execute(Buffer buffer, bool lp_truncate_only, OffsetNumber *redirected, int nredirected, OffsetNumber *nowdead, int ndead, OffsetNumber *nowunused, int nunused)
void heap_xlog_logical_rewrite(XLogReaderState *r)
void ResolveRecoveryConflictWithSnapshot(TransactionId snapshotConflictHorizon, bool isCatalogRel, RelFileLocator locator)
SharedInvalidationMessage msgs[FLEXIBLE_ARRAY_MEMBER]
bool relcacheInitFileInval
OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER]
TransactionId snapshotConflictHorizon
#define InvalidTransactionId
bool visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer vmbuf, uint8 flags)
void visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
uint8 visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf, XLogRecPtr recptr, Buffer vmBuf, TransactionId cutoff_xid, uint8 flags)
#define VISIBILITYMAP_VALID_BITS
#define VISIBILITYMAP_ALL_FROZEN
#define VISIBILITYMAP_XLOG_VALID_BITS
#define VISIBILITYMAP_XLOG_CATALOG_REL
#define XLogHintBitIsNeeded()
bool XLogRecGetBlockTagExtended(XLogReaderState *record, uint8 block_id, RelFileLocator *rlocator, ForkNumber *forknum, BlockNumber *blknum, Buffer *prefetch_buffer)
char * XLogRecGetBlockData(XLogReaderState *record, uint8 block_id, Size *len)
void XLogRecGetBlockTag(XLogReaderState *record, uint8 block_id, RelFileLocator *rlocator, ForkNumber *forknum, BlockNumber *blknum)
#define XLogRecGetInfo(decoder)
#define XLogRecGetData(decoder)
#define XLogRecGetXid(decoder)
void FreeFakeRelcacheEntry(Relation fakerel)
XLogRedoAction XLogReadBufferForRedo(XLogReaderState *record, uint8 block_id, Buffer *buf)
Buffer XLogInitBufferForRedo(XLogReaderState *record, uint8 block_id)
Relation CreateFakeRelcacheEntry(RelFileLocator rlocator)
XLogRedoAction XLogReadBufferForRedoExtended(XLogReaderState *record, uint8 block_id, ReadBufferMode mode, bool get_cleanup_lock, Buffer *buf)