From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't shut down Gather[Merge] early under Limit.
Date: Tue, 26 Nov 2019 04:25:48 +0000
Message-ID: <E1iZSQ8-0008K4-MV@gemulon.postgresql.org> (raw)
Don't shut down Gather[Merge] early under Limit.
Revert part of commit 19df1702f5.
Early shutdown was added by that commit so that we could collect
statistics from workers, but unfortunately, it interacted badly with
rescans. The problem is that we ended up destroying the parallel context
which is required for rescans. This leads to rescans of a Limit node over
a Gather node to produce unpredictable results as it tries to access
destroyed parallel context. By reverting the early shutdown code, we
might lose statistics in some cases of Limit over Gather [Merge], but that
will require further study to fix.
Reported-by: Jerry Sievers
Diagnosed-by: Thomas Munro
Author: Amit Kapila, testcase by Vignesh C
Backpatch-through: 9.6
Discussion: https://postgr.es/m/87ims2amh6.fsf@jsievers.enova.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/080313f8296fb0bcc74bd70fc8e15cd64f45945e
Modified Files
--------------
src/backend/executor/nodeLimit.c | 14 ++++-----
src/test/regress/expected/select_parallel.out | 41 ++++++++++++++++++++++++++-
src/test/regress/sql/select_parallel.sql | 22 +++++++++++++-
3 files changed, 67 insertions(+), 10 deletions(-)
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-committers@postgresql.org
Cc: akapila@postgresql.org
Subject: Re: pgsql: Don't shut down Gather[Merge] early under Limit.
In-Reply-To: <E1iZSQ8-0008K4-MV@gemulon.postgresql.org>
References: <E1iZSQ8-0008K4-MV@gemulon.postgresql.org>
* 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