diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2013-03-22 13:54:07 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2013-03-22 13:54:07 +0000 |
commit | 96ef3b8ff1cf1950e897fd2f766d4bd9ef0d5d56 (patch) | |
tree | 65849014627f4e211c6be8a4e9905b67694ed4ae /src/backend/access/nbtree/nbtutils.c | |
parent | e4a05c7512b23c8f48c186e685f2ef186374a20a (diff) | |
download | postgresql-96ef3b8ff1cf1950e897fd2f766d4bd9ef0d5d56.tar.gz postgresql-96ef3b8ff1cf1950e897fd2f766d4bd9ef0d5d56.zip |
Allow I/O reliability checks using 16-bit checksums
Checksums are set immediately prior to flush out of shared buffers
and checked when pages are read in again. Hint bit setting will
require full page write when block is dirtied, which causes various
infrastructure changes. Extensive comments, docs and README.
WARNING message thrown if checksum fails on non-all zeroes page;
ERROR thrown but can be disabled with ignore_checksum_failure = on.
Feature enabled by an initdb option, since transition from option off
to option on is long and complex and has not yet been implemented.
Default is not to use checksums.
Checksum used is WAL CRC-32 truncated to 16-bits.
Simon Riggs, Jeff Davis, Greg Smith
Wide input and assistance from many community members. Thank you.
Diffstat (limited to 'src/backend/access/nbtree/nbtutils.c')
-rw-r--r-- | src/backend/access/nbtree/nbtutils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c index 04e1ac4a9bd..fe53ec1fe0a 100644 --- a/src/backend/access/nbtree/nbtutils.c +++ b/src/backend/access/nbtree/nbtutils.c @@ -1781,9 +1781,7 @@ _bt_killitems(IndexScanDesc scan, bool haveLock) } /* - * Since this can be redone later if needed, it's treated the same as a - * commit-hint-bit status update for heap tuples: we mark the buffer dirty - * but don't make a WAL log entry. + * Since this can be redone later if needed, mark as dirty hint. * * Whenever we mark anything LP_DEAD, we also set the page's * BTP_HAS_GARBAGE flag, which is likewise just a hint. @@ -1791,7 +1789,7 @@ _bt_killitems(IndexScanDesc scan, bool haveLock) if (killedsomething) { opaque->btpo_flags |= BTP_HAS_GARBAGE; - SetBufferCommitInfoNeedsSave(so->currPos.buf); + MarkBufferDirtyHint(so->currPos.buf); } if (!haveLock) |