aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-02-13 00:59:58 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-02-13 00:59:58 +0000
commitfafa374f2d1e04ab265d56cdadb634124364646f (patch)
tree8eed47882514a949f2b7ea7b35939a92c15f151c /src/include
parent4688869f41ed716a88bb88bf2642e47e27c57e99 (diff)
downloadpostgresql-fafa374f2d1e04ab265d56cdadb634124364646f.tar.gz
postgresql-fafa374f2d1e04ab265d56cdadb634124364646f.zip
Introduce WAL records to log reuse of btree pages, allowing conflict
resolution during Hot Standby. Page reuse interlock requested by Tom. Analysis and patch by me.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/nbtree.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h
index acbb0cbc7d7..f3898a41408 100644
--- a/src/include/access/nbtree.h
+++ b/src/include/access/nbtree.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.128 2010/02/08 04:33:54 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.129 2010/02/13 00:59:58 sriggs Exp $
*
*-------------------------------------------------------------------------
*/
@@ -221,6 +221,7 @@ typedef struct BTMetaPageData
#define XLOG_BTREE_DELETE_PAGE_HALF 0xB0 /* page deletion that makes
* parent half-dead */
#define XLOG_BTREE_VACUUM 0xC0 /* delete entries on a page during vacuum */
+#define XLOG_BTREE_REUSE_PAGE 0xD0 /* old page is about to be reused from FSM */
/*
* All that we need to find changed index tuple
@@ -322,6 +323,18 @@ typedef struct xl_btree_delete
#define SizeOfBtreeDelete (offsetof(xl_btree_delete, latestRemovedXid) + sizeof(TransactionId))
/*
+ * This is what we need to know about page reuse within btree.
+ */
+typedef struct xl_btree_reuse_page
+{
+ RelFileNode node;
+ BlockNumber block;
+ TransactionId latestRemovedXid;
+} xl_btree_reuse_page;
+
+#define SizeOfBtreeReusePage (sizeof(xl_btree_reuse_page))
+
+/*
* This is what we need to know about vacuum of individual leaf index tuples.
* The WAL record can represent deletion of any number of index tuples on a
* single index page when executed by VACUUM.