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

Go to the source code of this file.

Data Structures

struct  xl_hash_insert
 
struct  xl_hash_add_ovfl_page
 
struct  xl_hash_split_allocate_page
 
struct  xl_hash_split_complete
 
struct  xl_hash_move_page_contents
 
struct  xl_hash_squeeze_page
 
struct  xl_hash_delete
 
struct  xl_hash_update_meta_page
 
struct  xl_hash_init_meta_page
 
struct  xl_hash_init_bitmap_page
 
struct  xl_hash_vacuum_one_page
 

Macros

#define HASH_XLOG_FREE_OVFL_BUFS   6
 
#define XLOG_HASH_INIT_META_PAGE   0x00 /* initialize the meta page */
 
#define XLOG_HASH_INIT_BITMAP_PAGE   0x10 /* initialize the bitmap page */
 
#define XLOG_HASH_INSERT   0x20 /* add index tuple without split */
 
#define XLOG_HASH_ADD_OVFL_PAGE   0x30 /* add overflow page */
 
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE   0x40 /* allocate new page for split */
 
#define XLOG_HASH_SPLIT_PAGE   0x50 /* split page */
 
#define XLOG_HASH_SPLIT_COMPLETE   0x60 /* completion of split operation */
 
#define XLOG_HASH_MOVE_PAGE_CONTENTS
 
#define XLOG_HASH_SQUEEZE_PAGE
 
#define XLOG_HASH_DELETE   0x90 /* delete index tuples from a page */
 
#define XLOG_HASH_SPLIT_CLEANUP
 
#define XLOG_HASH_UPDATE_META_PAGE   0xB0 /* update meta page after vacuum */
 
#define XLOG_HASH_VACUUM_ONE_PAGE
 
#define XLH_SPLIT_META_UPDATE_MASKS   (1<<0)
 
#define XLH_SPLIT_META_UPDATE_SPLITPOINT   (1<<1)
 
#define SizeOfHashInsert   (offsetof(xl_hash_insert, offnum) + sizeof(OffsetNumber))
 
#define SizeOfHashAddOvflPage   (offsetof(xl_hash_add_ovfl_page, bmpage_found) + sizeof(bool))
 
#define SizeOfHashSplitAllocPage   (offsetof(xl_hash_split_allocate_page, flags) + sizeof(uint8))
 
#define SizeOfHashSplitComplete   (offsetof(xl_hash_split_complete, new_bucket_flag) + sizeof(uint16))
 
#define SizeOfHashMovePageContents   (offsetof(xl_hash_move_page_contents, is_prim_bucket_same_wrt) + sizeof(bool))
 
#define SizeOfHashSqueezePage   (offsetof(xl_hash_squeeze_page, is_prev_bucket_same_wrt) + sizeof(bool))
 
#define SizeOfHashDelete   (offsetof(xl_hash_delete, is_primary_bucket_page) + sizeof(bool))
 
#define SizeOfHashUpdateMetaPage   (offsetof(xl_hash_update_meta_page, ntuples) + sizeof(double))
 
#define SizeOfHashInitMetaPage   (offsetof(xl_hash_init_meta_page, ffactor) + sizeof(uint16))
 
#define SizeOfHashInitBitmapPage   (offsetof(xl_hash_init_bitmap_page, bmsize) + sizeof(uint16))
 
#define SizeOfHashVacuumOnePage   (offsetof(xl_hash_vacuum_one_page, ntuples) + sizeof(int))
 

Typedefs

typedef struct xl_hash_insert xl_hash_insert
 
typedef struct xl_hash_add_ovfl_page xl_hash_add_ovfl_page
 
typedef struct xl_hash_split_allocate_page xl_hash_split_allocate_page
 
typedef struct xl_hash_split_complete xl_hash_split_complete
 
typedef struct xl_hash_move_page_contents xl_hash_move_page_contents
 
typedef struct xl_hash_squeeze_page xl_hash_squeeze_page
 
typedef struct xl_hash_delete xl_hash_delete
 
typedef struct xl_hash_update_meta_page xl_hash_update_meta_page
 
typedef struct xl_hash_init_meta_page xl_hash_init_meta_page
 
typedef struct xl_hash_init_bitmap_page xl_hash_init_bitmap_page
 
typedef struct xl_hash_vacuum_one_page xl_hash_vacuum_one_page
 

Functions

