pgsql: Ensure ANALYZE phase is not skipped because of canceled truncate

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема pgsql: Ensure ANALYZE phase is not skipped because of canceled truncate
Дата
Msg-id E1UWsVS-0003ww-Ui@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Ensure ANALYZE phase is not skipped because of canceled truncate.

Patch b19e4250b45e91c9cbdd18d35ea6391ab5961c8d attempted to
preserve existing behavior regarding statistics generation in the
case that a truncation attempt was canceled due to lock conflicts.
It failed to do this accurately in two regards: (1) autovacuum had
previously generated statistics if the truncate attempt failed to
initially get the lock rather than having started the attempt, and
(2) the VACUUM ANALYZE command had always generated statistics.

Both of these changes were unintended, and are reverted by this
patch.  On review, there seems to be consensus that the previous
failure to generate statistics when the truncate was terminated
was more an unfortunate consequence of how that effort was
previously terminated than a feature we want to keep; so this
patch generates statistics even when an autovacuum truncation
attempt terminates early.  Another unintended change which is kept
on the basis that it is an improvement is that when a VACUUM
command is truncating, it will the new heuristic for avoiding
blocking other processes, rather than keeping an
AccessExclusiveLock on the table for however long the truncation
takes.

Per multiple reports, with some renaming per patch by Jeff Janes.

Backpatch to 9.0, where problem was created.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/95909f3be1501b4b1e051d590c28e67a33ba9744

Modified Files
--------------
src/backend/commands/vacuumlazy.c |   58 ++++++++++++++-----------------------
1 files changed, 22 insertions(+), 36 deletions(-)


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Attempt to fix error recovery in COPY BOTH mode.
Следующее
От: Kevin Grittner
Дата:
Сообщение: pgsql: Ensure ANALYZE phase is not skipped because of canceled truncate