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 1uSjpJ-00CR75-Oz for pgsql-committers@arkaria.postgresql.org; Fri, 20 Jun 2025 22:03:13 +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 1uSjpG-004ZmT-D3 for pgsql-committers@arkaria.postgresql.org; Fri, 20 Jun 2025 22:03:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSjpG-004ZmL-5k for pgsql-committers@lists.postgresql.org; Fri, 20 Jun 2025 22:03:10 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uSjpE-0037oh-0T; Fri, 20 Jun 2025 22:03:08 +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 55KM35Ax2542024; Fri, 20 Jun 2025 18:03:06 -0400 From: Tom Lane To: Melanie Plageman cc: Alexander Korotkov , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Improve runtime and output of tests for replication slots checkp In-reply-to: References: Comments: In-reply-to Melanie Plageman message dated "Fri, 20 Jun 2025 12:10:07 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2542022.1750456985.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 20 Jun 2025 18:03:05 -0400 Message-ID: <2542023.1750456985@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Melanie Plageman writes: > Quite a few animals have started failing since this commit (for example > [1]) . I haven't looked into why, but I suspect something is wrong. It looks to me like it's being triggered by this questionable bit in = 046_checkpoint_logical_slot.pl: # Continue the checkpoint. $node->safe_psql('postgres', q{select injection_points_wakeup('checkpoint-before-old-wal-removal')}); # Abruptly stop the server (1 second should be enough for the checkpoint # to finish; it would be better). $node->stop('immediate'); That second comment is pretty unintelligible, but I think it's expecting that we'd give the checkpoint 1 second to complete, which the code is *not* doing. On my own machine it looks like the checkpoint does manage to complete within about 1ms, just barely before the shutdown arrives: 2025-06-20 17:52:25.599 EDT [2538690] 046_checkpoint_logical_slot.pl LOG: = statement: select pg_replication_slot_advance('slot_physical', pg_current= _wal_lsn()) 2025-06-20 17:52:25.602 EDT [2538692] 046_checkpoint_logical_slot.pl LOG: = statement: select injection_points_wakeup('checkpoint-before-old-wal-remo= val') 2025-06-20 17:52:25.603 EDT [2538557] LOG: checkpoint complete: wrote 1 b= uffers (0.0%), wrote 0 SLRU buffers; 0 WAL file(s) added, 0 removed, 0 rec= ycled; write=3D0.003 s, sync=3D0.001 s, total=3D1.074 s; sync files=3D0, l= ongest=3D0.000 s, average=3D0.000 s; distance=3D327688 kB, estimate=3D3276= 88 kB; lsn=3D0/290020C0, redo lsn=3D0/29002068 2025-06-20 17:52:25.604 EDT [2538553] LOG: received immediate shutdown re= quest But in the buildfarm failures I don't see any 'checkpoint complete' before the shutdown. If this is an accurate diagnosis then it indicates both a test bug (it should delay here, or else the comment needs fixed to explain what we're actually testing) and a backend bug, because an immediate stop a/k/a crash before completing the checkpoint should not lead to failure to function after the next restart. regards, tom lane