PostgreSQL Source Code
git master
gistxlog.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* gistxlog.h
4
* gist xlog routines
5
*
6
* Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
7
* Portions Copyright (c) 1994, Regents of the University of California
8
*
9
* src/include/access/gistxlog.h
10
*
11
*-------------------------------------------------------------------------
12
*/
13
#ifndef GIST_XLOG_H
14
#define GIST_XLOG_H
15
16
#include "
access/gist.h
"
17
#include "
access/xlogreader.h
"
18
#include "
lib/stringinfo.h
"
19
20
#define XLOG_GIST_PAGE_UPDATE 0x00
21
#define XLOG_GIST_DELETE 0x10
/* delete leaf index tuples for a
22
* page */
23
#define XLOG_GIST_PAGE_REUSE 0x20
/* old page is about to be reused
24
* from FSM */
25
#define XLOG_GIST_PAGE_SPLIT 0x30
26
/* #define XLOG_GIST_INSERT_COMPLETE 0x40 */
/* not used anymore */
27
/* #define XLOG_GIST_CREATE_INDEX 0x50 */
/* not used anymore */
28
#define XLOG_GIST_PAGE_DELETE 0x60
29
#define XLOG_GIST_ASSIGN_LSN 0x70
/* nop, assign new LSN */
30
31
/*
32
* Backup Blk 0: updated page.
33
* Backup Blk 1: If this operation completes a page split, by inserting a
34
* downlink for the split page, the left half of the split
35
*/
36
typedef
struct
gistxlogPageUpdate
37
{
38
/* number of deleted offsets */
39
uint16
ntodelete
;
40
uint16
ntoinsert
;
41
42
/*
43
* In payload of blk 0 : 1. todelete OffsetNumbers 2. tuples to insert
44
*/
45
}
gistxlogPageUpdate
;
46
47
/*
48
* Backup Blk 0: Leaf page, whose index tuples are deleted.
49
*/
50
typedef
struct
gistxlogDelete
51
{
52
TransactionId
latestRemovedXid
;
53
uint16
ntodelete
;
/* number of deleted offsets */
54
55
/*
56
* In payload of blk 0 : todelete OffsetNumbers
57
*/
58
}
gistxlogDelete
;
59
60
#define SizeOfGistxlogDelete (offsetof(gistxlogDelete, ntodelete) + sizeof(uint16))
61
62
/*
63
* Backup Blk 0: If this operation completes a page split, by inserting a
64
* downlink for the split page, the left half of the split
65
* Backup Blk 1 - npage: split pages (1 is the original page)
66
*/
67
typedef
struct
gistxlogPageSplit
68
{
69
BlockNumber
origrlink
;
/* rightlink of the page before split */
70
GistNSN
orignsn
;
/* NSN of the page before split */
71
bool
origleaf
;
/* was splitted page a leaf page? */
72
73
uint16
npage
;
/* # of pages in the split */
74
bool
markfollowright
;
/* set F_FOLLOW_RIGHT flags */
75
76
/*
77
* follow: 1. gistxlogPage and array of IndexTupleData per page
78
*/
79
}
gistxlogPageSplit
;
80
81
/*
82
* Backup Blk 0: page that was deleted.
83
* Backup Blk 1: parent page, containing the downlink to the deleted page.
84
*/
85
typedef
struct
gistxlogPageDelete
86
{
87
FullTransactionId
deleteXid
;
/* last Xid which could see page in scan */
88
OffsetNumber
downlinkOffset
;
/* Offset of downlink referencing this
89
* page */
90
}
gistxlogPageDelete
;
91
92
#define SizeOfGistxlogPageDelete (offsetof(gistxlogPageDelete, downlinkOffset) + sizeof(OffsetNumber))
93
94
95
/*
96
* This is what we need to know about page reuse, for hot standby.
97
*/
98
typedef
struct
gistxlogPageReuse
99
{
100
RelFileNode
node
;
101
BlockNumber
block
;
102
FullTransactionId
latestRemovedFullXid
;
103
}
gistxlogPageReuse
;
104
105
#define SizeOfGistxlogPageReuse (offsetof(gistxlogPageReuse, latestRemovedFullXid) + sizeof(FullTransactionId))
106
107
extern
void
gist_redo
(
XLogReaderState
*record);
108
extern
void
gist_desc
(
StringInfo
buf
,
XLogReaderState
*record);
109
extern
const
char
*
gist_identify
(
uint8
info);
110
extern
void
gist_xlog_startup
(
void
);
111
extern
void
gist_xlog_cleanup
(
void
);
112
extern
void
gist_mask
(
char
*pagedata,
BlockNumber
blkno);
113
114
#endif
BlockNumber
uint32 BlockNumber
Definition:
block.h:31
uint16
unsigned short uint16
Definition:
c.h:440
uint8
unsigned char uint8
Definition:
c.h:439
TransactionId
uint32 TransactionId
Definition:
c.h:587
gist.h
GistNSN
XLogRecPtr GistNSN
Definition:
gist.h:60
gistxlogPageUpdate
struct gistxlogPageUpdate gistxlogPageUpdate
gistxlogPageSplit
struct gistxlogPageSplit gistxlogPageSplit
gist_xlog_startup
void gist_xlog_startup(void)
Definition:
gistxlog.c:443
gist_redo
void gist_redo(XLogReaderState *record)
Definition:
gistxlog.c:402
gist_identify
const char * gist_identify(uint8 info)
Definition:
gistdesc.c:89
gist_desc
void gist_desc(StringInfo buf, XLogReaderState *record)
Definition:
gistdesc.c:60
gistxlogPageReuse
struct gistxlogPageReuse gistxlogPageReuse
gistxlogDelete
struct gistxlogDelete gistxlogDelete
gistxlogPageDelete
struct gistxlogPageDelete gistxlogPageDelete
gist_xlog_cleanup
void gist_xlog_cleanup(void)
Definition:
gistxlog.c:449
gist_mask
void gist_mask(char *pagedata, BlockNumber blkno)
Definition:
gistxlog.c:458
OffsetNumber
uint16 OffsetNumber
Definition:
off.h:24
buf
static char * buf
Definition:
pg_test_fsync.c:67
stringinfo.h
FullTransactionId
Definition:
transam.h:66
RelFileNode
Definition:
relfilenode.h:58
StringInfoData
Definition:
stringinfo.h:37
XLogReaderState
Definition:
xlogreader.h:176
gistxlogDelete
Definition:
gistxlog.h:49
gistxlogDelete::latestRemovedXid
TransactionId latestRemovedXid
Definition:
gistxlog.h:50
gistxlogDelete::ntodelete
uint16 ntodelete
Definition:
gistxlog.h:51
gistxlogPageDelete
Definition:
gistxlog.h:84
gistxlogPageDelete::deleteXid
FullTransactionId deleteXid
Definition:
gistxlog.h:85
gistxlogPageDelete::downlinkOffset
OffsetNumber downlinkOffset
Definition:
gistxlog.h:86
gistxlogPageReuse
Definition:
gistxlog.h:97
gistxlogPageReuse::block
BlockNumber block
Definition:
gistxlog.h:99
gistxlogPageReuse::node
RelFileNode node
Definition:
gistxlog.h:98
gistxlogPageReuse::latestRemovedFullXid
FullTransactionId latestRemovedFullXid
Definition:
gistxlog.h:100
gistxlogPageSplit
Definition:
gistxlog.h:66
gistxlogPageSplit::orignsn
GistNSN orignsn
Definition:
gistxlog.h:68
gistxlogPageSplit::npage
uint16 npage
Definition:
gistxlog.h:71
gistxlogPageSplit::origleaf
bool origleaf
Definition:
gistxlog.h:69
gistxlogPageSplit::origrlink
BlockNumber origrlink
Definition:
gistxlog.h:67
gistxlogPageSplit::markfollowright
bool markfollowright
Definition:
gistxlog.h:72
gistxlogPageUpdate
Definition:
gistxlog.h:35
gistxlogPageUpdate::ntodelete
uint16 ntodelete
Definition:
gistxlog.h:37
gistxlogPageUpdate::ntoinsert
uint16 ntoinsert
Definition:
gistxlog.h:38
xlogreader.h
src
include
access
gistxlog.h
Generated on Fri May 20 2022 06:13:22 for PostgreSQL Source Code by
1.9.1