aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/transam.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2011-06-21 23:04:40 -0400
committerRobert Haas <rhaas@postgresql.org>2011-06-21 23:04:40 -0400
commit503c7305a1e379f95649eef1a694d0c1dbdc674a (patch)
tree39bb67975f3419f76d6973e86d5517c8e55f9853 /src/include/access/transam.h
parent431ab0e82819b31fcd1e33ecb52c2cd3b4b41da7 (diff)
downloadpostgresql-503c7305a1e379f95649eef1a694d0c1dbdc674a.tar.gz
postgresql-503c7305a1e379f95649eef1a694d0c1dbdc674a.zip
Make the visibility map crash-safe.
This involves two main changes from the previous behavior. First, when we set a bit in the visibility map, emit a new WAL record of type XLOG_HEAP2_VISIBLE. Replay sets the page-level PD_ALL_VISIBLE bit and the visibility map bit. Second, when inserting, updating, or deleting a tuple, we can no longer get away with clearing the visibility map bit after releasing the lock on the corresponding heap page, because an intervening crash might leave the visibility map bit set and the page-level bit clear. Making this work requires a bit of interface refactoring. In passing, a few minor but related cleanups: change the test in visibilitymap_set and visibilitymap_clear to throw an error if the wrong page (or no page) is pinned, rather than silently doing nothing; this case should never occur. Also, remove duplicate definitions of InvalidXLogRecPtr. Patch by me, review by Noah Misch.
Diffstat (limited to 'src/include/access/transam.h')
-rw-r--r--src/include/access/transam.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/access/transam.h b/src/include/access/transam.h
index c5e6ab0ca49..c038fd9a52d 100644
--- a/src/include/access/transam.h
+++ b/src/include/access/transam.h
@@ -135,6 +135,9 @@ extern bool TransactionStartedDuringRecovery(void);
/* in transam/varsup.c */
extern PGDLLIMPORT VariableCache ShmemVariableCache;
+/* in transam/transam.c */
+extern const XLogRecPtr InvalidXLogRecPtr;
+
/*
* prototypes for functions in transam/transam.c