From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: Parallel Append subplan order instability on aye-aye
Date: Thu, 26 Sep 2019 13:14:02 -0400
Message-ID: <24480.1569518042@sss.pgh.pa.us> (raw)
In-Reply-To: <11424.1565563296@sss.pgh.pa.us>
References: <CA+hUKG+0CxrKRWRMf5ymN3gm+BECHna2B-q1w8onKBep4HasUw@mail.gmail.com>
<2863.1558327585@sss.pgh.pa.us>
<CA+hUKGL1jZaZuUAtBhx0Bh6-qcOi5YwT9dZh8eZWmNmPauJvjA@mail.gmail.com>
<CAKJS1f-KovGF5-j8xMdMufrF-i=dJqmS=nh0Y3=pBtvLnAN6hw@mail.gmail.com>
<3341.1558449552@sss.pgh.pa.us>
<CA+hUKGJLgTy36PLGcMJWFqaYwyHWugtmYjaZD179z_FcxHp9cQ@mail.gmail.com>
<1588.1558500275@sss.pgh.pa.us>
<1554.1563236463@sss.pgh.pa.us>
<CA+hUKGLc1b_uknzYWJbgZnPnip3x-KJmP-M7gVn7Q6=-8cXgRg@mail.gmail.com>
<CA+hUKGKUBmYOrZFkvYHiyrfCW5WsVTRwCaS8mTaiY-Dyk1tCkw@mail.gmail.com>
<11424.1565563296@sss.pgh.pa.us>
I wrote:
> Yeah. I think we've had quite enough of the stats-transmission-related
> failures, and they're no longer proving anything about the original
> problem. So I will go do what I proposed in mid-July and revert the
> stats queries, while keeping the reltuples/relpages check. (I'd kind
> of like to get more confirmation that the plan shape change is associated
> with those fields reading as zeroes, before we decide what to do about the
> underlying instability.)
Christoph Berg's recent complaint reminded me to scan the buildfarm
database again for info related to this issue, and I found this:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=moonjelly&dt=2019-07-02%2017%3A17%3A02
in which the failure diffs are
inline patch 1: /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/bin/pg_upgrade/tmp_check/regress/results/select_parallel.out, /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/bin/pg_upgrade/tmp_check/regress/results/stats.out (+3/-3 lines) download inline-1.patchdiff -U3 /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/test/regress/expected/select_parallel.out /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/bin/pg_upgrade/tmp_check/regress/results/select_parallel.out
--- /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/test/regress/expected/select_parallel.out 2019-05-21 19:17:03.472207619 +0200+++ /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/bin/pg_upgrade/tmp_check/regress/results/select_parallel.out 2019-07-02 19:21:53.643095637 +0200@@ -98,7 +98,7 @@
a_star | 1 | 3
b_star | 1 | 4
c_star | 1 | 4
- d_star | 1 | 16+ d_star | 0 | 0
e_star | 1 | 7
f_star | 1 | 16
(6 rows)
@@ -130,7 +130,7 @@
-----------------------------------------------------
Finalize Aggregate
-> Gather
- Workers Planned: 1+ Workers Planned: 3
-> Partial Aggregate
-> Append
-> Parallel Seq Scan on a_star
diff -U3 /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/test/regress/expected/stats.out /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/bin/pg_upgrade/tmp_check/regress/results/stats.out
--- /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/test/regress/expected/stats.out 2019-05-21 19:17:03.472207619 +0200+++ /home/fabien/pg/build-farm-10/buildroot/HEAD/pgsql.build/src/bin/pg_upgrade/tmp_check/regress/results/stats.out 2019-07-02 19:21:57.891105601 +0200@@ -208,7 +208,7 @@
a_star | 1 | 3
b_star | 1 | 4
c_star | 1 | 4
- d_star | 1 | 16+ d_star | 0 | 0
e_star | 1 | 7
f_star | 1 | 16
(6 rows)
While this fails to show the plan ordering difference we were looking for,
it does show that relpages/reltuples can sometimes read as zeroes for one
of these tables. (It also indicates that at least some of the
worker-count instability we've seen might trace to this same issue.)
That's the only related failure I could find in the last three months,
which makes me think that we've changed the regression tests enough that
the chance timing needed to cause this is (once again) very improbable.
So I'm prepared to give up waiting for more buildfarm evidence.
I propose to finish reverting f03a9ca43 in HEAD, and instead install
the attached in HEAD and v12. This follows the upthread suggestions
from Thomas and myself to use ANALYZE to ensure that these tables
have the expected relpages/reltuples entries.
In principle, we might need this further back than v12, but without having
seen a test failure in the wild I'm not tempted to back-patch further.
regards, tom lane
Patches and attachments:download all (2 files, .tar.gz)analyze-x-star-tables.patch (text/x-diff, 1.2K) downloaddiff --git a/src/test/regress/expected/create_misc.out b/src/test/regress/expected/create_misc.outindex 8366841..cee35ed 100644--- a/src/test/regress/expected/create_misc.out+++ b/src/test/regress/expected/create_misc.out@@ -130,6 +130,13 @@ INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2);
INSERT INTO f_star (class, f)
VALUES ('f', '(11111111,33333333),(22222222,44444444)'::polygon);
INSERT INTO f_star (class) VALUES ('f');
+-- Analyze the X_star tables for better plan stability in later tests+ANALYZE a_star;+ANALYZE b_star;+ANALYZE c_star;+ANALYZE d_star;+ANALYZE e_star;+ANALYZE f_star;
--
-- for internal portal (cursor) tests
--
diff --git a/src/test/regress/sql/create_misc.sql b/src/test/regress/sql/create_misc.sqlindex d4a63b7..d0b04a8 100644--- a/src/test/regress/sql/create_misc.sql+++ b/src/test/regress/sql/create_misc.sql@@ -192,6 +192,14 @@ INSERT INTO f_star (class, f)
INSERT INTO f_star (class) VALUES ('f');
+-- Analyze the X_star tables for better plan stability in later tests+ANALYZE a_star;+ANALYZE b_star;+ANALYZE c_star;+ANALYZE d_star;+ANALYZE e_star;+ANALYZE f_star;+
--
-- for internal portal (cursor) tests
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, david.rowley@2ndquadrant.com, andres@anarazel.de
Subject: Re: Parallel Append subplan order instability on aye-aye
In-Reply-To: <24480.1569518042@sss.pgh.pa.us>
References: <CA+hUKG+0CxrKRWRMf5ymN3gm+BECHna2B-q1w8onKBep4HasUw@mail.gmail.com> <2863.1558327585@sss.pgh.pa.us> <CA+hUKGL1jZaZuUAtBhx0Bh6-qcOi5YwT9dZh8eZWmNmPauJvjA@mail.gmail.com> <CAKJS1f-KovGF5-j8xMdMufrF-i=dJqmS=nh0Y3=pBtvLnAN6hw@mail.gmail.com> <3341.1558449552@sss.pgh.pa.us> <CA+hUKGJLgTy36PLGcMJWFqaYwyHWugtmYjaZD179z_FcxHp9cQ@mail.gmail.com> <1588.1558500275@sss.pgh.pa.us> <1554.1563236463@sss.pgh.pa.us> <CA+hUKGLc1b_uknzYWJbgZnPnip3x-KJmP-M7gVn7Q6=-8cXgRg@mail.gmail.com> <CA+hUKGKUBmYOrZFkvYHiyrfCW5WsVTRwCaS8mTaiY-Dyk1tCkw@mail.gmail.com> <11424.1565563296@sss.pgh.pa.us> <24480.1569518042@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox