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 1nrv8g-0000q3-1E for pgsql-hackers@arkaria.postgresql.org; Fri, 20 May 2022 05:25: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 1nrv8e-0000RH-TR for pgsql-hackers@arkaria.postgresql.org; Fri, 20 May 2022 05:25:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrv8e-0000R8-Jg for pgsql-hackers@lists.postgresql.org; Fri, 20 May 2022 05:25:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrv8Z-0001IC-VZ for pgsql-hackers@lists.postgresql.org; Fri, 20 May 2022 05:25: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 24K5PAoY275477; Fri, 20 May 2022 01:25:10 -0400 From: Tom Lane To: Andres Freund cc: Kyotaro Horiguchi , myon@debian.org, pgsql-hackers@lists.postgresql.org Subject: Re: 15beta1 test failure on mips in isolation/expected/stats In-reply-to: <20220520044106.dxvm55g3o2yhvdzj@alap3.anarazel.de> References: <250690.1653010951@sss.pgh.pa.us> <20220520.110221.606276306063702515.horikyota.ntt@gmail.com> <20220520.111427.2049044078750812296.horikyota.ntt@gmail.com> <258994.1653015494@sss.pgh.pa.us> <20220520035928.c5k267fgsxhtpbnt@alap3.anarazel.de> <268353.1653020534@sss.pgh.pa.us> <20220520044106.dxvm55g3o2yhvdzj@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 19 May 2022 21:41:06 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <275475.1653024310.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 20 May 2022 01:25:10 -0400 Message-ID: <275476.1653024310@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-05-20 00:22:14 -0400, Tom Lane wrote: >> There's some fallout in the expected-file, of course, but this >> does seem to fix it (20 consecutive successful runs now at >> 100/2). Don't see why though ... > I think what might be happening is that the transactional stats updates = get > reported by s2 *before* the non-transactional stats updates come in from > s1. I.e. the pgstat_report_stat() at the end of s2_commit_prepared_a doe= s a > report, because the machine is slow enough for it to be "time to reports= stats > again". Then s1 reports its non-transactional stats. Sounds plausible. And I left the test loop running, and it's now past 100 consecutive successes, so I think this change definitely "fixes" it. > It looks like our stats maintenance around truncation isn't quite "concu= rrency > safe". That code hasn't meaningfully changed, but it'd not be surprising= if > it's not 100% precise... Yeah. Probably not something to try to improve post-beta, especially since it's not completely clear how transactional and non-transactional cases *should* interact. Maybe non-transactional updates should be pushed immediately? But I'm not sure if that's fully correct, and it definitely sounds expensive. I'd be good with tweaking this test case as you suggest, and maybe revisiting the topic later. Kyotaro-san worried about whether any other places in stats.spec have the same issue. I've not seen any evidence of that in my tests, but perhaps some other machine with different timing could find it. regards, tom lane