postgresql/src/backend
Tom Lane 6ce2ca3332 Fix a longstanding bug in VACUUM FULL's handling of update chains. The code
did not expect that a DEAD tuple could follow a RECENTLY_DEAD tuple in an
update chain, but because the OldestXmin rule for determining deadness is a
simplification of reality, it is possible for this situation to occur
(implying that the RECENTLY_DEAD tuple is in fact dead to all observers,
but this patch does not attempt to exploit that).  The code would follow a
chain forward all the way, but then stop before a DEAD tuple when backing
up, meaning that not all of the chain got moved.  This could lead to copying
the chain multiple times (resulting in duplicate copies of the live tuple at
its end), or leaving dangling index entries behind (which, aside from
generating warnings from later vacuums, creates a risk of wrong query
results or bogus duplicate-key errors once the heap slot the index entry
points to is repopulated).

The fix is to recheck HeapTupleSatisfiesVacuum while following a chain
forward, and to stop if a DEAD tuple is reached.  Each contiguous group
of RECENTLY_DEAD tuples will therefore be copied as a separate chain.
The patch also adds a couple of extra sanity checks to verify correct
behavior.

Per report and test case from Pavan Deolasee.
2007-03-14 18:49:32 +00:00
..
access Correct an old logic error in btree page splitting: when considering a split 2007-01-27 20:53:59 +00:00
bootstrap Remove no-longer-needed inclusion of bootstrap_tokens.h, per patch 2002-11-04 14:22:32 +00:00
catalog Repair insufficiently careful type checking for SQL-language functions: 2007-02-02 00:04:16 +00:00
commands Fix a longstanding bug in VACUUM FULL's handling of update chains. The code 2007-03-14 18:49:32 +00:00
executor Repair insufficiently careful type checking for SQL-language functions: 2007-02-02 00:04:16 +00:00
lib pgindent run. 2002-09-04 20:31:48 +00:00
libpq Back-patch 7.4-era fix for memory leak with SSL connections due to 2006-06-23 14:42:52 +00:00
main Arrange to set the LC_XXX environment variables to match our locale setup. 2006-01-05 00:55:36 +00:00
nodes Adjust handling of command status strings in the presence of rules, 2002-10-14 22:14:35 +00:00
optimizer Fix longstanding bug that would sometimes let the planner generate a bad plan 2005-10-25 20:30:52 +00:00
parser Add a new GUC parameter backslash_quote, which determines whether the SQL 2006-05-21 20:12:20 +00:00
po Translation updates 2004-04-05 09:02:37 +00:00
port Back-patch fix to cause stats processes to detach from shared memory, 2003-11-30 21:56:36 +00:00
postmaster Back-patch fix to cause stats processes to detach from shared memory, 2003-11-30 21:56:36 +00:00
regex Fix char-vs-pg_wchar confusion in p_ere(), per failure report from 2003-04-20 17:37:22 +00:00
rewrite Fix markQueryForLocking() to work correctly in the presence of nested views. 2007-03-01 18:51:03 +00:00
storage Back-port Postgres 7.4 spinlock code into 7.3 branch. This adds 2006-06-01 23:18:11 +00:00
tcop Push enable/disable of notify and catchup interrupts all the way down 2005-06-02 21:04:30 +00:00
utils Get pg_utf_mblen(), pg_utf2wchar_with_len(), and utf2ucs() all on the same 2007-01-24 17:12:47 +00:00
Makefile > > > > and mb conversions (pg_ascii2mic and pg_mic2ascii not 2002-10-09 16:21:54 +00:00
nls.mk Translation updates 2002-12-10 20:00:27 +00:00