pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Race condition in recovery?
Date: Sat, 12 Jun 2021 10:20:24 -0400
Message-ID: <2178605.1623507624@sss.pgh.pa.us> (raw)
In-Reply-To: <ec794e40-7900-44f8-8ba8-2ba846c597c5@dunslane.net>
References: <CA+TgmobANgehu3155Pds=39do9izsOjgVwSeKZ0avrSNQdjDOQ@mail.gmail.com>
	<20210611.104036.2233408362728572267.horikyota.ntt@gmail.com>
	<1832766.1623376398@sss.pgh.pa.us>
	<20210611.151459.1951886846697638472.horikyota.ntt@gmail.com>
	<CAFiTN-srU8=ND8z2wV8G+vhYZ4dMeWWNrFd0Cq0X9mDaL2ntAw@mail.gmail.com>
	<1880685.1623422805@sss.pgh.pa.us>
	<YMRm4lpl3kAOFih6@paquier.xyz>
	<38830da5-ae00-2262-0f0d-e6b25d9df921@dunslane.net>
	<ec794e40-7900-44f8-8ba8-2ba846c597c5@dunslane.net>

Andrew Dunstan <andrew@dunslane.net> writes:
> I have pushed a fix, tested on a replica of fairywren/drongo,

This bit seems a bit random:

 # WAL segment, this is enough to guarantee that the history file was
 # archived.
 my $archive_wait_query =
-  "SELECT '$walfile_to_be_archived' <= last_archived_wal FROM pg_stat_archiver;";
+  "SELECT coalesce('$walfile_to_be_archived' <= last_archived_wal, false) " .
+  "FROM pg_stat_archiver";
 $node_standby->poll_query_until('postgres', $archive_wait_query)
   or die "Timed out while waiting for WAL segment to be archived";
 my $last_archived_wal_file = $walfile_to_be_archived;

I wonder whether that is a workaround for the poll_query_until bug
I proposed to fix at [1].

			regards, tom lane

[1] https://www.postgresql.org/message-id/2130215.1623450521%40sss.pgh.pa.us





view thread (117+ messages)  latest in thread

Message-ID: <2178605.1623507624@sss.pgh.pa.us>
Permalink:  ../2178605.1623507624@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2178605.1623507624@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@dunslane.net, michael@paquier.xyz, dilipbalaut@gmail.com, horikyota.ntt@gmail.com, robertmhaas@gmail.com, hlinnaka@iki.fi
  Subject: Re: Race condition in recovery?
  In-Reply-To: <2178605.1623507624@sss.pgh.pa.us>
  References: <CA+TgmobANgehu3155Pds=39do9izsOjgVwSeKZ0avrSNQdjDOQ@mail.gmail.com> <20210611.104036.2233408362728572267.horikyota.ntt@gmail.com> <1832766.1623376398@sss.pgh.pa.us> <20210611.151459.1951886846697638472.horikyota.ntt@gmail.com> <CAFiTN-srU8=ND8z2wV8G+vhYZ4dMeWWNrFd0Cq0X9mDaL2ntAw@mail.gmail.com> <1880685.1623422805@sss.pgh.pa.us> <YMRm4lpl3kAOFih6@paquier.xyz> <38830da5-ae00-2262-0f0d-e6b25d9df921@dunslane.net> <ec794e40-7900-44f8-8ba8-2ba846c597c5@dunslane.net> <2178605.1623507624@sss.pgh.pa.us>

* 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