- Notifications
You must be signed in to change notification settings - Fork5
Commitadaba27
committed
Fix spurious warning after vacuuming a page on a table with no indexes.
There is a rare race condition, when a transaction that inserted a tupleaborts while vacuum is processing the page containing the inserted tuple.Vacuum prunes the page first, which normally removes any dead tuples, butif the inserting transaction aborts right after that, the loop afterpruning will see a dead tuple and remove it instead. That's OK, but if thepage is on a table with no indexes, and the page becomes completely emptyafter removing the dead tuple (or tuples) on it, it will be immediatelymarked as all-visible. That's OK, but the sanity check in vacuum wouldthrow a warning because it thinks that the page contains dead tuples andwas nevertheless marked as all-visible, even though it just vacuumed awaythe dead tuples and so it doesn't actually contain any.Spotted this while reading the code. It's difficult to hit the racecondition otherwise, but can be done by putting a breakpoint after theheap_page_prune() call.Backpatch all the way to 8.4, where this code first appeared.1 parentc2df45a commitadaba27
1 file changed
+1
-0
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
900 | 900 |
| |
901 | 901 |
| |
902 | 902 |
| |
| 903 | + | |
903 | 904 |
| |
904 | 905 |
| |
905 | 906 |
| |
|
0 commit comments
Comments
(0)