From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Drouvot, Bertrand <bdrouvot@amazon.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Add Information during standby recovery conflicts
Date: Sat, 28 Nov 2020 14:36:26 -0300
Message-ID: <20201128173626.GA17184@alvherre.pgsql> (raw)
In-Reply-To: <28e04235-27e4-0697-68df-001d2b75bee6@amazon.com>
Hi Bertrand,
On 2020-Nov-28, Drouvot, Bertrand wrote:
> + if (nprocs > 0)
> + {
> + ereport(LOG,
> + (errmsg("recovery still waiting after %ld.%03d ms: %s",
> + msecs, usecs, _(get_recovery_conflict_desc(reason))),
> + (errdetail_log_plural("Conflicting process: %s.",
> + "Conflicting processes: %s.",
> + nprocs, buf.data))));
> + }
> + else
> + {
> + ereport(LOG,
> + (errmsg("recovery still waiting after %ld.%03d ms: %s",
> + msecs, usecs, _(get_recovery_conflict_desc(reason)))));
> + }
> +
> + pfree(buf.data);
> + }
> + else
> + ereport(LOG,
> + (errmsg("recovery still waiting after %ld.%03d ms: %s",
> + msecs, usecs, _(get_recovery_conflict_desc(reason)))));
> +}
Another trivial stylistic point is that you can collapse all these
ereport calls into one, with something like
ereport(LOG,
errmsg("recovery still waiting after ...", opts),
waitlist != NULL ? errdetail_log_plural("foo bar baz", opts) : 0);
where the "waitlist" has been constructed beforehand, or is set to NULL
if there's no process list.
> + switch (reason)
> + {
> + case PROCSIG_RECOVERY_CONFLICT_BUFFERPIN:
> + reasonDesc = gettext_noop("for recovery conflict on buffer pin");
> + break;
Pure bikeshedding after discussing this with my pillow: I think I'd get
rid of the initial "for" in these messages.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, bdrouvot@amazon.com, sawada.mshk@gmail.com, masao.fujii@oss.nttdata.com, masahiko.sawada@2ndquadrant.com, horikyota.ntt@gmail.com
Subject: Re: Add Information during standby recovery conflicts
In-Reply-To: <20201128173626.GA17184@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox