Обсуждение: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration

Поиск
Список
Период
Сортировка

Indicate anti-wraparound autovacuum in log_autovacuum_min_duration

От
Sergei Kornilov
Дата:
Hello
Currently log_autovacuum_min_duration log message has no difference between regular autovacuum and to prevent
wraparoundautovacuum. There are important differences, for example, backend can automatically cancel regular
autovacuum,but not anti-wraparound. I think it is useful indicate anti-wraparound in logs.
 

Small patch attached. I am not sure can be anti-wraparound autovacuum not aggressive, so i leave all 4 variants.

regards, Sergei
Вложения

Re: Indicate anti-wraparound autovacuum inlog_autovacuum_min_duration

От
Michael Paquier
Дата:
On Sat, Jul 21, 2018 at 09:38:38AM +0300, Sergei Kornilov wrote:
> Currently log_autovacuum_min_duration log message has no difference
> between regular autovacuum and to prevent wraparound autovacuum. There
> are important differences, for example, backend can automatically
> cancel regular autovacuum, but not anti-wraparound. I think it is
> useful indicate anti-wraparound in logs.

Yes, a bit more verbosity would be nice for that.  Using the term
"anti-wraparound" directly in the logs makes the most sense?

> Small patch attached. I am not sure can be anti-wraparound autovacuum
> not aggressive, so i leave all 4 variants.

The patch could be made simpler by using empty strings with a single
ereport() call.
--
Michael

Вложения

Re: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration

От
Sergei Kornilov
Дата:
Hello

> Yes, a bit more verbosity would be nice for that. Using the term
> "anti-wraparound" directly in the logs makes the most sense?
I used "(to prevent wraparound)" to looks like reporting in pg_stat_activity. As far i can see currently we not using
"anti-wraparound"for user messages.
 
On the other hand we using anti-wraparound in docs, so i can change wording.

> The patch could be made simpler by using empty strings with a single
> ereport() call.
How about proper translate in this case? Currently we translate full line "automatic vacuum of table \"%s.%s.%s\":
indexscans: %d\n" before ereport call.
 

regards, Sergei


Re: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration

От
Robert Haas
Дата:
On Sat, Jul 21, 2018 at 4:22 AM, Michael Paquier <michael@paquier.xyz> wrote:
> On Sat, Jul 21, 2018 at 09:38:38AM +0300, Sergei Kornilov wrote:
>> Currently log_autovacuum_min_duration log message has no difference
>> between regular autovacuum and to prevent wraparound autovacuum. There
>> are important differences, for example, backend can automatically
>> cancel regular autovacuum, but not anti-wraparound. I think it is
>> useful indicate anti-wraparound in logs.
>
> Yes, a bit more verbosity would be nice for that.  Using the term
> "anti-wraparound" directly in the logs makes the most sense?

I'm not particularly in love with that terminology.  I doubt that it's
very clear to the average user.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration

От
Masahiko Sawada
Дата:
On Sat, Jul 21, 2018 at 6:26 PM, Sergei Kornilov <sk@zsrv.org> wrote:
> Hello
>
>> Yes, a bit more verbosity would be nice for that. Using the term
>> "anti-wraparound" directly in the logs makes the most sense?
> I used "(to prevent wraparound)" to looks like reporting in pg_stat_activity. As far i can see currently we not using
"anti-wraparound"for user messages.
 
> On the other hand we using anti-wraparound in docs, so i can change wording.

+1 for "to prevent wraparound".

>
>> The patch could be made simpler by using empty strings with a single
>> ereport() call.
> How about proper translate in this case? Currently we translate full line "automatic vacuum of table \"%s.%s.%s\":
indexscans: %d\n" before ereport call.
 
>

Yeah, for translation I think it's better to make full lines. When we
added "aggressive" to autovacuum logs (commit b55509)  we've done the
same thing.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


Re: Indicate anti-wraparound autovacuum inlog_autovacuum_min_duration

От
Michael Paquier
Дата:
On Tue, Jul 24, 2018 at 06:02:00PM +0900, Masahiko Sawada wrote:
> Yeah, for translation I think it's better to make full lines. When we
> added "aggressive" to autovacuum logs (commit b55509)  we've done the
> same thing.

I am wondering if it would easier to add an extra line in the output,
like "Options: aggressive, wraparound prevention" or such...
--
Michael

Вложения

Re: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration

От
Masahiko Sawada
Дата:
On Tue, Jul 24, 2018 at 8:25 PM, Michael Paquier <michael@paquier.xyz> wrote:
> On Tue, Jul 24, 2018 at 06:02:00PM +0900, Masahiko Sawada wrote:
>> Yeah, for translation I think it's better to make full lines. When we
>> added "aggressive" to autovacuum logs (commit b55509)  we've done the
>> same thing.
>
> I am wondering if it would easier to add an extra line in the output,
> like "Options: aggressive, wraparound prevention" or such...

It would be useful if we have a number of the options autovacuum
workers could use but since there are only 2 I'm not sure we need the
list-style.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


Re: Indicate anti-wraparound autovacuum inlog_autovacuum_min_duration

От
Michael Paquier
Дата:
On Wed, Sep 12, 2018 at 05:36:31PM +0900, Masahiko Sawada wrote:
> It would be useful if we have a number of the options autovacuum
> workers could use but since there are only 2 I'm not sure we need the
> list-style.

Looking at what Sergei has proposed upthread again, using a
comma-separated list of options may be more painful for translators as
such lists really depend on the language, so I would be fine to commit
what has been added.

One last point though: we use anti-wraparound in already five places in
the docs, still I have sympathy for "to prevent wraparound" as well.
The brackets look rather useless to me, wouldn't it be better to remove
them?  By doing so the longest message becomes:
"automatic aggressive vacuum to prevent wraparound of table blah.blah"
--
Michael

Вложения

Re: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration

От
Sergei Kornilov
Дата:
Hello

> The brackets look rather useless to me, wouldn't it be better to remove
> them? By doing so the longest message becomes:
> "automatic aggressive vacuum to prevent wraparound of table blah.blah"
Hmm,

> 2018-09-13 11:48:09.303 MSK 6994 @ from  [vxid:6/713 txid:0] [] LOG:  automatic aggressive vacuum (to prevent
wraparound)of table "template0.pg_toast.pg_toast_12252": index scans: 0
 
or
> 2018-09-13 11:54:55.095 MSK 10115 @ from  [vxid:3/100278 txid:0] [] LOG:  automatic aggressive vacuum to prevent
wraparoundof table "template0.pg_toast.pg_toast_12252": index scans: 0
 

Looks better for me. Updated patch attached.

regards, Sergei
Вложения

Re: Indicate anti-wraparound autovacuum inlog_autovacuum_min_duration

От
Michael Paquier
Дата:
On Thu, Sep 13, 2018 at 12:00:49PM +0300, Sergei Kornilov wrote:
> Looks better for me. Updated patch attached.

Thanks Sergei for the new version, pushed.
--
Michael

Вложения

Re: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration

От
Sergei Kornilov
Дата:
> Thanks Sergei for the new version, pushed.
Thank you!

regards, Sergei