Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkaE6-0000Wk-Q2 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Nov 2021 23:08:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mkaE5-0004sQ-Lz for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Nov 2021 23:08:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkaE5-0004sH-Ci for pgsql-hackers@lists.postgresql.org; Tue, 09 Nov 2021 23:08:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkaE3-0006dB-5r for pgsql-hackers@lists.postgresql.org; Tue, 09 Nov 2021 23:08:24 +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 1A9N87xg1372190; Tue, 9 Nov 2021 18:08:07 -0500 From: Tom Lane To: Alvaro Herrera cc: Andres Freund , Andrew Dunstan , "Bossart, Nathan" , Kyotaro Horiguchi , "masao.fujii@oss.nttdata.com" , "pgsql-hackers@lists.postgresql.org" , "mengjuan.cmj@alibaba-inc.com" , "Jakub.Wartak@tomtom.com" , Ryo Matsumura Subject: Re: prevent immature WAL streaming In-reply-to: <1669191.1635881881@sss.pgh.pa.us> References: <202110132209.uyw4ubpc2ztc@alvherre.pgsql> <1669191.1635881881@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 02 Nov 2021 15:38:01 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1372188.1636499287.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 09 Nov 2021 18:08:07 -0500 Message-ID: <1372189.1636499287@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Seems like this hasn't fixed the problem: skink still fails on > this test occasionally. > # Failed test '000000010000000000000002 differs from 00000001000000000= 0000002' > # at t/026_overwrite_contrecord.pl line 61. This is still happening off and on, which makes it look like a timing-sensitive problem. Confirming that, I can make it fail every time by adding a long sleep just ahead of where 026_overwrite_contrecord.pl captures $initfile. On reflection I think the problem is obvious: if autovacuum does anything concurrently with the test's startup portion, it will cause the carefully-established WAL insertion point to move into the next segment. I propose to add "autovacuum =3D off" to the test's postmaster configuration. Also, I think we want -ok($initfile !=3D $endfile, "$initfile differs from $endfile"); +ok($initfile ne $endfile, "$initfile differs from $endfile"); The existing coding works as long as all characters of these WAL segment names happen to be decimal digits, but ... regards, tom lane