void hash_redo (XLogReaderState *record)
 
void hash_desc (StringInfo buf, XLogReaderState *record)
 
const char * hash_identify (uint8 info)
 
void hash_mask (char *pagedata, BlockNumber blkno)
 

Macro Definition Documentation

◆ HASH_XLOG_FREE_OVFL_BUFS

#define HASH_XLOG_FREE_OVFL_BUFS   6

Definition at line 22 of file hash_xlog.h.

Referenced by _hash_freeovflpage().

◆ SizeOfHashAddOvflPage

#define SizeOfHashAddOvflPage   (offsetof(xl_hash_add_ovfl_page, bmpage_found) + sizeof(bool))

Definition at line 86 of file hash_xlog.h.

Referenced by _hash_addovflpage().

◆ SizeOfHashDelete

#define SizeOfHashDelete   (offsetof(xl_hash_delete, is_primary_bucket_page) + sizeof(bool))

Definition at line 192 of file hash_xlog.h.

Referenced by hashbucketcleanup().

◆ SizeOfHashInitBitmapPage

#define SizeOfHashInitBitmapPage   (offsetof(xl_hash_init_bitmap_page, bmsize) + sizeof(uint16))

Definition at line 239 of file hash_xlog.h.

Referenced by _hash_init().

◆ SizeOfHashInitMetaPage

#define SizeOfHashInitMetaPage   (offsetof(xl_hash_init_meta_page, ffactor) + sizeof(uint16))

Definition at line 223 of file hash_xlog.h.

Referenced by _hash_init().

◆ SizeOfHashInsert

#define SizeOfHashInsert   (offsetof(xl_hash_insert, offnum) + sizeof(OffsetNumber))

Definition at line 67 of file hash_xlog.h.

Referenced by _hash_doinsert().

◆ SizeOfHashMovePageContents

#define SizeOfHashMovePageContents   (offsetof(xl_hash_move_page_contents, is_prim_bucket_same_wrt) + sizeof(bool))

Definition at line 144 of file hash_xlog.h.

Referenced by _hash_squeezebucket().

◆ SizeOfHashSplitAllocPage

#define SizeOfHashSplitAllocPage   (offsetof(xl_hash_split_allocate_page, flags) + sizeof(uint8))

Definition at line 106 of file hash_xlog.h.

Referenced by _hash_expandtable().

◆ SizeOfHashSplitComplete

#define SizeOfHashSplitComplete   (offsetof(xl_hash_split_complete, new_bucket_flag) + sizeof(uint16))

Definition at line 123 of file hash_xlog.h.

Referenced by _hash_splitbucket().

◆ SizeOfHashSqueezePage

#define SizeOfHashSqueezePage   (offsetof(xl_hash_squeeze_page, is_prev_bucket_same_wrt) + sizeof(bool))

Definition at line 173 of file hash_xlog.h.

Referenced by _hash_freeovflpage().

◆ SizeOfHashUpdateMetaPage

#define SizeOfHashUpdateMetaPage   (offsetof(xl_hash_update_meta_page, ntuples) + sizeof(double))

Definition at line 206 of file hash_xlog.h.

Referenced by hashbulkdelete().

◆ SizeOfHashVacuumOnePage

#define SizeOfHashVacuumOnePage   (offsetof(xl_hash_vacuum_one_page, ntuples) + sizeof(int))

Definition at line 259 of file hash_xlog.h.

Referenced by _hash_vacuum_one_page(), and hash_xlog_vacuum_one_page().

◆ XLH_SPLIT_META_UPDATE_MASKS

#define XLH_SPLIT_META_UPDATE_MASKS   (1<<0)

Definition at line 51 of file hash_xlog.h.

Referenced by _hash_expandtable(), hash_desc(), and hash_xlog_split_allocate_page().

◆ XLH_SPLIT_META_UPDATE_SPLITPOINT

#define XLH_SPLIT_META_UPDATE_SPLITPOINT   (1<<1)

Definition at line 52 of file hash_xlog.h.

Referenced by _hash_expandtable(), hash_desc(), and hash_xlog_split_allocate_page().

◆ XLOG_HASH_ADD_OVFL_PAGE

#define XLOG_HASH_ADD_OVFL_PAGE   0x30 /* add overflow page */

Definition at line 30 of file hash_xlog.h.

Referenced by _hash_addovflpage(), hash_desc(), hash_identify(), and hash_redo().

