Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdIyx-00EXmT-03 for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2024 00:32:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sdIyt-00Cplo-Q0 for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2024 00:32:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdIyt-00Cpla-Fl for pgsql-hackers@lists.postgresql.org; Mon, 12 Aug 2024 00:32:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdIyq-004M45-TD for pgsql-hackers@postgresql.org; Mon, 12 Aug 2024 00:32:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 47C0W5HB352069; Sun, 11 Aug 2024 20:32:05 -0400 From: Tom Lane To: Andrew Dunstan cc: Alexander Lakhin , Thomas Munro , Michael Paquier , pgsql-hackers , Andres Freund , Bharath Rupireddy Subject: Re: Recent 027_streaming_regress.pl hangs In-reply-to: <4205a24d-a1ce-4658-99d7-b00d8472d4c0@dunslane.net> References: <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> <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> <3390479.1722441934@sss.pgh.pa.us> <4205a24d-a1ce-4658-99d7-b00d8472d4c0@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Wed, 31 Jul 2024 12:58:37 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <352031.1723422703.0@sss.pgh.pa.us> Date: Sun, 11 Aug 2024 20:32:05 -0400 Message-ID: <352068.1723422725@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <352031.1723422703.1@sss.pgh.pa.us> Andrew Dunstan 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 ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="instrument-wait_for_catchup-timeouts.patch"; charset="us-ascii" Content-ID: <352031.1723422703.2@sss.pgh.pa.us> Content-Description: instrument-wait_for_catchup-timeouts.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/Post= greSQL/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 =3D qq[SELECT application_name, ${mode}_lsn, state + FROM pg_catalog.pg_stat_replication + WHERE application_name IN ('$standby_name', 'walreceiver')]; + my $details =3D $self->safe_psql('postgres', $query); + diag qq(Last application_name|${mode}_lsn|state: +${details}); croak "timed out waiting for catchup"; } } ------- =_aaaaaaaaaa0--