Re: SegFault on 9.6.14

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: SegFault on 9.6.14
Дата
Msg-id CA+hUKGJ6GU37i46BUp69-zxHmNnG66SQXLv9oewLLufDZtaGfw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SegFault on 9.6.14  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: SegFault on 9.6.14  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Jul 18, 2019 at 6:40 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Wed, Jul 17, 2019 at 4:10 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> > Yeah, that is a problem.  Actually, what we need here is to
> > wait-for-workers-to-finish and collect all the instrumentation
> > information.  We don't need to destroy the shared memory at this
> > stage, but we don't have a special purpose function which can just
> > allow us to collect stats.  One idea could be that we create a special
> > purpose function which sounds like a recipe of code duplication,
> > another could be that somehow pass the information through
> > ExecShutdownNode to Gather/GatherMerge that they don't destroy shared
> > memory.  Immediately, I can't think of better ideas, but it is
> > possible that there is some better way to deal with this.
>
> I am not able to come up with anything better.  Robert, Thomas, do you
> see any problem with this idea or do you have any better ideas to fix
> this issue?

Hmm, so something like a new argument "bool final" added to the
ExecXXXShutdown() functions, which receives false in this case to tell
it that there could be a rescan so keep the parallel context around.
Or alternatively a separate function with another end-of-scan type of
name that I'm having trouble inventing, which is basically the same
but a bigger patch.  If you add a new argument you might in theory
want to pass that on to the ShutdownForeignScan and ShutdownCustomScan
callbacks, but we obviously can't change those APIs in the back
branches.  If you add a new function instead you might theoretically
want to add it to those APIs too, which you also can't really do in
the back branches either (well even if you could, existing extensions
won't register anything).  I think the new argument version is
probably better because I suspect only Gather would really ever have
any reason to treat the two cases differently, and all existing cases
in or out of core would just keep doing what they're doing.  So I
think adding "bool final" (or better name) would probably work out OK,
and I don't have a better idea.

--
Thomas Munro
https://enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Жарков Роман
Дата:
Сообщение: Re: Intermittent pg_ctl failures on Windows
Следующее
От: Paul Guo
Дата:
Сообщение: Re: Possible race condition in pg_mkdir_p()?