diff options
author | Michael Paquier <michael@paquier.xyz> | 2018-09-14 07:35:39 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2018-09-14 07:35:39 +0900 |
commit | 28a8fa984c63fd525ab03c469f293e957619654b (patch) | |
tree | 93a6e194710ff1f38b2327e457404869e217a1a8 | |
parent | f48fa2bc8b6252ae8fccc69729a3bddb6863b8f1 (diff) | |
download | postgresql-28a8fa984c63fd525ab03c469f293e957619654b.tar.gz postgresql-28a8fa984c63fd525ab03c469f293e957619654b.zip |
Improve autovacuum logging for aggressive and anti-wraparound runs
A log message was being generated when log_min_duration is reached for
autovacuum on a given relation to indicate if it was an aggressive run,
and missed the point of mentioning if it is doing an anti-wrapround
run. The log message generated is improved so as one, both or no extra
details are added depending on the option set.
Author: Sergei Kornilov
Reviewed-by: Masahiko Sawada, Michael Paquier
Discussion: https://postgr.es/m/11587951532155118@sas1-19a94364928d.qloud-c.yandex.net
-rw-r--r-- | src/backend/commands/vacuumlazy.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c index 5649a70800d..8996d366e91 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -374,10 +374,20 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params, * emitting individual parts of the message when not applicable. */ initStringInfo(&buf); - if (aggressive) - msgfmt = _("automatic aggressive vacuum of table \"%s.%s.%s\": index scans: %d\n"); + if (params->is_wraparound) + { + if (aggressive) + msgfmt = _("automatic aggressive vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n"); + else + msgfmt = _("automatic vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n"); + } else - msgfmt = _("automatic vacuum of table \"%s.%s.%s\": index scans: %d\n"); + { + if (aggressive) + msgfmt = _("automatic aggressive vacuum of table \"%s.%s.%s\": index scans: %d\n"); + else + msgfmt = _("automatic vacuum of table \"%s.%s.%s\": index scans: %d\n"); + } appendStringInfo(&buf, msgfmt, get_database_name(MyDatabaseId), get_namespace_name(RelationGetNamespace(onerel)), |