postgresql/src/backend/access
Heikki Linnakangas 1c02ee314b Fix WAL-logging of FSM and VM truncation.
When a relation is truncated, it is important that the FSM is truncated as
well. Otherwise, after recovery, the FSM can return a page that has been
truncated away, leading to errors like:

ERROR:  could not read block 28991 in file "base/16390/572026": read only 0
of 8192 bytes

We were using MarkBufferDirtyHint() to dirty the buffer holding the last
remaining page of the FSM, but during recovery, that might in fact not
dirty the page, and the FSM update might be lost.

To fix, use the stronger MarkBufferDirty() function. MarkBufferDirty()
requires us to do WAL-logging ourselves, to protect from a torn page, if
checksumming is enabled.

Also fix an oversight in visibilitymap_truncate: it also needs to WAL-log
when checksumming is enabled.

Analysis by Pavan Deolasee.

Discussion: <CABOikdNr5vKucqyZH9s1Mh0XebLs_jRhKv6eJfNnD2wxTn=_9A@mail.gmail.com>

Backpatch to 9.3, where we got data checksums.
2016-10-19 15:00:34 +03:00
..
common Re-Align *_freeze_max_age reloption limits with corresponding GUC limits. 2015-10-05 11:57:11 +02:00
gin Make GIN's cleanup pending list process interruptable 2015-09-07 17:18:10 +03:00
gist Fix GiST index build for NaN values in geometric types. 2016-07-14 18:46:00 -04:00
hash Remove unnecessary variables in _hash_splitbucket(). 2015-04-03 16:49:11 -04:00
heap Fix WAL-logging of FSM and VM truncation. 2016-10-19 15:00:34 +03:00
index Fix BuildIndexValueDescription for expressions 2015-01-29 21:59:51 -05:00
nbtree Fix incorrect handling of NULL index entries in indexed ROW() comparisons. 2016-03-09 14:51:01 -05:00
rmgrdesc Rework tuple freezing protocol 2013-12-16 11:29:51 -03:00
spgist Fix overly-strict assertions in spgtextproc.c. 2016-01-02 16:25:07 -05:00
transam Prevent starting a standalone backend with standby_mode on. 2016-08-31 08:52:13 -04:00
Makefile Split out rmgr rm_desc functions into their own files 2012-11-28 13:01:15 -03:00