PostgreSQL Source Code  git master
nbtxlog.h File Reference
#include "access/transam.h"
#include "access/xlogreader.h"
#include "lib/stringinfo.h"
#include "storage/off.h"
Include dependency graph for nbtxlog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  xl_btree_metadata
 
struct  xl_btree_insert
 
struct  xl_btree_split
 
struct  xl_btree_dedup
 
struct  xl_btree_reuse_page
 
struct  xl_btree_vacuum
 
struct  xl_btree_delete
 
struct  xl_btree_update
 
struct  xl_btree_mark_page_halfdead
 
struct  xl_btree_unlink_page
 
struct  xl_btree_newroot
 

Macros

#define XLOG_BTREE_INSERT_LEAF   0x00 /* add index tuple without split */
 
#define XLOG_BTREE_INSERT_UPPER   0x10 /* same, on a non-leaf page */
 
#define XLOG_BTREE_INSERT_META   0x20 /* same, plus update metapage */
 
#define XLOG_BTREE_SPLIT_L   0x30 /* add index tuple with split */
 
#define XLOG_BTREE_SPLIT_R   0x40 /* as above, new item on right */
 
#define XLOG_BTREE_INSERT_POST   0x50 /* add index tuple with posting split */
 
#define XLOG_BTREE_DEDUP   0x60 /* deduplicate tuples for a page */
 
#define XLOG_BTREE_DELETE   0x70 /* delete leaf index tuples for a page */
 
#define XLOG_BTREE_UNLINK_PAGE   0x80 /* delete a half-dead page */
 
#define XLOG_BTREE_UNLINK_PAGE_META   0x90 /* same, and update metapage */
 
#define XLOG_BTREE_NEWROOT   0xA0 /* new root page */
 
#define XLOG_BTREE_MARK_PAGE_HALFDEAD   0xB0 /* mark a leaf as half-dead */
 
#define XLOG_BTREE_VACUUM
 
#define XLOG_BTREE_REUSE_PAGE
 
#define XLOG_BTREE_META_CLEANUP
 
#define SizeOfBtreeInsert   (offsetof(xl_btree_insert, offnum) + sizeof(OffsetNumber))
 
#define SizeOfBtreeSplit   (offsetof(xl_btree_split, postingoff) + sizeof(uint16))
 
#define SizeOfBtreeDedup   (offsetof(xl_btree_dedup, nintervals) + sizeof(uint16))
 
#define SizeOfBtreeReusePage   (offsetof(xl_btree_reuse_page, isCatalogRel) + sizeof(bool))
 
#define SizeOfBtreeVacuum   (offsetof(xl_btree_vacuum, nupdated) + sizeof(uint16))
 
#define SizeOfBtreeDelete   (offsetof(xl_btree_delete, isCatalogRel) + sizeof(bool))
 
#define SizeOfBtreeUpdate   (offsetof(xl_btree_update, ndeletedtids) + sizeof(uint16))
 
#define SizeOfBtreeMarkPageHalfDead   (offsetof(xl_btree_mark_page_halfdead, topparent) + sizeof(BlockNumber))
 
#define SizeOfBtreeUnlinkPage   (offsetof(xl_btree_unlink_page, leaftopparent) + sizeof(BlockNumber))
 
#define SizeOfBtreeNewroot   (offsetof(xl_btree_newroot, level) + sizeof(uint32))
 

Typedefs

typedef struct xl_btree_metadata xl_btree_metadata
 
typedef struct xl_btree_insert xl_btree_insert
 
typedef struct xl_btree_split xl_btree_split
 
typedef struct xl_btree_dedup xl_btree_dedup
 
typedef struct xl_btree_reuse_page xl_btree_reuse_page
 
typedef struct xl_btree_vacuum xl_btree_vacuum
 
typedef struct xl_btree_delete xl_btree_delete
 
typedef struct xl_btree_update xl_btree_update
 
typedef struct xl_btree_mark_page_halfdead xl_btree_mark_page_halfdead
 
typedef struct xl_btree_unlink_page xl_btree_unlink_page
 
typedef struct xl_btree_newroot xl_btree_newroot
 

Functions

void btree_redo (XLogReaderState *record)
 
void btree_xlog_startup (void)
 
void btree_xlog_cleanup (void)
 
void btree_mask (char *pagedata, BlockNumber blkno)
 
