pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Jerry Sievers <gsievers19@comcast.net>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: SegFault on 9.6.14
Date: Tue, 13 Aug 2019 11:58:52 -0400
Message-ID: <4832.1565711932@sss.pgh.pa.us> (raw)
In-Reply-To: <CAA4eK1+NSijDZA3gBd+-y5CcM7hdvtRHPCrbXFPp1idPVMKBXQ@mail.gmail.com>
References: <CA+hUKGK=dChcQtgf1-r73XEqDhW1VD32Tf9qDi39aYbjuE3mGA@mail.gmail.com>
<20190812190749.GA13961@alvherre.pgsql>
<CA+TgmoZHcMqmwtnfW6X3gyJW84S5LxERVmNPobXtmrQkJh+x4A@mail.gmail.com>
<14905.1565646513@sss.pgh.pa.us>
<CAA4eK1+NSijDZA3gBd+-y5CcM7hdvtRHPCrbXFPp1idPVMKBXQ@mail.gmail.com>
Amit Kapila <amit.kapila16@gmail.com> writes:
> On Tue, Aug 13, 2019 at 3:18 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> To clarify my position --- I think it's definitely possible to improve
>> the situation a great deal. We "just" have to pass down more information
>> about whether rescans are possible.
> Right, you have speculated above that it is possible via adding some
> eflag bits. Can you please describe a bit more about that idea, so
> that somebody else can try to write a patch?
Well, there are two components to solving this problem:
1. What are we going to do about the executor's external API?
Right now, callers of ExecutorStart don't have to say whether they
might call ExecutorRewind. We need some way for callers to make a
binding promise that they won't do any such thing. Perhaps we just
want to invent another flag that's like EXEC_FLAG_BACKWARD, but it's
not clear how it should interact with the existing "soft" REWIND
flag. Nor do I know how far up the call stack will we have to make
changes to make it possible to promise as much as we can -- for
instance, will we have to adapt the SPI interfaces?
2. What happens inside ExecutorStart in response to such promises?
I imagine that we translate them into additional eflags bits that
get passed down to node init functions, possibly with modification
(e.g., nodeNestloop.c would have to revoke the no-rescans promise
to its inner input). You'd need to work out what is the most
convenient set of conventions (positive or negative sense of the
flag bits, etc), and go through all the non-leaf node types to
determine what they can pass down.
(BTW, unless I'm missing something, there's not currently any
enforcement of EXEC_FLAG_BACKWARD, ie a caller can fail to pass
that and then try to back up anyway. We probably want to improve
that situation, and also enforce this new flag about
ExecutorRewind.)
The reason I'm dubious about back-patching this is that each
of these things seems likely to affect external code. Point 1
could affect external callers of the executor, and point 2 is
likely to have consequences for FDWs and custom-scan providers.
Maybe we can set things up so that everything defaults in a
safe direction for unchanged code, but I don't want to contort
the design just to do that.
regards, tom lane
view thread (55+ messages) latest in thread
Message-ID: <4832.1565711932@sss.pgh.pa.us>
Permalink: ../4832.1565711932@sss.pgh.pa.us/
Also on: postgresql.org/message-id/4832.1565711932@sss.pgh.pa.us
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, amit.kapila16@gmail.com, robertmhaas@gmail.com, alvherre@2ndquadrant.com, thomas.munro@gmail.com, vignesh21@gmail.com, gsievers19@comcast.net, tomas.vondra@2ndquadrant.com
Subject: Re: SegFault on 9.6.14
In-Reply-To: <4832.1565711932@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