forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit44e4bbf
committed
Remove special case for xmin == xmax in HeapTupleSatisfiesVacuum().
VACUUM was willing to remove a committed-dead tuple immediately if it wasdeleted by the same transaction that inserted it. The idea is that such atuple could never have been visible to any other transaction, so we don'tneed to keep it around to satisfy MVCC snapshots. However, there wasalready an exception for tuples that are part of an update chain, and thisexception created a problem: we might remove TOAST tuples (which are neverpart of an update chain) while their parent tuple stayed around (if it waspart 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 itvisible. But MVCC-safe CLUSTER had a problem, since it will try to copyRECENTLY_DEAD tuples to the new table. It then has to copy their TOASTdata 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 maydelay reclaiming dead space for a little bit in some cases, but it's by farthe most reliable way to fix the issue.Per bug #5998 from Mark Reid. Back-patch to 8.3, which is the oldestversion with MVCC-safe CLUSTER.1 parentfd2e2d0 commit44e4bbf
1 file changed
+2
-18
lines changedLines changed: 2 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1217 | 1217 |
| |
1218 | 1218 |
| |
1219 | 1219 |
| |
1220 |
| - | |
| 1220 | + | |
| 1221 | + | |
1221 | 1222 |
| |
1222 |
| - | |
1223 |
| - | |
1224 |
| - | |
1225 |
| - | |
1226 |
| - | |
1227 |
| - | |
1228 |
| - | |
1229 |
| - | |
1230 |
| - | |
1231 |
| - | |
1232 |
| - | |
1233 |
| - | |
1234 |
| - | |
1235 |
| - | |
1236 | 1223 |
| |
1237 |
| - | |
1238 |
| - | |
1239 | 1224 |
| |
1240 |
| - | |
1241 | 1225 |
| |
1242 | 1226 |
| |
1243 | 1227 |
| |
|
0 commit comments
Comments
(0)