Re: more descriptive message for process termination due to max_slot_wal_keep_size

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: sawada(dot)mshk(at)gmail(dot)com
Cc: ashutosh(dot)bapat(dot)oss(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: more descriptive message for process termination due to max_slot_wal_keep_size
Date: 2022-01-04 01:29:31
Message-ID: 20220104.102931.1400105396066285349.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Fri, 24 Dec 2021 20:23:29 +0900, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote in
> On Fri, Dec 24, 2021 at 5:30 PM Kyotaro Horiguchi
> <horikyota(dot)ntt(at)gmail(dot)com> wrote:
> > Right. But I believe the two are not assumed to be used at once. One
> > can set wal_keep_size larger than max_slot_wal_keep_size but it is
> > actually a kind of ill setting.
> >
> > LOG: terminating process %d to release replication slot \"%s\" because its restart_lsn %X/%X exceeds max_slot_wal_keep_size
> > DETAIL: The slot got behind the limit %X/%X determined by max_slot_wal_keep_size and wal_keep_size.
> >
> > Mmm. I don't like this. I feel we don't need such detail in the
> > message.
>
> How about something like:
>
> LOG: terminating process %d to release replication slot \"%s\"
> because its restart_lsn %X/%X exceeds the limit
> DETAIL: The slot got behind the limit %X/%X
> HINT: You might need to increase max_slot_wal_keep_size or wal_keep_size.

The message won't be seen when max_slot_wal_keep_size is not set. So
we don't recommend to increase wal_keep_size in that case. We might
need inhibit (or warn)the two parameters from being activated at once,
but it would be another issue.

Another point is how people determine the value for the parameter. I
suppose (or believe) max_slot_wal_keep_size is not a kind to set to
minimal first then increase later but a kind to set to maximum
allowable first. On the other hand we suggest as the follows for
too-small max_wal_size so we could do the same for this parameter.

> HINT: Consider increasing the configuration parameter \"max_wal_size\".

Also, I don't like we have three lines for this message. If the DETAIL
adds only the specific value of the limit, I think it'd better append
it to the main message.

So what do you say if I propose the following?

LOG: terminating process %d to release replication slot \"%s\"
because its restart_lsn %X/%X exceeds the limit %X/%X
HINT: You might need to increase max_slot_wal_keep_size.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2022-01-04 01:39:56 Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)
Previous Message Kyotaro Horiguchi 2022-01-04 00:54:20 Re: An obsolete comment of pg_stat_statements