Skip to content

Commit 28a8fa9

Browse files
committed
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
1 parent f48fa2b commit 28a8fa9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/backend/commands/vacuumlazy.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,20 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
374374
* emitting individual parts of the message when not applicable.
375375
*/
376376
initStringInfo(&buf);
377-
if (aggressive)
378-
msgfmt = _("automatic aggressive vacuum of table \"%s.%s.%s\": index scans: %d\n");
377+
if (params->is_wraparound)
378+
{
379+
if (aggressive)
380+
msgfmt = _("automatic aggressive vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n");
381+
else
382+
msgfmt = _("automatic vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n");
383+
}
379384
else
380-
msgfmt = _("automatic vacuum of table \"%s.%s.%s\": index scans: %d\n");
385+
{
386+
if (aggressive)
387+
msgfmt = _("automatic aggressive vacuum of table \"%s.%s.%s\": index scans: %d\n");
388+
else
389+
msgfmt = _("automatic vacuum of table \"%s.%s.%s\": index scans: %d\n");
390+
}
381391
appendStringInfo(&buf, msgfmt,
382392
get_database_name(MyDatabaseId),
383393
get_namespace_name(RelationGetNamespace(onerel)),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy