aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/async.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2009-11-10 18:00:06 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2009-11-10 18:00:06 +0000
commite7ec0222660636870ad85cde25cf1778c9d82a0b (patch)
treebbbb8ba9be7e77c4a913711f674fa10178350348 /src/backend/commands/async.c
parentb538b72eeb7ce4a84077e18374587e3a8a0d7a14 (diff)
downloadpostgresql-e7ec0222660636870ad85cde25cf1778c9d82a0b.tar.gz
postgresql-e7ec0222660636870ad85cde25cf1778c9d82a0b.zip
Fix longstanding problems in VACUUM caused by untimely interruptions
In VACUUM FULL, an interrupt after the initial transaction has been recorded as committed can cause postmaster to restart with the following error message: PANIC: cannot abort transaction NNNN, it was already committed This problem has been reported many times. In lazy VACUUM, an interrupt after the table has been truncated by lazy_truncate_heap causes other backends' relcache to still point to the removed pages; this can cause future INSERT and UPDATE queries to error out with the following error message: could not read block XX of relation 1663/NNN/MMMM: read only 0 of 8192 bytes The window to this race condition is extremely narrow, but it has been seen in the wild involving a cancelled autovacuum process. The solution for both problems is to inhibit interrupts in both operations until after the respective transactions have been committed. It's not a complete solution, because the transaction could theoretically be aborted by some other error, but at least fixes the most common causes of both problems.
Diffstat (limited to 'src/backend/commands/async.c')
0 files changed, 0 insertions, 0 deletions