diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-06-21 23:04:40 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-06-21 23:04:40 -0400 |
commit | 503c7305a1e379f95649eef1a694d0c1dbdc674a (patch) | |
tree | 39bb67975f3419f76d6973e86d5517c8e55f9853 /src/include/access/xlog_internal.h | |
parent | 431ab0e82819b31fcd1e33ecb52c2cd3b4b41da7 (diff) |
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/xlog_internal.h')
-rw-r--r-- | src/include/access/xlog_internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 7e39630c1bf..34316fffeba 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -71,7 +71,7 @@ typedef struct XLogContRecord /* * Each page of XLOG file has a header like this: */ -#define XLOG_PAGE_MAGIC 0xD066 /* can be used as WAL version indicator */ +#define XLOG_PAGE_MAGIC 0xD067 /* can be used as WAL version indicator */ typedef struct XLogPageHeaderData { |