◆ XLOG_HASH_DELETE

#define XLOG_HASH_DELETE   0x90 /* delete index tuples from a page */

Definition at line 39 of file hash_xlog.h.

Referenced by hash_desc(), hash_identify(), hash_redo(), and hashbucketcleanup().

◆ XLOG_HASH_INIT_BITMAP_PAGE

#define XLOG_HASH_INIT_BITMAP_PAGE   0x10 /* initialize the bitmap page */

Definition at line 28 of file hash_xlog.h.

Referenced by _hash_init(), hash_desc(), hash_identify(), and hash_redo().

◆ XLOG_HASH_INIT_META_PAGE

#define XLOG_HASH_INIT_META_PAGE   0x00 /* initialize the meta page */

Definition at line 27 of file hash_xlog.h.

Referenced by _hash_init(), hash_desc(), hash_identify(), and hash_redo().

◆ XLOG_HASH_INSERT

#define XLOG_HASH_INSERT   0x20 /* add index tuple without split */

Definition at line 29 of file hash_xlog.h.

Referenced by _hash_doinsert(), hash_desc(), hash_identify(), and hash_redo().

◆ XLOG_HASH_MOVE_PAGE_CONTENTS

#define XLOG_HASH_MOVE_PAGE_CONTENTS
Value:
0x70 /* remove tuples from one page
* and add to another page */

Definition at line 34 of file hash_xlog.h.

Referenced by _hash_squeezebucket(), hash_desc(), hash_identify(), and hash_redo().

◆ XLOG_HASH_SPLIT_ALLOCATE_PAGE

#define XLOG_HASH_SPLIT_ALLOCATE_PAGE   0x40 /* allocate new page for split */

Definition at line 31 of file hash_xlog.h.

Referenced by _hash_expandtable(), hash_desc(), hash_identify(), and hash_redo().

◆ XLOG_HASH_SPLIT_CLEANUP

#define XLOG_HASH_SPLIT_CLEANUP
Value:
0xA0 /* clear split-cleanup flag in primary
* bucket page after deleting tuples
* that are moved due to split */

Definition at line 40 of file hash_xlog.h.

Referenced by hash_identify(), hash_redo(), and hashbucketcleanup().

◆ XLOG_HASH_SPLIT_COMPLETE

#define XLOG_HASH_SPLIT_COMPLETE   0x60 /* completion of split operation */

Definition at line 33 of file hash_xlog.h.

Referenced by _hash_splitbucket(), hash_desc(), hash_identify(), and hash_redo().

◆ XLOG_HASH_SPLIT_PAGE

#define XLOG_HASH_SPLIT_PAGE   0x50 /* split page */

Definition at line 32 of file hash_xlog.h.

Referenced by hash_identify(), hash_redo(), and log_split_page().

◆ XLOG_HASH_SQUEEZE_PAGE

#define XLOG_HASH_SQUEEZE_PAGE
Value:
0x80 /* add tuples to one of the previous
* pages in chain and free the ovfl
* page */

Definition at line 36 of file hash_xlog.h.

Referenced by _hash_freeovflpage(), hash_desc(), hash_identify(), and hash_redo().

◆ XLOG_HASH_UPDATE_META_PAGE

#define XLOG_HASH_UPDATE_META_PAGE   0xB0 /* update meta page after vacuum */

Definition at line 43 of file hash_xlog.h.

Referenced by hash_desc(), hash_identify(), hash_redo(), and hashbulkdelete().

◆ XLOG_HASH_VACUUM_ONE_PAGE

#define XLOG_HASH_VACUUM_ONE_PAGE
Value:
0xC0 /* remove dead tuples from index
* page */

Definition at line 45 of file hash_xlog.h.

Referenced by _hash_vacuum_one_page(), hash_desc(), hash_identify(), and hash_redo().

Typedef Documentation

◆ xl_hash_add_ovfl_page

◆ xl_hash_delete

◆ xl_hash_init_bitmap_page

◆ xl_hash_init_meta_page

◆ xl_hash_insert

◆ xl_hash_move_page_contents

◆ xl_hash_split_allocate_page

◆ xl_hash_split_complete

◆ xl_hash_squeeze_page

◆ xl_hash_update_meta_page

◆ xl_hash_vacuum_one_page

Function Documentation

◆ hash_desc()

void hash_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 20 of file hashdesc.c.

