pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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-0008K8-O3@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
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d0ccfa9d6a3da0a47ee02947f54dd36f9f90972c

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(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1iZSQ8-0008K8-O3@gemulon.postgresql.org>
Permalink:  ../E1iZSQ8-0008K8-O3@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iZSQ8-0008K8-O3@gemulon.postgresql.org

 · 

reply

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-0008K8-O3@gemulon.postgresql.org>
  References: <E1iZSQ8-0008K8-O3@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