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: Alexander Lakhin <exclusion@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Subject: Re: Recent 027_streaming_regress.pl hangs
Date: Sun, 11 Aug 2024 20:32:05 -0400
Message-ID: <352068.1723422725@sss.pgh.pa.us> (raw)
In-Reply-To: <4205a24d-a1ce-4658-99d7-b00d8472d4c0@dunslane.net>
References: <b871cdd5-153b-bf91-e24d-fab90394c022@gmail.com>
	<CA+hUKGJScMYiyM5SmwQ23Fwh1394=vQ+nxiV0ke2WocupThs+Q@mail.gmail.com>
	<2378342.1710449799@sss.pgh.pa.us>
	<20240321004145.obrbakt4ugzcsphy@awork3.anarazel.de>
	<20240326035607.grqoyrxjvpyhnkrf@awork3.anarazel.de>
	<2750204.1711425638@sss.pgh.pa.us>
	<20240326042832.4urkzpnwhawyngah@awork3.anarazel.de>
	<2756083.1711428894@sss.pgh.pa.us>
	<20240326075912.sia3wlvnaqnbf47u@awork3.anarazel.de>
	<7e914807-eeaa-5c44-3543-bb2888030122@gmail.com>
	<20240404170055.qynecay7szu3dgvu@awork3.anarazel.de>
	<f748ee55-9e73-3f5e-e879-8865c5e9933a@gmail.com>
	<a9a97e83-9ec8-5de5-bf69-80e9560f5345@gmail.com>
	<137979d0-943e-42c8-ab53-1244b30a6623@dunslane.net>
	<1505004.1721934379@sss.pgh.pa.us>
	<1563098.1721942053@sss.pgh.pa.us>
	<3d35a43c-2439-4840-9066-0a661efcf1f7@dunslane.net>
	<f61976a9-b045-42c0-9a5a-c142c2142641@dunslane.net>
	<3390479.1722441934@sss.pgh.pa.us>
	<4205a24d-a1ce-4658-99d7-b00d8472d4c0@dunslane.net>

Andrew Dunstan <andrew@dunslane.net> writes:
> We'll see. I have switched crake from --run-parallel mode to --run-all 
> mode i.e. the runs are serialized. Maybe that will be enough to stop the 
> errors. I'm still annoyed that this test is susceptible to load, if that 
> is indeed what is the issue.

crake is still timing out intermittently on 027_streaming_regress.pl,
so that wasn't it.  I think we need more data.  We know that the
wait_for_catchup query is never getting to true:

	SELECT '$target_lsn' <= ${mode}_lsn AND state = 'streaming'

but we don't know if the LSN condition or the state condition is
what is failing.  And if it is the LSN condition, it'd be good
to see the actual last LSN, so we can look for patterns like
whether there is a page boundary crossing involved.  So I suggest
adding something like the attached.

If we do this, I'd be inclined to instrument wait_for_slot_catchup
and wait_for_subscription_sync similarly, but I thought I'd check
for contrary opinions first.

			regards, tom lane

Attachments:

instrument-wait_for_catchup-timeouts.patch (text/x-diff, 687B) download diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index 32ee98aebc..3403626f92 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -2948,6 +2948,13 @@ sub wait_for_catchup } else { + # Fetch additional detail for debugging purposes + $query = qq[SELECT application_name, ${mode}_lsn, state + FROM pg_catalog.pg_stat_replication + WHERE application_name IN ('$standby_name', 'walreceiver')]; + my $details = $self->safe_psql('postgres', $query); + diag qq(Last application_name|${mode}_lsn|state: +${details}); croak "timed out waiting for catchup"; } }

view thread (31+ messages)  latest in thread

Message-ID: <352068.1723422725@sss.pgh.pa.us>
Permalink:  ../352068.1723422725@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/352068.1723422725@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, exclusion@gmail.com, thomas.munro@gmail.com, michael@paquier.xyz, andres@anarazel.de, bharath.rupireddyforpostgres@gmail.com
  Subject: Re: Recent 027_streaming_regress.pl hangs
  In-Reply-To: <352068.1723422725@sss.pgh.pa.us>
  References: <b871cdd5-153b-bf91-e24d-fab90394c022@gmail.com> <CA+hUKGJScMYiyM5SmwQ23Fwh1394=vQ+nxiV0ke2WocupThs+Q@mail.gmail.com> <2378342.1710449799@sss.pgh.pa.us> <20240321004145.obrbakt4ugzcsphy@awork3.anarazel.de> <20240326035607.grqoyrxjvpyhnkrf@awork3.anarazel.de> <2750204.1711425638@sss.pgh.pa.us> <20240326042832.4urkzpnwhawyngah@awork3.anarazel.de> <2756083.1711428894@sss.pgh.pa.us> <20240326075912.sia3wlvnaqnbf47u@awork3.anarazel.de> <7e914807-eeaa-5c44-3543-bb2888030122@gmail.com> <20240404170055.qynecay7szu3dgvu@awork3.anarazel.de> <f748ee55-9e73-3f5e-e879-8865c5e9933a@gmail.com> <a9a97e83-9ec8-5de5-bf69-80e9560f5345@gmail.com> <137979d0-943e-42c8-ab53-1244b30a6623@dunslane.net> <1505004.1721934379@sss.pgh.pa.us> <1563098.1721942053@sss.pgh.pa.us> <3d35a43c-2439-4840-9066-0a661efcf1f7@dunslane.net> <f61976a9-b045-42c0-9a5a-c142c2142641@dunslane.net> <3390479.1722441934@sss.pgh.pa.us> <4205a24d-a1ce-4658-99d7-b00d8472d4c0@dunslane.net> <352068.1723422725@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