References appendStringInfo(), xl_hash_add_ovfl_page::bmpage_found, xl_hash_add_ovfl_page::bmsize, xl_hash_init_bitmap_page::bmsize, xl_hash_delete::clear_dead_marking, xl_hash_init_meta_page::ffactor, xl_hash_split_allocate_page::flags, xl_hash_move_page_contents::is_prim_bucket_same_wrt, xl_hash_squeeze_page::is_prim_bucket_same_wrt, xl_hash_delete::is_primary_bucket_page, xl_hash_vacuum_one_page::latestRemovedXid, xl_hash_split_allocate_page::new_bucket, xl_hash_split_complete::new_bucket_flag, xl_hash_squeeze_page::nextblkno, xl_hash_update_meta_page::ntuples, xl_hash_vacuum_one_page::ntuples, xl_hash_move_page_contents::ntups, xl_hash_squeeze_page::ntups, xl_hash_init_meta_page::num_tuples, xl_hash_insert::offnum, xl_hash_split_complete::old_bucket_flag, xl_hash_squeeze_page::prevblkno, XLH_SPLIT_META_UPDATE_MASKS, XLH_SPLIT_META_UPDATE_SPLITPOINT, XLOG_HASH_ADD_OVFL_PAGE, XLOG_HASH_DELETE, XLOG_HASH_INIT_BITMAP_PAGE, XLOG_HASH_INIT_META_PAGE, XLOG_HASH_INSERT, XLOG_HASH_MOVE_PAGE_CONTENTS, XLOG_HASH_SPLIT_ALLOCATE_PAGE, XLOG_HASH_SPLIT_COMPLETE, XLOG_HASH_SQUEEZE_PAGE, XLOG_HASH_UPDATE_META_PAGE, XLOG_HASH_VACUUM_ONE_PAGE, XLogRecGetData, XLogRecGetInfo, and XLR_INFO_MASK.

