es_query_dsa is broken - Mailing list pgsql-hackers

From Thomas Munro
Subject es_query_dsa is broken
Date
Msg-id CAEepm=1U6as=brnVvMNixEV2tpi8NuyQoTmO8Qef0-VV+=7MDA@mail.gmail.com
Whole thread Raw
Responses Re: es_query_dsa is broken  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi hackers,

While reviewing commit c6755e23 I realised that es_query_dsa is
broken.  It might have made some kind of sense as a name and a concept
in an earlier version of the proposal to add a DSA area for parallel
query's use, when the DSA area was going to be independent of parallel
query DSM segments and could have been used for the whole query.  But
as it stands, each Gather [Merge] node has its own DSA area in its own
DSM segment, and that needs to be the one available to the nodes of
the child plan when executed in the leader process and it needs to be
not available to any other nodes in the tree.  It's OK for the workers
to have just one es_query_dsa set up at the beginning and used for the
whole lifetime of the executor, but it's not OK for the leader to
install it and forget about it as it does now.

The attached draft patch (for discussion only) shows one way to fix
that: only install it for the duration of Gather[Merge]'s
ExecProcNode(child), instead of doing it in ExecInitParallelPlan().
Also for the [Re]IntializeDSM invocations.

This type of install-call-clear coding isn't ideal, but unfortunately
the area doesn't exist until the first time through ExecGather runs,
and we don't seem to have another suitable scope (ie some object
easily accessible to all children of a given Gather) to put it in
right now.

Better ideas?

-- 
Thomas Munro
http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: [HACKERS] WIP: Restricting pg_rewind to data/wal dirs
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] CUBE seems a bit confused about ORDER BY