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 1nemYz-0005Vq-7V for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 23:38:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nemYy-0003ic-0y for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 23:38:16 +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 1nemYx-0003iT-Ny for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 23:38:15 +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 1nemYt-0004uc-5a for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 23:38: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 23DNc65H1364998; Wed, 13 Apr 2022 19:38:06 -0400 From: Tom Lane To: Peter Geoghegan cc: Andres Freund , David Rowley , PostgreSQL Hackers Subject: Re: Intermittent buildfarm failures on wrasse In-reply-to: References: <1346227.1649887693@sss.pgh.pa.us> <1349964.1649890446@sss.pgh.pa.us> <9F59C4BB-3C82-44B0-9B10-4A2CCC3DE552@anarazel.de> Comments: In-reply-to Peter Geoghegan message dated "Wed, 13 Apr 2022 16:17:02 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1364996.1649893086.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 13 Apr 2022 19:38:06 -0400 Message-ID: <1364997.1649893086@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Geoghegan writes: > On Wed, Apr 13, 2022 at 4:13 PM Andres Freund wrote= : >> IIRC the problem in matter isn't skipped pages, but that the horizon si= mply isn't new enough to mark pages as all visible. > Sometimes OldestXmin can go backwards in VACUUM operations that are > run in close succession against the same table, due to activity from > other databases in the same cluster (perhaps other factors are > involved at times). I've been doing some testing locally by inserting commands to manually set tenk1's relallvisible to zero. I first did that in test_setup.sql ... and it had no effect whatsoever. Further experimentation showed that the "CREATE INDEX ON tenk1" steps in create_index.sql itself generally suffice to fix relallvisible; although if you force it back to zero after the last such command, you get the same plan diffs wrasse is showing. And you don't get any others, which I thought curious until I realized that sanity_check.sql's database-wide VACUUM offers yet another opportunity to heal the incorrect value. If you force it back to zero again after that, a bunch of later tests start to show plan differences, which is what I'd been expecting. So what seems to be happening on wrasse is that a background autovacuum (or really autoanalyze?) is preventing pages from being marked all-visible not only during test_setup.sql but also create_index.sql; but it's gone by the time sanity_check.sql runs. Which is odd in itself because not that much time elapses between create_index and sanity_check, certainly less than the time from test_setup to create_index. It seems like a reliable fix might require test_setup to wait for any background autovac to exit before it does its own vacuums. Ick. And we still lack an explanation of why this only now broke. I remain suspicious that pgstats is behaving unexpectedly. regards, tom lane