void btree_desc (StringInfo buf, XLogReaderState *record)
 
const char * btree_identify (uint8 info)
 

Macro Definition Documentation

◆ SizeOfBtreeDedup

#define SizeOfBtreeDedup   (offsetof(xl_btree_dedup, nintervals) + sizeof(uint16))

Definition at line 174 of file nbtxlog.h.

◆ SizeOfBtreeDelete

#define SizeOfBtreeDelete   (offsetof(xl_btree_delete, isCatalogRel) + sizeof(bool))

Definition at line 253 of file nbtxlog.h.

◆ SizeOfBtreeInsert

#define SizeOfBtreeInsert   (offsetof(xl_btree_insert, offnum) + sizeof(OffsetNumber))

Definition at line 84 of file nbtxlog.h.

◆ SizeOfBtreeMarkPageHalfDead

#define SizeOfBtreeMarkPageHalfDead   (offsetof(xl_btree_mark_page_halfdead, topparent) + sizeof(BlockNumber))

Definition at line 291 of file nbtxlog.h.

◆ SizeOfBtreeNewroot

#define SizeOfBtreeNewroot   (offsetof(xl_btree_newroot, level) + sizeof(uint32))

Definition at line 347 of file nbtxlog.h.

◆ SizeOfBtreeReusePage

#define SizeOfBtreeReusePage   (offsetof(xl_btree_reuse_page, isCatalogRel) + sizeof(bool))

Definition at line 192 of file nbtxlog.h.

◆ SizeOfBtreeSplit

#define SizeOfBtreeSplit   (offsetof(xl_btree_split, postingoff) + sizeof(uint16))

Definition at line 158 of file nbtxlog.h.

◆ SizeOfBtreeUnlinkPage

#define SizeOfBtreeUnlinkPage   (offsetof(xl_btree_unlink_page, leaftopparent) + sizeof(BlockNumber))

Definition at line 328 of file nbtxlog.h.

◆ SizeOfBtreeUpdate

#define SizeOfBtreeUpdate   (offsetof(xl_btree_update, ndeletedtids) + sizeof(uint16))

Definition at line 268 of file nbtxlog.h.

◆ SizeOfBtreeVacuum

#define SizeOfBtreeVacuum   (offsetof(xl_btree_vacuum, nupdated) + sizeof(uint16))

Definition at line 234 of file nbtxlog.h.

◆ XLOG_BTREE_DEDUP

#define XLOG_BTREE_DEDUP   0x60 /* deduplicate tuples for a page */

Definition at line 33 of file nbtxlog.h.

◆ XLOG_BTREE_DELETE

#define XLOG_BTREE_DELETE   0x70 /* delete leaf index tuples for a page */

Definition at line 34 of file nbtxlog.h.

◆ XLOG_BTREE_INSERT_LEAF

#define XLOG_BTREE_INSERT_LEAF   0x00 /* add index tuple without split */

Definition at line 27 of file nbtxlog.h.

◆ XLOG_BTREE_INSERT_META

#define XLOG_BTREE_INSERT_META   0x20 /* same, plus update metapage */

Definition at line 29 of file nbtxlog.h.

◆ XLOG_BTREE_INSERT_POST

#define XLOG_BTREE_INSERT_POST   0x50 /* add index tuple with posting split */

Definition at line 32 of file nbtxlog.h.

◆ XLOG_BTREE_INSERT_UPPER

#define XLOG_BTREE_INSERT_UPPER   0x10 /* same, on a non-leaf page */

Definition at line 28 of file nbtxlog.h.

◆ XLOG_BTREE_MARK_PAGE_HALFDEAD

#define XLOG_BTREE_MARK_PAGE_HALFDEAD   0xB0 /* mark a leaf as half-dead */

Definition at line 38 of file nbtxlog.h.

◆ XLOG_BTREE_META_CLEANUP

#define XLOG_BTREE_META_CLEANUP
Value:
0xE0 /* update cleanup-related data in the
* metapage */

Definition at line 41 of file nbtxlog.h.

◆ XLOG_BTREE_NEWROOT

#define XLOG_BTREE_NEWROOT   0xA0 /* new root page */

Definition at line 37 of file nbtxlog.h.

◆ XLOG_BTREE_REUSE_PAGE

#define XLOG_BTREE_REUSE_PAGE
Value:
0xD0 /* old page is about to be reused from
* FSM */

