pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Drouvot, Bertrand <bdrouvot@amazon.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: Mon, 30 Nov 2020 15:25:28 -0300
Message-ID: <20201130182528.GA1854@alvherre.pgsql> (raw)
In-Reply-To: <fafa607c-9e85-b742-ab46-2ee807ab9364@oss.nttdata.com>

On 2020-Dec-01, Fujii Masao wrote:

> +			if (proc)
> +			{
> +				if (nprocs == 0)
> +					appendStringInfo(&buf, "%d", proc->pid);
> +				else
> +					appendStringInfo(&buf, ", %d", proc->pid);
> +
> +				nprocs++;
> 
> What happens if all the backends in wait_list have gone? In other words,
> how should we handle the case where nprocs == 0 (i.e., nprocs has not been
> incrmented at all)? This would very rarely happen, but can happen.
> In this case, since buf.data is empty, at least there seems no need to log
> the list of conflicting processes in detail message.

Yes, I noticed this too; this can be simplified by changing the
condition in the ereport() call to be "nprocs > 0" (rather than
wait_list being null), otherwise not print the errdetail.  (You could
test buf.data or buf.len instead, but that seems uglier to me.)





view thread (82+ messages)  latest in thread

Message-ID: <20201130182528.GA1854@alvherre.pgsql>
Permalink:  ../20201130182528.GA1854@alvherre.pgsql/
Also on:    postgresql.org/message-id/20201130182528.GA1854@alvherre.pgsql

 · 

reply

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, masao.fujii@oss.nttdata.com, sawada.mshk@gmail.com, bdrouvot@amazon.com, masahiko.sawada@2ndquadrant.com, horikyota.ntt@gmail.com
  Subject: Re: Add Information during standby recovery conflicts
  In-Reply-To: <20201130182528.GA1854@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