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: ashutosh(dot)bapat(dot)oss(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: more descriptive message for process termination due to max_slot_wal_keep_size
Date: 2021-12-24 04:42:14
Message-ID: 20211224.134214.1646603596386019768.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 23 Dec 2021 18:08:08 +0530, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote in
> On Wed, Dec 15, 2021 at 9:42 AM Kyotaro Horiguchi
> <horikyota(dot)ntt(at)gmail(dot)com> wrote:
> > > LOG: invalidating slot "s1"
> > > DETAIL: The slot's restart_lsn 0/10000D68 is behind the limit 0/11000000 defined by max_slot_wal_keep_size.
> >
> > The second line could be changed like the following or anything other.
> >
> > > DETAIL: The slot's restart_lsn 0/10000D68 got behind the limit 0/11000000 determined by max_slot_wal_keep_size.
> > .....
> >
>
> The second version looks better as it gives more details. I am fine
> with either of the above wordings.
>
> I would prefer everything in the same message though since
> "invalidating slot ..." is too short a LOG message. Not everybody
> enabled details always.

Mmm. Right. I have gone too much to the same way with the
process-termination message.

I rearranged the meesages as follows in the attached version. (at master)

> 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.

> LOG: invalidating slot \"%s\" because its restart_LSN %X/%X exceeds max_slot_wal_keep_size
c> DETAIL: The slot got behind the limit %X/%X determined by max_slot_wal_keep_size.

The messages is actually incomplete even in 13 so I think the change
to the errmsg() message of the first message is worth back-patching.

- v3-0001-Make-a-message-on-process-termination-more-dscrip.patch

Changes only the first main message and it can be back-patched to 14.

- v3-0001-Make-a-message-on-process-termination-more-dscrip_13.patch

The same to the above but for 13, which doesn't have LSN_FORMAT_ARGS.

- v3-0002-Add-detailed-information-to-slot-invalidation-mes.patch

Attaches the DETAIL line shown above to both messages, only for the
master.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v3-0001-Make-a-message-on-process-termination-more-dscrip.patch text/x-patch 1.8 KB
v3-0001-Make-a-message-on-process-termination-more-dscrip_13.patch text/x-patch 1.9 KB
v3-0002-Add-detailed-information-to-slot-invalidation-mes.patch text/x-patch 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-12-24 04:49:15 Re: Allow escape in application_name
Previous Message Shinya Kato 2021-12-24 03:29:47 Re: Emit a warning if the extension's GUC is set incorrectly