postgresql/src/backend
Tom Lane 007a6e53ac Remove special case for xmin == xmax in HeapTupleSatisfiesVacuum().
VACUUM was willing to remove a committed-dead tuple immediately if it was
deleted by the same transaction that inserted it.  The idea is that such a
tuple could never have been visible to any other transaction, so we don't
need to keep it around to satisfy MVCC snapshots.  However, there was
already an exception for tuples that are part of an update chain, and this
exception created a problem: we might remove TOAST tuples (which are never
part of an update chain) while their parent tuple stayed around (if it was
part of an update chain).  This didn't pose a problem for most things,
since the parent tuple is indeed dead: no snapshot will ever consider it
visible.  But MVCC-safe CLUSTER had a problem, since it will try to copy
RECENTLY_DEAD tuples to the new table.  It then has to copy their TOAST
data too, and would fail if VACUUM had already removed the toast tuples.

Easiest fix is to get rid of the special case for xmin == xmax.  This may
delay reclaiming dead space for a little bit in some cases, but it's by far
the most reliable way to fix the issue.

Per bug #5998 from Mark Reid.  Back-patch to 8.3, which is the oldest
version with MVCC-safe CLUSTER.
2011-04-29 16:29:51 -04:00
..
access Revert the patch to check if we've reached end-of-backup also when doing 2011-04-13 22:00:43 +03:00
bootstrap Avoid changing an index's indcheckxmin horizon during REINDEX. 2011-04-19 18:51:03 -04:00
catalog Fix use of incorrect constant RemoveRoleFromObjectACL. 2011-04-20 22:26:12 -04:00
commands Avoid changing an index's indcheckxmin horizon during REINDEX. 2011-04-19 18:51:03 -04:00
executor Fix dangling-pointer problem in before-row update trigger processing. 2011-02-21 21:18:13 -05:00
foreign Wrap calls to SearchSysCache and related functions using macros. 2010-02-14 18:42:19 +00:00
lib pgindent run for 9.0, second run 2010-07-06 19:19:02 +00:00
libpq Complain if pg_hba.conf contains "hostssl" but SSL is disabled. 2011-04-26 15:40:14 -04:00
main Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
nodes Fix bogus test for hypothetical indexes in get_actual_variable_range(). 2011-02-16 19:24:50 -05:00
optimizer Ensure mark_dummy_rel doesn't create dangling pointers in RelOptInfos. 2011-04-13 18:56:47 -04:00
parser Add semicolon, missed in previous patch. And update the keyword list in 2010-10-22 18:39:43 +03:00
po Translation updates 2011-04-14 23:29:13 +03:00
port Modernize dlopen interface code for FreeBSD and OpenBSD. 2011-04-07 15:14:44 -04:00
postmaster Remove optreset from src/port/ implementations of getopt and getopt_long. 2010-12-16 16:22:12 -05:00
regex pgindent run for 9.0 2010-02-26 02:01:40 +00:00
replication Before exiting walreceiver, fsync() all the WAL received. 2011-01-17 12:29:15 +02:00
rewrite pgindent run for 9.0 2010-02-26 02:01:40 +00:00
snowball Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
storage Prevent intermittent hang in recovery from bgwriter interaction. 2011-03-23 13:32:37 +00:00
tcop On IA64 architecture, we check the depth of the register stack in addition 2011-04-13 11:52:54 +03:00
tsearch Fix tsmatchsel() to account properly for null rows. 2011-02-17 19:00:54 -05:00
utils Remove special case for xmin == xmax in HeapTupleSatisfiesVacuum(). 2011-04-29 16:29:51 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
common.mk Expand test coverage support to entire tree 2009-08-07 20:50:22 +00:00
Makefile Split the LDFLAGS make variable into two parts: LDFLAGS is now used for 2010-07-05 18:54:38 +00:00
nls.mk Translation updates for release 9.0.2 2010-12-13 23:20:00 +02:00