postgresql/src
Heikki Linnakangas 82b43f7df2 Don't update relfrozenxid if any pages were skipped.
Vacuum recognizes that it can update relfrozenxid by checking whether it has
processed all pages of a relation. Unfortunately it performed that check
after truncating the dead pages at the end of the relation, and used the new
number of pages to decide whether all pages have been scanned. If the new
number of pages happened to be smaller or equal to the number of pages
scanned, it incorrectly decided that all pages were scanned.

This can lead to relfrozenxid being updated, even though some pages were
skipped that still contain old XIDs. That can lead to data loss due to xid
wraparounds with some rows suddenly missing. This likely has escaped notice
so far because it takes a large number (~2^31) of xids being used to see the
effect, while a full-table vacuum before that would fix the issue.

The incorrect logic was introduced by commit
b4b6923e03. Backpatch this fix down to 8.4,
like that commit.

Andres Freund, with some modifications by me.
2013-11-27 13:43:27 +02:00
..
backend Don't update relfrozenxid if any pages were skipped. 2013-11-27 13:43:27 +02:00
bin Add --xlogdir option to pg_basebackup, for specifying the pg_xlog directory. 2013-11-27 14:00:16 +09:00
common Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00
include Implement information_schema.parameters.parameter_default column 2013-11-26 23:21:35 -05:00
interfaces ECPG: Fix searching for quoted cursor names case-sensitively. 2013-11-27 11:02:13 +01:00
makefiles Remove leftovers of IRIX port 2013-11-12 06:39:36 -05:00
pl Oops, forgot to "git add" last minute changes to regression test. 2013-11-26 23:05:48 +02:00
port Ensure _dosmaperr() actually sets errno correctly. 2013-11-23 18:24:26 -05:00
template Remove leftovers of IRIX port 2013-11-12 06:39:36 -05:00
test Implement information_schema.parameters.parameter_default column 2013-11-26 23:21:35 -05:00
timezone Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
tools Fix whitespace 2013-11-13 21:25:52 -05:00
tutorial Modernize string literal syntax in tutorial example. 2013-01-19 17:20:32 -05:00
.gitignore
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Switch dependency order of libpgcommon and libpgport 2013-10-17 22:02:35 -04:00
Makefile.shlib Remove IRIX port. 2013-10-18 08:14:21 -04:00
nls-global.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
win32.mak