pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: hlinnaka@iki.fi
Cc: pgsql-hackers@postgresql.org
Subject: Re: Race conditions in 019_replslot_limit.pl
Date: Thu, 24 Mar 2022 15:05:40 -0400
Message-ID: <3042597.1648148740@sss.pgh.pa.us> (raw )
In-Reply-To: <20220226072325.wtvkwvvga2wc3nkn@alap3.anarazel.de >
References: <20220217040300.c5lazcsatd7nvesd@alap3.anarazel.de >
<20220218003434.6qk24mkaqiaoyyna@alap3.anarazel.de >
<20220218034140.t7sprel3qpghzu4t@alap3.anarazel.de >
<20220218055521.2cwrk64ka527nrcs@alap3.anarazel.de >
<20220218224248.wjqdn2km3gwzlulz@alap3.anarazel.de >
<20220218231415.c4plkp4i3reqcwip@alap3.anarazel.de >
<20220223020624.ikohjufhyqrt5k6t@alap3.anarazel.de >
<20220225192941.hqnvefgdzaro6gzg@alap3.anarazel.de >
<1986228.1645819621@sss.pgh.pa.us >
<20220225201558.iabxf6k7edohggo7@alap3.anarazel.de >
<20220226072325.wtvkwvvga2wc3nkn@alap3.anarazel.de >
I just noticed something very interesting: in a couple of recent
buildfarm runs with this failure, the pg_stat_activity printout
no longer shows the extra walsender:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=serinus&dt=2022-03-24%2017%3A50%3A10
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=xenodermus&dt=2022-03-23%2011%3A00%3A05
This is just two of the 33 such failures in the past ten days,
so maybe it's not surprising that we didn't see it already.
(I got bored before looking back further than that.)
What this suggests to me is that maybe the extra walsender is
indeed not blocked on anything, but is just taking its time
about exiting. In these two runs, as well as in all the
non-failing runs, it had enough time to do so.
I suggest that we add a couple-of-seconds sleep in front of
the query that collects walsender PIDs, and maybe a couple more
seconds before the pg_stat_activity probe in the failure path,
and see if the behavior changes at all. That should be enough
to confirm or disprove this idea pretty quickly. If it is
right, a permanent fix could be to wait for the basebackup's
walsender to disappear from node_primary3's pg_stat_activity
before we start the one for node_standby3.
regards, tom lane
view thread (42+ messages) latest in thread
Message-ID: <3042597.1648148740@sss.pgh.pa.us>
Permalink: ../3042597.1648148740@sss.pgh.pa.us/
Also on: postgresql.org/message-id/3042597.1648148740@sss.pgh.pa.us
copy link · copy postgr.es
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: tgl@sss.pgh.pa.us, andres@anarazel.de, sawada.mshk@gmail.com, horikyota.ntt@gmail.com, hlinnaka@iki.fi
Subject: Re: Race conditions in 019_replslot_limit.pl
In-Reply-To: <3042597.1648148740@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