PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/bufmask.h"
#include "access/nbtree.h"
#include "access/nbtxlog.h"
#include "access/transam.h"
#include "access/xlogutils.h"
#include "storage/standby.h"
#include "utils/memutils.h"
Go to the source code of this file.
Variables | |
static MemoryContext | opCtx |
|
static |
Definition at line 139 of file nbtxlog.c.
References Assert, BLK_NEEDS_REDO, BTP_INCOMPLETE_SPLIT, BTPageGetOpaque, BTPageOpaqueData::btpo_flags, buf, BufferGetPage(), BufferIsValid(), XLogReaderState::EndRecPtr, MarkBufferDirty(), P_INCOMPLETE_SPLIT, PageSetLSN(), UnlockReleaseBuffer(), and XLogReadBufferForRedo().
Referenced by btree_xlog_insert(), btree_xlog_newroot(), and btree_xlog_split().
|
static |
Definition at line 82 of file nbtxlog.c.
References _bt_pageinit(), xl_btree_metadata::allequalimage, Assert, BTMetaPageData::btm_allequalimage, BTMetaPageData::btm_fastlevel, BTMetaPageData::btm_fastroot, BTMetaPageData::btm_last_cleanup_num_delpages, BTMetaPageData::btm_last_cleanup_num_heap_tuples, BTMetaPageData::btm_level, BTMetaPageData::btm_magic, BTMetaPageData::btm_root, BTMetaPageData::btm_version, BTP_META, BTPageGetMeta, BTPageGetOpaque, BTPageOpaqueData::btpo_flags, BTREE_MAGIC, BTREE_METAPAGE, BTREE_NOVAC_VERSION, BufferGetBlockNumber(), BufferGetPage(), BufferGetPageSize(), XLogReaderState::EndRecPtr, xl_btree_metadata::fastlevel, xl_btree_metadata::fastroot, xl_btree_metadata::last_cleanup_num_delpages, len, xl_btree_metadata::level, MarkBufferDirty(), PageSetLSN(), xl_btree_metadata::root, UnlockReleaseBuffer(), xl_btree_metadata::version, XLogInitBufferForRedo(), and XLogRecGetBlockData().
Referenced by btree_redo(), btree_xlog_insert(), btree_xlog_newroot(), and btree_xlog_unlink_page().
|
static |
Definition at line 36 of file nbtxlog.c.
References elog, i, IndexTupleSize, InvalidOffsetNumber, items, len, MAXALIGN, MaxIndexTuplesPerPage, nitems, PageAddItem, and PANIC.
Referenced by btree_xlog_newroot(), and btree_xlog_split().
void btree_mask | ( | char * | pagedata, |
BlockNumber | blkno | ||
) |
Definition at line 1091 of file nbtxlog.c.
References BTP_HAS_GARBAGE, BTP_SPLIT_END, BTPageGetOpaque, BTPageOpaqueData::btpo_cycleid, BTPageOpaqueData::btpo_flags, mask_lp_flags(), mask_page_hint_bits(), mask_page_lsn_and_checksum(), mask_unused_space(), and P_ISLEAF.
void btree_redo | ( | XLogReaderState * | record | ) |
Definition at line 1014 of file nbtxlog.c.
References _bt_restore_meta(), btree_xlog_dedup(), btree_xlog_delete(), btree_xlog_insert(), btree_xlog_mark_page_halfdead(), btree_xlog_newroot(), btree_xlog_reuse_page(), btree_xlog_split(), btree_xlog_unlink_page(), btree_xlog_vacuum(), elog, MemoryContextReset(), MemoryContextSwitchTo(), opCtx, PANIC, XLOG_BTREE_DEDUP, XLOG_BTREE_DELETE, XLOG_BTREE_INSERT_LEAF, XLOG_BTREE_INSERT_META, XLOG_BTREE_INSERT_POST, XLOG_BTREE_INSERT_UPPER, XLOG_BTREE_MARK_PAGE_HALFDEAD, XLOG_BTREE_META_CLEANUP, XLOG_BTREE_NEWROOT, XLOG_BTREE_REUSE_PAGE, XLOG_BTREE_SPLIT_L, XLOG_BTREE_SPLIT_R, XLOG_BTREE_UNLINK_PAGE, XLOG_BTREE_UNLINK_PAGE_META, XLOG_BTREE_VACUUM, XLogRecGetInfo, and XLR_INFO_MASK.
void btree_xlog_cleanup | ( | void | ) |
|
static |
Definition at line 464 of file nbtxlog.c.
References _bt_dedup_finish_pending(), _bt_dedup_save_htid(), _bt_dedup_start_pending(), Assert, BLK_NEEDS_REDO, BTMaxItemSize, BTP_HAS_GARBAGE, BTPageGetOpaque, BTPageOpaqueData::btpo_flags, buf, BufferGetPage(), BufferIsValid(), elog, XLogReaderState::EndRecPtr, ERROR, intervals, InvalidOffsetNumber, ItemIdGetLength, MarkBufferDirty(), xl_btree_dedup::nintervals, OffsetNumberNext, P_FIRSTDATAKEY, P_HAS_GARBAGE, P_HIKEY, P_RIGHTMOST, PageAddItem, PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PageGetTempPageCopySpecial(), PageRestoreTempPage(), PageSetLSN(), palloc(), UnlockReleaseBuffer(), XLogReadBufferForRedo(), XLogRecGetBlockData(), and XLogRecGetData.
Referenced by btree_redo().
|
static |
Definition at line 651 of file nbtxlog.c.
References BLK_NEEDS_REDO, BTP_HAS_GARBAGE, BTPageGetOpaque, BTPageOpaqueData::btpo_flags, btree_xlog_updates(), BufferGetPage(), BufferIsValid(), XLogReaderState::EndRecPtr, InHotStandby, xl_btree_delete::isCatalogRel, MarkBufferDirty(), xl_btree_delete::ndeleted, xl_btree_delete::nupdated, PageIndexMultiDelete(), PageSetLSN(), ResolveRecoveryConflictWithSnapshot(), xl_btree_delete::snapshotConflictHorizon, UnlockReleaseBuffer(), XLogReadBufferForRedo(), XLogRecGetBlockData(), XLogRecGetBlockTag(), and XLogRecGetData.
Referenced by btree_redo().
|
static |
Definition at line 160 of file nbtxlog.c.
References _bt_clear_incomplete_split(), _bt_restore_meta(), _bt_swap_posting(), Assert, BLK_NEEDS_REDO, BufferGetPage(), BufferIsValid(), CopyIndexTuple(), elog, XLogReaderState::EndRecPtr, IndexTupleSize, InvalidOffsetNumber, MarkBufferDirty(), MAXALIGN, xl_btree_insert::offnum, OffsetNumberPrev, PageAddItem, PageGetItem(), PageGetItemId(), PageSetLSN(), PANIC, UnlockReleaseBuffer(), XLogReadBufferForRedo(), XLogRecGetBlockData(), and XLogRecGetData.
Referenced by btree_redo().
|
static |
Definition at line 713 of file nbtxlog.c.
References _bt_pageinit(), BLK_NEEDS_REDO, BTP_HALF_DEAD, BTP_LEAF, BTPageGetOpaque, BTPageOpaqueData::btpo_cycleid, BTPageOpaqueData::btpo_flags, BTPageOpaqueData::btpo_level, BTPageOpaqueData::btpo_next, BTPageOpaqueData::btpo_prev, BTreeTupleGetDownLink(), BTreeTupleSetDownLink(), BTreeTupleSetTopParent(), BufferGetPage(), BufferGetPageSize(), BufferIsValid(), elog, XLogReaderState::EndRecPtr, ERROR, InvalidOffsetNumber, xl_btree_mark_page_halfdead::leftblk, MarkBufferDirty(), MemSet, OffsetNumberNext, P_HIKEY, PageAddItem, PageGetItem(), PageGetItemId(), PageIndexTupleDelete(), PageSetLSN(), xl_btree_mark_page_halfdead::poffset, xl_btree_mark_page_halfdead::rightblk, IndexTupleData::t_info, xl_btree_mark_page_halfdead::topparent, UnlockReleaseBuffer(), XLogInitBufferForRedo(), XLogReadBufferForRedo(), and XLogRecGetData.
Referenced by btree_redo().
|
static |
Definition at line 937 of file nbtxlog.c.
References _bt_clear_incomplete_split(), _bt_pageinit(), _bt_restore_meta(), _bt_restore_page(), BTP_LEAF, BTP_ROOT, BTPageGetOpaque, BTPageOpaqueData::btpo_cycleid, BTPageOpaqueData::btpo_flags, BTPageOpaqueData::btpo_level, BTPageOpaqueData::btpo_next, BTPageOpaqueData::btpo_prev, BufferGetPage(), BufferGetPageSize(), XLogReaderState::EndRecPtr, len, xl_btree_newroot::level, MarkBufferDirty(), P_NONE, PageSetLSN(), UnlockReleaseBuffer(), XLogInitBufferForRedo(), XLogRecGetBlockData(), and XLogRecGetData.
Referenced by btree_redo().
|
static |
Definition at line 1003 of file nbtxlog.c.
References InHotStandby, xl_btree_reuse_page::isCatalogRel, xl_btree_reuse_page::locator, ResolveRecoveryConflictWithSnapshotFullXid(), xl_btree_reuse_page::snapshotConflictHorizon, and XLogRecGetData.
Referenced by btree_redo().
|
static |
Definition at line 251 of file nbtxlog.c.
References _bt_clear_incomplete_split(), _bt_pageinit(), _bt_restore_page(), _bt_swap_posting(), Assert, BLK_NEEDS_REDO, BTP_INCOMPLETE_SPLIT, BTP_LEAF, BTPageGetOpaque, BTPageOpaqueData::btpo_cycleid, BTPageOpaqueData::btpo_flags, BTPageOpaqueData::btpo_level, BTPageOpaqueData::btpo_next, BTPageOpaqueData::btpo_prev, buf, BufferGetPage(), BufferGetPageSize(), BufferIsValid(), CopyIndexTuple(), elog, XLogReaderState::EndRecPtr, ERROR, xl_btree_split::firstrightoff, IndexTupleSize, InvalidOffsetNumber, ItemIdGetLength, xl_btree_split::level, MarkBufferDirty(), MAXALIGN, xl_btree_split::newitemoff, OffsetNumberNext, OffsetNumberPrev, P_FIRSTDATAKEY, P_HIKEY, P_NONE, PageAddItem, PageGetItem(), PageGetItemId(), PageGetTempPageCopySpecial(), PageRestoreTempPage(), PageSetLSN(), xl_btree_split::postingoff, UnlockReleaseBuffer(), XLogInitBufferForRedo(), XLogReadBufferForRedo(), XLogRecGetBlockData(), XLogRecGetBlockTag(), XLogRecGetBlockTagExtended(), and XLogRecGetData.
Referenced by btree_redo().
void btree_xlog_startup | ( | void | ) |
Definition at line 1073 of file nbtxlog.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CurrentMemoryContext, and opCtx.
|
static |
Definition at line 798 of file nbtxlog.c.
References _bt_pageinit(), _bt_restore_meta(), Assert, BLK_NEEDS_REDO, BlockNumberIsValid(), BTP_HALF_DEAD, BTP_LEAF, BTPageGetOpaque, BTPageSetDeleted(), BTPageOpaqueData::btpo_cycleid, BTPageOpaqueData::btpo_flags, BTPageOpaqueData::btpo_level, BTPageOpaqueData::btpo_next, BTPageOpaqueData::btpo_prev, BTreeTupleSetTopParent(), BufferGetPage(), BufferGetPageSize(), BufferIsValid(), elog, XLogReaderState::EndRecPtr, ERROR, InvalidBuffer, InvalidOffsetNumber, xl_btree_unlink_page::leafleftsib, xl_btree_unlink_page::leafrightsib, xl_btree_unlink_page::leaftopparent, xl_btree_unlink_page::leftsib, xl_btree_unlink_page::level, MarkBufferDirty(), MemSet, P_HIKEY, P_NONE, PageAddItem, PageSetLSN(), xl_btree_unlink_page::rightsib, xl_btree_unlink_page::safexid, IndexTupleData::t_info, UnlockReleaseBuffer(), XLOG_BTREE_UNLINK_PAGE_META, XLogInitBufferForRedo(), XLogReadBufferForRedo(), XLogRecGetData, and XLogRecHasBlockRef.
Referenced by btree_redo().
|
static |
Definition at line 557 of file nbtxlog.c.
References _bt_update_posting(), BTVacuumPostingData::deletetids, elog, i, IndexTupleSize, BTVacuumPostingData::itup, MAXALIGN, BTVacuumPostingData::ndeletedtids, xl_btree_update::ndeletedtids, PageGetItem(), PageGetItemId(), PageIndexTupleOverwrite(), palloc(), PANIC, pfree(), SizeOfBtreeUpdate, and BTVacuumPostingData::updatedoffset.
Referenced by btree_xlog_delete(), and btree_xlog_vacuum().
|
static |
Definition at line 598 of file nbtxlog.c.
References BLK_NEEDS_REDO, BTP_HAS_GARBAGE, BTPageGetOpaque, BTPageOpaqueData::btpo_flags, btree_xlog_updates(), BufferGetPage(), BufferIsValid(), XLogReaderState::EndRecPtr, MarkBufferDirty(), xl_btree_vacuum::ndeleted, xl_btree_vacuum::nupdated, PageIndexMultiDelete(), PageSetLSN(), RBM_NORMAL, UnlockReleaseBuffer(), XLogReadBufferForRedoExtended(), XLogRecGetBlockData(), and XLogRecGetData.
Referenced by btree_redo().
|
static |
Definition at line 25 of file nbtxlog.c.
Referenced by btree_redo(), btree_xlog_cleanup(), and btree_xlog_startup().