Re: add checkpoint stats of snapshot and mapping files of pg_logical dir

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Cary Huang <cary(dot)huang(at)highgo(dot)ca>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: add checkpoint stats of snapshot and mapping files of pg_logical dir
Date: 2022-03-18 05:41:53
Message-ID: CALj2ACXoik_G0L1dK7uOC_ssES=qmjG2jn+oy47hLHnVyFpf3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 18, 2022 at 2:15 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> On Thu, Mar 17, 2022 at 06:48:43PM +0530, Bharath Rupireddy wrote:
> > Personally, I tend to agree with v4-0001 (option (4)) or v4-0002
> > (option (3)) than v4-0003 (option (1)) as it adds more unreadability
> > with most of the code duplicated creating more diff with previous
> > versions and maintainability problems. Having said that, I will leave
> > it to the committer to decide on that.
>
> I don't think v4-0003/option 1 needs to be unreadable. Perhaps we can use
> a StringInfo to build the message. That might be a net improvement in
> readability anyway.

Looks like we already use StringInfo in PerformAuthentication for
"connection" related log messages, see [1].

I will give it a try using StringInfo for the "checkpoint/restartpoint
complete" message too.

[1]
if (Log_connections)
{
StringInfoData logmsg;

initStringInfo(&logmsg);
if (am_walsender)
appendStringInfo(&logmsg, _("replication connection
authorized: user=%s"),
port->user_name);
else
appendStringInfo(&logmsg, _("connection authorized: user=%s"),
port->user_name);
if (!am_walsender)
appendStringInfo(&logmsg, _(" database=%s"), port->database_name);

Regards,
Bharath Rupireddy.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-03-18 05:52:48 Re: Column Filtering in Logical Replication
Previous Message Thomas Munro 2022-03-18 05:15:47 Re: pgsql: Add option to use ICU as global locale provider