Make CLUSTER lock the old table's toast table before copying data.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: aa719c4853ea460d5f9dae5856088205518b51a7
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2011-05-01T21:57:46Z
Releases: 8.4.9
Make CLUSTER lock the old table's toast table before copying data.

We must lock out autovacuuming of the old toast table before computing the
OldestXmin horizon we will use.  Otherwise, autovacuum could start on the
toast table later, compute a later OldestXmin horizon, and remove as DEAD
toast tuples that we still need (because we think their parent tuples are
only RECENTLY_DEAD).  Per further thought about bug #5998.

Files

PathChange+/−
src/backend/commands/cluster.c modified +17 −0