Definition at line 40 of file nbtxlog.h.

◆ XLOG_BTREE_SPLIT_L

#define XLOG_BTREE_SPLIT_L   0x30 /* add index tuple with split */

Definition at line 30 of file nbtxlog.h.

◆ XLOG_BTREE_SPLIT_R

#define XLOG_BTREE_SPLIT_R   0x40 /* as above, new item on right */

Definition at line 31 of file nbtxlog.h.

◆ XLOG_BTREE_UNLINK_PAGE

#define XLOG_BTREE_UNLINK_PAGE   0x80 /* delete a half-dead page */

Definition at line 35 of file nbtxlog.h.

◆ XLOG_BTREE_UNLINK_PAGE_META

#define XLOG_BTREE_UNLINK_PAGE_META   0x90 /* same, and update metapage */

Definition at line 36 of file nbtxlog.h.

◆ XLOG_BTREE_VACUUM

#define XLOG_BTREE_VACUUM
Value:
0xC0 /* delete entries on a page during
* vacuum */

Definition at line 39 of file nbtxlog.h.

Typedef Documentation

◆ xl_btree_dedup

◆ xl_btree_delete

◆ xl_btree_insert

◆ xl_btree_mark_page_halfdead

◆ xl_btree_metadata

◆ xl_btree_newroot

◆ xl_btree_reuse_page

◆ xl_btree_split

◆ xl_btree_unlink_page

◆ xl_btree_update

◆ xl_btree_vacuum

Function Documentation

◆ btree_desc()

void btree_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 24 of file nbtdesc.c.

