pgsql: Fix spurious warning after vacuuming a page on a table with no i

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix spurious warning after vacuuming a page on a table with no i
Дата
Msg-id E1VP7Bv-0004mo-2b@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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 tuple
aborts while vacuum is processing the page containing the inserted tuple.
Vacuum prunes the page first, which normally removes any dead tuples, but
if the inserting transaction aborts right after that, the loop after
pruning will see a dead tuple and remove it instead. That's OK, but if the
page is on a table with no indexes, and the page becomes completely empty
after removing the dead tuple (or tuples) on it, it will be immediately
marked as all-visible. That's OK, but the sanity check in vacuum would
throw a warning because it thinks that the page contains dead tuples and
was nevertheless marked as all-visible, even though it just vacuumed away
the dead tuples and so it doesn't actually contain any.

Spotted this while reading the code. It's difficult to hit the race
condition otherwise, but can be done by putting a breakpoint after the
heap_page_prune() call.

Backpatch all the way to 8.4, where this code first appeared.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/e04619453085e9d18885f6bcd78f82a93266be1b

Modified Files
--------------
src/backend/commands/vacuumlazy.c |    1 +
1 file changed, 1 insertion(+)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix spurious warning after vacuuming a page on a table with no i
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix spurious warning after vacuuming a page on a table with no i