21 {
22  char *rec = XLogRecGetData(record);
23  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
24 
25  switch (info)
26  {
28  {
30 
31  appendStringInfo(buf, "num_tuples %g, fillfactor %d",
32  xlrec->num_tuples, xlrec->ffactor);
33  break;
34  }
36  {
38 
39  appendStringInfo(buf, "bmsize %d", xlrec->bmsize);
40  break;
41  }
42  case XLOG_HASH_INSERT:
43  {
44  xl_hash_insert *xlrec = (xl_hash_insert *) rec;
45 
46  appendStringInfo(buf, "off %u", xlrec->offnum);
47  break;
48  }
50  {
52 
53  appendStringInfo(buf, "bmsize %d, bmpage_found %c",
54  xlrec->bmsize, (xlrec->bmpage_found) ? 'T' : 'F');
55  break;
56  }
58  {
60 
61  appendStringInfo(buf, "new_bucket %u, meta_page_masks_updated %c, issplitpoint_changed %c",
62  xlrec->new_bucket,
63  (xlrec->flags & XLH_SPLIT_META_UPDATE_MASKS) ? 'T' : 'F',
64  (xlrec->flags & XLH_SPLIT_META_UPDATE_SPLITPOINT) ? 'T' : 'F');
65  break;
66  }
68  {
70 
71  appendStringInfo(buf, "old_bucket_flag %u, new_bucket_flag %u",
72  xlrec->old_bucket_flag, xlrec->new_bucket_flag);
73  break;
74  }
76  {
78 
79  appendStringInfo(buf, "ntups %d, is_primary %c",
80  xlrec->ntups,
81  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
82  break;
83  }
85  {
87 
88  appendStringInfo(buf, "prevblkno %u, nextblkno %u, ntups %d, is_primary %c",
89  xlrec->prevblkno,
90  xlrec->nextblkno,
91  xlrec->ntups,
92  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
93  break;
94  }
95  case XLOG_HASH_DELETE:
96  {
97  xl_hash_delete *xlrec = (xl_hash_delete *) rec;
98 
99  appendStringInfo(buf, "clear_dead_marking %c, is_primary %c",
100  xlrec->clear_dead_marking ? 'T' : 'F',
101  xlrec->is_primary_bucket_page ? 'T' : 'F');
102  break;
103  }
105  {
107 
108  appendStringInfo(buf, "ntuples %g",
109  xlrec->ntuples);
110  break;
111  }
113  {
115 
116  appendStringInfo(buf, "ntuples %d, latest removed xid %u",
117  xlrec->ntuples,
118  xlrec->latestRemovedXid);
119  break;
120  }
121  }
122 }
#define XLOG_HASH_INSERT
Definition: hash_xlog.h:29
#define XLH_SPLIT_META_UPDATE_SPLITPOINT
Definition: hash_xlog.h:52
#define XLOG_HASH_INIT_BITMAP_PAGE
Definition: hash_xlog.h:28
unsigned char uint8
Definition: c.h:357
bool clear_dead_marking
Definition: hash_xlog.h:186
BlockNumber prevblkno
Definition: hash_xlog.h:161
bool is_prim_bucket_same_wrt
Definition: hash_xlog.h:164
#define XLogRecGetData(decoder)
Definition: xlogreader.h:283
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:91
BlockNumber nextblkno
Definition: hash_xlog.h:162
#define XLOG_HASH_ADD_OVFL_PAGE
Definition: hash_xlog.h:30
bool is_primary_bucket_page
Definition: hash_xlog.h:188
#define XLOG_HASH_DELETE
Definition: hash_xlog.h:39
#define XLOG_HASH_INIT_META_PAGE
Definition: hash_xlog.h:27
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:279
#define XLOG_HASH_MOVE_PAGE_CONTENTS
Definition: hash_xlog.h:34
#define XLOG_HASH_VACUUM_ONE_PAGE
Definition: hash_xlog.h:45
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
TransactionId latestRemovedXid
Definition: hash_xlog.h:253
OffsetNumber offnum
Definition: hash_xlog.h:64
#define XLOG_HASH_SPLIT_COMPLETE
Definition: hash_xlog.h:33
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE
Definition: hash_xlog.h:31
#define XLOG_HASH_SQUEEZE_PAGE
Definition: hash_xlog.h:36
#define XLH_SPLIT_META_UPDATE_MASKS
Definition: hash_xlog.h:51
#define XLOG_HASH_UPDATE_META_PAGE
Definition: hash_xlog.h:43

◆ hash_identify()

const char* hash_identify ( uint8  info)

Definition at line 125 of file hashdesc.c.

References XLOG_HASH_ADD_OVFL_PAGE, XLOG_HASH_DELETE, XLOG_HASH_INIT_BITMAP_PAGE, XLOG_HASH_INIT_META_PAGE, XLOG_HASH_INSERT, XLOG_HASH_MOVE_PAGE_CONTENTS, XLOG_HASH_SPLIT_ALLOCATE_PAGE, XLOG_HASH_SPLIT_CLEANUP, XLOG_HASH_SPLIT_COMPLETE, XLOG_HASH_SPLIT_PAGE, XLOG_HASH_SQUEEZE_PAGE, XLOG_HASH_UPDATE_META_PAGE, XLOG_HASH_VACUUM_ONE_PAGE, and XLR_INFO_MASK.

126 {
127  const char *id = NULL;
128 
129  switch (info & ~XLR_INFO_MASK)
130  {
132  id = "INIT_META_PAGE";
133  break;
135  id = "INIT_BITMAP_PAGE";
136  break;
137  case XLOG_HASH_INSERT:
138  id = "INSERT";
139  break;
141  id = "ADD_OVFL_PAGE";
142  break;
144  id = "SPLIT_ALLOCATE_PAGE";
145  break;
147  id = "SPLIT_PAGE";
148  break;
150  id = "SPLIT_COMPLETE";
151  break;
153  id = "MOVE_PAGE_CONTENTS";
154  break;
156  id = "SQUEEZE_PAGE";
157  break;
158  case XLOG_HASH_DELETE:
159  id = "DELETE";
160  break;
162  id = "SPLIT_CLEANUP";
163  break;
165  id = "UPDATE_META_PAGE";
166  break;
168  id = "VACUUM_ONE_PAGE";
169  }
170 
171  return id;
172 }
#define XLOG_HASH_INSERT
Definition: hash_xlog.h:29
#define XLOG_HASH_INIT_BITMAP_PAGE
Definition: hash_xlog.h:28
#define XLOG_HASH_SPLIT_CLEANUP
Definition: hash_xlog.h:40
#define XLOG_HASH_SPLIT_PAGE
Definition: hash_xlog.h:32
#define XLOG_HASH_ADD_OVFL_PAGE
Definition: hash_xlog.h:30
#define XLOG_HASH_DELETE
Definition: hash_xlog.h:39
#define XLOG_HASH_INIT_META_PAGE
Definition: hash_xlog.h:27
#define XLOG_HASH_MOVE_PAGE_CONTENTS
Definition: hash_xlog.h:34
#define XLOG_HASH_VACUUM_ONE_PAGE
Definition: hash_xlog.h:45
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
#define XLOG_HASH_SPLIT_COMPLETE
Definition: hash_xlog.h:33
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE
Definition: hash_xlog.h:31
#define XLOG_HASH_SQUEEZE_PAGE
Definition: hash_xlog.h:36
#define XLOG_HASH_UPDATE_META_PAGE
Definition: hash_xlog.h:43

◆ hash_mask()

void hash_mask ( char *  pagedata,
BlockNumber  blkno 
)

Definition at line 1108 of file hash_xlog.c.

References HashPageOpaqueData::hasho_flag, LH_BUCKET_PAGE, LH_OVERFLOW_PAGE, LH_PAGE_HAS_DEAD_TUPLES, LH_PAGE_TYPE, LH_UNUSED_PAGE, mask_lp_flags(), mask_page_content(), mask_page_hint_bits(), mask_page_lsn_and_checksum(), mask_unused_space(), and PageGetSpecialPointer.

1109 {
1110  Page page = (Page) pagedata;
1111  HashPageOpaque opaque;
1112  int pagetype;
1113 
1115 
1116  mask_page_hint_bits(page);
1117  mask_unused_space(page);
1118 
1119  opaque = (HashPageOpaque) PageGetSpecialPointer(page);
1120 
1121  pagetype = opaque->hasho_flag & LH_PAGE_TYPE;
1122  if (pagetype == LH_UNUSED_PAGE)
1123  {
1124  /*
1125  * Mask everything on a UNUSED page.
1126  */
1127  mask_page_content(page);
1128  }
1129  else if (pagetype == LH_BUCKET_PAGE ||
1130  pagetype == LH_OVERFLOW_PAGE)
1131  {
1132  /*
1133  * In hash bucket and overflow pages, it is possible to modify the
1134  * LP_FLAGS without emitting any WAL record. Hence, mask the line
1135  * pointer flags. See hashgettuple(), _hash_kill_items() for details.
1136  */
1137  mask_lp_flags(page);
1138  }
1139 
1140  /*
1141  * It is possible that the hint bit LH_PAGE_HAS_DEAD_TUPLES may remain
1142  * unlogged. So, mask it. See _hash_kill_items() for details.
1143  */
1144  opaque->hasho_flag &= ~LH_PAGE_HAS_DEAD_TUPLES;
1145 }
void mask_page_hint_bits(Page page)
Definition: bufmask.c:46
void mask_unused_space(Page page)
Definition: bufmask.c:71
#define LH_UNUSED_PAGE
Definition: hash.h:53
#define LH_PAGE_TYPE
Definition: hash.h:63
void mask_page_content(Page page)
Definition: bufmask.c:119
void mask_page_lsn_and_checksum(Page page)
Definition: bufmask.c:31
#define LH_OVERFLOW_PAGE
Definition: hash.h:54
#define LH_BUCKET_PAGE
Definition: hash.h:55
#define PageGetSpecialPointer(page)
Definition: bufpage.h:326
HashPageOpaqueData * HashPageOpaque
Definition: hash.h:86
uint16 hasho_flag
Definition: hash.h:82
void mask_lp_flags(Page page)
Definition: bufmask.c:95
#define LH_PAGE_HAS_DEAD_TUPLES
Definition: hash.h:61
Pointer Page
Definition: bufpage.h:78

◆ hash_redo()

void hash_redo ( XLogReaderState record)

Definition at line 1054 of file hash_xlog.c.

References elog, hash_xlog_add_ovfl_page(), hash_xlog_delete(), hash_xlog_init_bitmap_page(), hash_xlog_init_meta_page(), hash_xlog_insert(), hash_xlog_move_page_contents(), hash_xlog_split_allocate_page(), hash_xlog_split_cleanup(), hash_xlog_split_complete(), hash_xlog_split_page(), hash_xlog_squeeze_page(), hash_xlog_update_meta_page(), hash_xlog_vacuum_one_page(), PANIC, XLOG_HASH_ADD_OVFL_PAGE, XLOG_HASH_DELETE, XLOG_HASH_INIT_BITMAP_PAGE, XLOG_HASH_INIT_META_PAGE, XLOG_HASH_INSERT, XLOG_HASH_MOVE_PAGE_CONTENTS, XLOG_HASH_SPLIT_ALLOCATE_PAGE, XLOG_HASH_SPLIT_CLEANUP, XLOG_HASH_SPLIT_COMPLETE, XLOG_HASH_SPLIT_PAGE, XLOG_HASH_SQUEEZE_PAGE, XLOG_HASH_UPDATE_META_PAGE, XLOG_HASH_VACUUM_ONE_PAGE, XLogRecGetInfo, and XLR_INFO_MASK.

1055 {
1056  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
1057 
1058  switch (info)
1059  {
1061  hash_xlog_init_meta_page(record);
1062  break;
1065  break;
1066  case XLOG_HASH_INSERT:
1067  hash_xlog_insert(record);
1068  break;
1070  hash_xlog_add_ovfl_page(record);
1071  break;
1074  break;
1075  case XLOG_HASH_SPLIT_PAGE:
1076  hash_xlog_split_page(record);
1077  break;
1079  hash_xlog_split_complete(record);
1080  break;
1083  break;
1085  hash_xlog_squeeze_page(record);
1086  break;
1087  case XLOG_HASH_DELETE:
1088  hash_xlog_delete(record);
1089  break;
1091  hash_xlog_split_cleanup(record);
1092  break;
1095  break;
1097  hash_xlog_vacuum_one_page(record);
1098  break;
1099  default:
1100  elog(PANIC, "hash_redo: unknown op code %u", info);
1101  }
1102 }
static void hash_xlog_insert(XLogReaderState *record)
Definition: hash_xlog.c:128
#define XLOG_HASH_INSERT
Definition: hash_xlog.h:29
static void hash_xlog_update_meta_page(XLogReaderState *record)
Definition: hash_xlog.c:949
static void hash_xlog_move_page_contents(XLogReaderState *record)
Definition: hash_xlog.c:506
static void hash_xlog_split_cleanup(XLogReaderState *record)
Definition: hash_xlog.c:924
static void hash_xlog_squeeze_page(XLogReaderState *record)
Definition: hash_xlog.c:632
#define XLOG_HASH_INIT_BITMAP_PAGE
Definition: hash_xlog.h:28
unsigned char uint8
Definition: c.h:357
#define XLOG_HASH_SPLIT_CLEANUP
Definition: hash_xlog.h:40
#define XLOG_HASH_SPLIT_PAGE
Definition: hash_xlog.h:32
#define PANIC
Definition: elog.h:53
static void hash_xlog_delete(XLogReaderState *record)
Definition: hash_xlog.c:846
#define XLOG_HASH_ADD_OVFL_PAGE
Definition: hash_xlog.h:30
static void hash_xlog_split_allocate_page(XLogReaderState *record)
Definition: hash_xlog.c:315
#define XLOG_HASH_DELETE
Definition: hash_xlog.h:39
static void hash_xlog_split_complete(XLogReaderState *record)
Definition: hash_xlog.c:447
static void hash_xlog_add_ovfl_page(XLogReaderState *record)
Definition: hash_xlog.c:176
#define XLOG_HASH_INIT_META_PAGE
Definition: hash_xlog.h:27
static void hash_xlog_init_bitmap_page(XLogReaderState *record)
Definition: hash_xlog.c:66
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:279
#define XLOG_HASH_MOVE_PAGE_CONTENTS
Definition: hash_xlog.h:34
static void hash_xlog_init_meta_page(XLogReaderState *record)
Definition: hash_xlog.c:30
#define XLOG_HASH_VACUUM_ONE_PAGE
Definition: hash_xlog.h:45
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
static void hash_xlog_split_page(XLogReaderState *record)
Definition: hash_xlog.c:433
#define XLOG_HASH_SPLIT_COMPLETE
Definition: hash_xlog.h:33
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE
Definition: hash_xlog.h:31
#define elog(elevel,...)
Definition: elog.h:228
#define XLOG_HASH_SQUEEZE_PAGE
Definition: hash_xlog.h:36
#define XLOG_HASH_UPDATE_META_PAGE
Definition: hash_xlog.h:43
static void hash_xlog_vacuum_one_page(XLogReaderState *record)
Definition: hash_xlog.c:976