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 1k7P6A-0000Zj-Vw for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Aug 2020 20:17:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k7P69-0000Ds-Kj for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Aug 2020 20:17:45 +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 1k7P69-0000Dk-DD for pgsql-hackers@lists.postgresql.org; Sun, 16 Aug 2020 20:17:45 +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 1k7P62-0006KZ-RV; Sun, 16 Aug 2020 20:17:45 +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 07GKHNVp1013485; Sun, 16 Aug 2020 16:17:23 -0400 From: Tom Lane To: Andres Freund cc: Robert Haas , Thomas Munro , Alvaro Herrera , Daniel Gustafsson , "Jonathan S. Katz" , Alexander Korotkov , PostgreSQL Hackers , Peter Geoghegan , Bruce Momjian , David Rowley Subject: Re: Improving connection scalability: GetSnapshotData() In-reply-to: <1006917.1597602624@sss.pgh.pa.us> References: <20200716012532.lfzpvg3w55d5rqrw@alap3.anarazel.de> <20200716013306.GA13861@alvherre.pgsql> <20200724011143.jccsyvsvymuiqfxu@alap3.anarazel.de> <20200812001938.ixenvxdpg4ielbue@alap3.anarazel.de> <20200812173855.s4co5jz67z7tlnl7@alap3.anarazel.de> <872191.1597504251@sss.pgh.pa.us> <20200815164200.drok4tt5ju7ijivf@alap3.anarazel.de> <20200816181604.l54m6kss5ntd6xow@alap3.anarazel.de> <1006917.1597602624@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 16 Aug 2020 14:30:24 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <1013229.1597609003.0@sss.pgh.pa.us> Date: Sun, 16 Aug 2020 16:17:23 -0400 Message-ID: <1013484.1597609043@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1013229.1597609003.1@sss.pgh.pa.us> I wrote: > It seems entirely likely that there's a timing component in this, for > instance autovacuum coming along at just the right time. D'oh. The attached seems to make it 100% reproducible. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="add-delay-before-vacuum.patch"; charset="us-ascii" Content-ID: <1013229.1597609003.2@sss.pgh.pa.us> Content-Description: add-delay-before-vacuum.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/test/isolation/specs/freeze-the-dead.spec b/src/test/isol= ation/specs/freeze-the-dead.spec index 915bf15b92..4100d9fc6f 100644 --- a/src/test/isolation/specs/freeze-the-dead.spec +++ b/src/test/isolation/specs/freeze-the-dead.spec @@ -32,6 +32,7 @@ session "s2" step "s2_begin" { BEGIN; } step "s2_key_share" { SELECT id FROM tab_freeze WHERE id =3D 3 FOR KEY SH= ARE; } step "s2_commit" { COMMIT; } +step "s2_wait" { select pg_sleep(60); } step "s2_vacuum" { VACUUM FREEZE tab_freeze; } = session "s3" @@ -49,6 +50,7 @@ permutation "s1_begin" "s2_begin" "s3_begin" # start tra= nsactions "s1_update" "s2_key_share" "s3_key_share" # have xmax be a multi with = an updater, updater being oldest xid "s1_update" # create additional row version that has multis "s1_commit" "s2_commit" # commit both updater and share locker + "s2_wait" "s2_vacuum" # due to bug in freezing logic, we used to *not* prune upd= ated row, and then froze it "s1_selectone" # if hot chain is broken, the row can't be found via in= dex scan "s3_commit" # commit remaining open xact ------- =_aaaaaaaaaa0--