25 {
26  char *rec = XLogRecGetData(record);
27  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
28 
29  switch (info)
30  {
35  {
36  xl_btree_insert *xlrec = (xl_btree_insert *) rec;
37 
38  appendStringInfo(buf, "off: %u", xlrec->offnum);
39  break;
40  }
41  case XLOG_BTREE_SPLIT_L:
42  case XLOG_BTREE_SPLIT_R:
43  {
44  xl_btree_split *xlrec = (xl_btree_split *) rec;
45 
46  appendStringInfo(buf, "level: %u, firstrightoff: %d, newitemoff: %d, postingoff: %d",
47  xlrec->level, xlrec->firstrightoff,
48  xlrec->newitemoff, xlrec->postingoff);
49  break;
50  }
51  case XLOG_BTREE_DEDUP:
52  {
53  xl_btree_dedup *xlrec = (xl_btree_dedup *) rec;
54 
55  appendStringInfo(buf, "nintervals: %u", xlrec->nintervals);
56  break;
57  }
58  case XLOG_BTREE_VACUUM:
59  {
60  xl_btree_vacuum *xlrec = (xl_btree_vacuum *) rec;
61 
62  appendStringInfo(buf, "ndeleted: %u, nupdated: %u",
63  xlrec->ndeleted, xlrec->nupdated);
64 
65  if (XLogRecHasBlockData(record, 0))
66  delvacuum_desc(buf, XLogRecGetBlockData(record, 0, NULL),
67  xlrec->ndeleted, xlrec->nupdated);
68  break;
69  }
70  case XLOG_BTREE_DELETE:
71  {
72  xl_btree_delete *xlrec = (xl_btree_delete *) rec;
73 
74  appendStringInfo(buf, "snapshotConflictHorizon: %u, ndeleted: %u, nupdated: %u",
76  xlrec->ndeleted, xlrec->nupdated);
77 
78  if (XLogRecHasBlockData(record, 0))
79  delvacuum_desc(buf, XLogRecGetBlockData(record, 0, NULL),
80  xlrec->ndeleted, xlrec->nupdated);
81  break;
82  }
84  {
86 
87  appendStringInfo(buf, "topparent: %u, leaf: %u, left: %u, right: %u",
88  xlrec->topparent, xlrec->leafblk, xlrec->leftblk, xlrec->rightblk);
89  break;
90  }
93  {
95 
96  appendStringInfo(buf, "left: %u, right: %u, level: %u, safexid: %u:%u, ",
97  xlrec->leftsib, xlrec->rightsib, xlrec->level,
100  appendStringInfo(buf, "leafleft: %u, leafright: %u, leaftopparent: %u",
101  xlrec->leafleftsib, xlrec->leafrightsib,
102  xlrec->leaftopparent);
103  break;
104  }
105  case XLOG_BTREE_NEWROOT:
106  {
107  xl_btree_newroot *xlrec = (xl_btree_newroot *) rec;
108 
109  appendStringInfo(buf, "level: %u", xlrec->level);
110  break;
111  }
113  {
114  xl_btree_reuse_page *xlrec = (xl_btree_reuse_page *) rec;
115 
116  appendStringInfo(buf, "rel: %u/%u/%u, snapshotConflictHorizon: %u:%u",
117  xlrec->locator.spcOid, xlrec->locator.dbOid,
118  xlrec->locator.relNumber,
121  break;
122  }
124  {
125  xl_btree_metadata *xlrec;
126 
127  xlrec = (xl_btree_metadata *) XLogRecGetBlockData(record, 0,
128  NULL);
129  appendStringInfo(buf, "last_cleanup_num_delpages: %u",
131  break;
132  }
133  }
134 }
unsigned char uint8
Definition: c.h:493
static void delvacuum_desc(StringInfo buf, char *block_data, uint16 ndeleted, uint16 nupdated)
Definition: nbtdesc.c:194
#define XLOG_BTREE_META_CLEANUP
Definition: nbtxlog.h:41
#define XLOG_BTREE_INSERT_POST
Definition: nbtxlog.h:32
#define XLOG_BTREE_VACUUM
Definition: nbtxlog.h:39
#define XLOG_BTREE_SPLIT_R
Definition: nbtxlog.h:31
#define XLOG_BTREE_INSERT_LEAF
Definition: nbtxlog.h:27
#define XLOG_BTREE_INSERT_UPPER
Definition: nbtxlog.h:28
#define XLOG_BTREE_DEDUP
Definition: nbtxlog.h:33
#define XLOG_BTREE_UNLINK_PAGE
Definition: nbtxlog.h:35
#define XLOG_BTREE_UNLINK_PAGE_META
Definition: nbtxlog.h:36
#define XLOG_BTREE_INSERT_META
Definition: nbtxlog.h:29
#define XLOG_BTREE_MARK_PAGE_HALFDEAD
Definition: nbtxlog.h:38
#define XLOG_BTREE_REUSE_PAGE
Definition: nbtxlog.h:40
#define XLOG_BTREE_SPLIT_L
Definition: nbtxlog.h:30
#define XLOG_BTREE_NEWROOT
Definition: nbtxlog.h:37
#define XLOG_BTREE_DELETE
Definition: nbtxlog.h:34
static char * buf
Definition: pg_test_fsync.c:73
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:97
RelFileNumber relNumber
uint16 nintervals
Definition: nbtxlog.h:169
TransactionId snapshotConflictHorizon
Definition: nbtxlog.h:238
uint16 ndeleted
Definition: nbtxlog.h:239
uint16 nupdated
Definition: nbtxlog.h:240
OffsetNumber offnum
Definition: nbtxlog.h:78
uint32 last_cleanup_num_delpages
Definition: nbtxlog.h:53
uint32 level
Definition: nbtxlog.h:344
FullTransactionId snapshotConflictHorizon
Definition: nbtxlog.h:187
RelFileLocator locator
Definition: nbtxlog.h:185
uint16 postingoff
Definition: nbtxlog.h:155
OffsetNumber firstrightoff
Definition: nbtxlog.h:153
uint32 level
Definition: nbtxlog.h:152
OffsetNumber newitemoff
Definition: nbtxlog.h:154
uint16 ndeleted
Definition: nbtxlog.h:222
uint16 nupdated
Definition: nbtxlog.h:223
#define EpochFromFullTransactionId(x)
Definition: transam.h:47
#define XidFromFullTransactionId(x)
Definition: transam.h:48
char * XLogRecGetBlockData(XLogReaderState *record, uint8 block_id, Size *len)
Definition: xlogreader.c:2002
#define XLogRecHasBlockData(decoder, block_id)
Definition: xlogreader.h:427
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:410
#define XLogRecGetData(decoder)
Definition: xlogreader.h:415
#define XLR_INFO_MASK
Definition: xlogrecord.h:62

References appendStringInfo(), buf, RelFileLocator::dbOid, delvacuum_desc(), EpochFromFullTransactionId, xl_btree_split::firstrightoff, xl_btree_metadata::last_cleanup_num_delpages, xl_btree_mark_page_halfdead::leafblk, xl_btree_unlink_page::leafleftsib, xl_btree_unlink_page::leafrightsib, xl_btree_unlink_page::leaftopparent, xl_btree_mark_page_halfdead::leftblk, xl_btree_unlink_page::leftsib, xl_btree_split::level, xl_btree_unlink_page::level, xl_btree_newroot::level, xl_btree_reuse_page::locator, xl_btree_vacuum::ndeleted, xl_btree_delete::ndeleted, xl_btree_split::newitemoff, xl_btree_dedup::nintervals, xl_btree_vacuum::nupdated, xl_btree_delete::nupdated, xl_btree_insert::offnum, xl_btree_split::postingoff, RelFileLocator::relNumber, xl_btree_mark_page_halfdead::rightblk, xl_btree_unlink_page::rightsib, xl_btree_unlink_page::safexid, xl_btree_reuse_page::snapshotConflictHorizon, xl_btree_delete::snapshotConflictHorizon, RelFileLocator::spcOid, xl_btree_mark_page_halfdead::topparent, XidFromFullTransactionId, 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, XLogRecGetBlockData(), XLogRecGetData, XLogRecGetInfo, XLogRecHasBlockData, and XLR_INFO_MASK.

◆ btree_identify()

const char* btree_identify ( uint8  info)

Definition at line 137 of file nbtdesc.c.

138 {
139  const char *id = NULL;
140 
141  switch (info & ~XLR_INFO_MASK)
142  {
144  id = "INSERT_LEAF";
145  break;
147  id = "INSERT_UPPER";
148  break;
150  id = "INSERT_META";
151  break;
152  case XLOG_BTREE_SPLIT_L:
153  id = "SPLIT_L";
154  break;
155  case XLOG_BTREE_SPLIT_R:
156  id = "SPLIT_R";
157  break;
159  id = "INSERT_POST";
160  break;
161  case XLOG_BTREE_DEDUP:
162  id = "DEDUP";
163  break;
164  case XLOG_BTREE_VACUUM:
165  id = "VACUUM";
166  break;
167  case XLOG_BTREE_DELETE:
168  id = "DELETE";
169  break;
171  id = "MARK_PAGE_HALFDEAD";
172  break;
174  id = "UNLINK_PAGE";
175  break;
177  id = "UNLINK_PAGE_META";
178  break;
179  case XLOG_BTREE_NEWROOT:
180  id = "NEWROOT";
181  break;
183  id = "REUSE_PAGE";
184  break;
186  id = "META_CLEANUP";
187  break;
188  }
189 
190  return id;
191 }

References 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, and XLR_INFO_MASK.

◆ btree_mask()

void btree_mask ( char *  pagedata,
BlockNumber  blkno 
)

Definition at line 1093 of file nbtxlog.c.

1094 {
1095  Page page = (Page) pagedata;
1096  BTPageOpaque maskopaq;
1097 
1099 
1100  mask_page_hint_bits(page);
1101  mask_unused_space(page);
1102 
1103  maskopaq = BTPageGetOpaque(page);
1104 
1105  if (P_ISLEAF(maskopaq))
1106  {
1107  /*
1108  * In btree leaf pages, it is possible to modify the LP_FLAGS without
1109  * emitting any WAL record. Hence, mask the line pointer flags. See
1110  * _bt_killitems(), _bt_check_unique() for details.
1111  */
1112  mask_lp_flags(page);
1113  }
1114 
1115  /*
1116  * BTP_HAS_GARBAGE is just an un-logged hint bit. So, mask it. See
1117  * _bt_delete_or_dedup_one_page(), _bt_killitems(), and _bt_check_unique()
1118  * for details.
1119  */
1120  maskopaq->btpo_flags &= ~BTP_HAS_GARBAGE;
1121 
1122  /*
1123  * During replay of a btree page split, we don't set the BTP_SPLIT_END
1124  * flag of the right sibling and initialize the cycle_id to 0 for the same
1125  * page. See btree_xlog_split() for details.
1126  */
1127  maskopaq->btpo_flags &= ~BTP_SPLIT_END;
1128  maskopaq->btpo_cycleid = 0;
1129 }
void mask_lp_flags(Page page)
Definition: bufmask.c:95
void mask_page_lsn_and_checksum(Page page)
Definition: bufmask.c:31
void mask_unused_space(Page page)
Definition: bufmask.c:71
void mask_page_hint_bits(Page page)
Definition: bufmask.c:46
Pointer Page
Definition: bufpage.h:78
#define P_ISLEAF(opaque)
Definition: nbtree.h:220
#define BTP_HAS_GARBAGE
Definition: nbtree.h:82
#define BTPageGetOpaque(page)
Definition: nbtree.h:73
#define BTP_SPLIT_END
Definition: nbtree.h:81
uint16 btpo_flags
Definition: nbtree.h:67
BTCycleId btpo_cycleid
Definition: nbtree.h:68

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.

◆ btree_redo()

void btree_redo ( XLogReaderState record)

Definition at line 1016 of file nbtxlog.c.

1017 {
1018  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
1019  MemoryContext oldCtx;
1020 
1021  oldCtx = MemoryContextSwitchTo(opCtx);
1022  switch (info)
1023  {
1025  btree_xlog_insert(true, false, false, record);
1026  break;
1028  btree_xlog_insert(false, false, false, record);
1029  break;
1031  btree_xlog_insert(false, true, false, record);
1032  break;
1033  case XLOG_BTREE_SPLIT_L:
1034  btree_xlog_split(true, record);
1035  break;
1036  case XLOG_BTREE_SPLIT_R:
1037  btree_xlog_split(false, record);
1038  break;
1040  btree_xlog_insert(true, false, true, record);
1041  break;
1042  case XLOG_BTREE_DEDUP:
1043  btree_xlog_dedup(record);
1044  break;
1045  case XLOG_BTREE_VACUUM:
1046  btree_xlog_vacuum(record);
1047  break;
1048  case XLOG_BTREE_DELETE:
1049  btree_xlog_delete(record);
1050  break;
1052  btree_xlog_mark_page_halfdead(info, record);
1053  break;
1056  btree_xlog_unlink_page(info, record);
1057  break;
1058  case XLOG_BTREE_NEWROOT:
1059  btree_xlog_newroot(record);
1060  break;
1061  case XLOG_BTREE_REUSE_PAGE:
1062  btree_xlog_reuse_page(record);
1063  break;
1065  _bt_restore_meta(record, 0);
1066  break;
1067  default:
1068  elog(PANIC, "btree_redo: unknown op code %u", info);
1069  }
1070  MemoryContextSwitchTo(oldCtx);
1072 }
#define PANIC
Definition: elog.h:42
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:330
static void btree_xlog_delete(XLogReaderState *record)
Definition: nbtxlog.c:653
static void _bt_restore_meta(XLogReaderState *record, uint8 block_id)
Definition: nbtxlog.c:84
static void btree_xlog_newroot(XLogReaderState *record)
Definition: nbtxlog.c:939
static void btree_xlog_dedup(XLogReaderState *record)
Definition: nbtxlog.c:466
static void btree_xlog_insert(bool isleaf, bool ismeta, bool posting, XLogReaderState *record)
Definition: nbtxlog.c:162
static void btree_xlog_split(bool newitemonleft, XLogReaderState *record)
Definition: nbtxlog.c:253
static void btree_xlog_reuse_page(XLogReaderState *record)
Definition: nbtxlog.c:1005
static void btree_xlog_mark_page_halfdead(uint8 info, XLogReaderState *record)
Definition: nbtxlog.c:715
static MemoryContext opCtx
Definition: nbtxlog.c:27
static void btree_xlog_vacuum(XLogReaderState *record)
Definition: nbtxlog.c:600
static void btree_xlog_unlink_page(uint8 info, XLogReaderState *record)
Definition: nbtxlog.c:800
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:138

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.

◆ btree_xlog_cleanup()

void btree_xlog_cleanup ( void  )

Definition at line 1083 of file nbtxlog.c.

1084 {
1086  opCtx = NULL;
1087 }
void MemoryContextDelete(MemoryContext context)
Definition: mcxt.c:403

References MemoryContextDelete(), and opCtx.

◆ btree_xlog_startup()

void btree_xlog_startup ( void  )

Definition at line 1075 of file nbtxlog.c.

1076 {
1078  "Btree recovery temporary context",
1080 }
MemoryContext CurrentMemoryContext
Definition: mcxt.c:135
#define AllocSetContextCreate
Definition: memutils.h:126
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:150

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CurrentMemoryContext, and opCtx.