[COMMITTERS] pgsql: Separate reinitialization of shared parallel-scan state fromExe

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Separate reinitialization of shared parallel-scan state fromExe
Дата
Msg-id E1dn6dK-0000BI-6i@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Separate reinitialization of shared parallel-scan state from ExecReScan.

Previously, the parallel executor logic did reinitialization of shared
state within the ExecReScan code for parallel-aware scan nodes.  This is
problematic, because it means that the ExecReScan call has to occur
synchronously (ie, during the parent Gather node's ReScan call).  That is
swimming very much against the tide so far as the ExecReScan machinery is
concerned; the fact that it works at all today depends on a lot of fragile
assumptions, such as that no plan node between Gather and a parallel-aware
scan node is parameterized.  Another objection is that because ExecReScan
might be called in workers as well as the leader, hacky extra tests are
needed in some places to prevent unwanted shared-state resets.

Hence, let's separate this code into two functions, a ReInitializeDSM
call and the ReScan call proper.  ReInitializeDSM is called only in
the leader and is guaranteed to run before we start new workers.
ReScan is returned to its traditional function of resetting only local
state, which means that ExecReScan's usual habits of delaying or
eliminating child rescan calls are safe again.

As with the preceding commit 7df2c1f8d, it doesn't seem to be necessary
to make these changes in 9.6, which is a good thing because the FDW and
CustomScan APIs are impacted.

Discussion: https://postgr.es/m/CAA4eK1JkByysFJNh9M349u_nNjqETuEnY_y1VUc_kJiU0bxtaQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/41b0dd987d44089dc48e9c70024277e253b396b7

Modified Files
--------------
doc/src/sgml/custom-scan.sgml             |  29 +++++++--
doc/src/sgml/fdwhandler.sgml              |  43 +++++++++----
src/backend/access/heap/heapam.c          |  28 ++++-----
src/backend/executor/execParallel.c       | 101 +++++++++++++++++++++++++-----
src/backend/executor/nodeBitmapHeapscan.c |  42 ++++++++-----
src/backend/executor/nodeCustom.c         |  15 +++++
src/backend/executor/nodeForeignscan.c    |  23 ++++++-
src/backend/executor/nodeGather.c         |  29 ++++-----
src/backend/executor/nodeGatherMerge.c    |  29 ++++-----
src/backend/executor/nodeIndexonlyscan.c  |  29 +++++----
src/backend/executor/nodeIndexscan.c      |  38 +++++------
src/backend/executor/nodeSeqscan.c        |  16 +++++
src/backend/executor/nodeSort.c           |  17 +++++
src/include/access/heapam.h               |   1 +
src/include/executor/execParallel.h       |   3 +-
src/include/executor/nodeBitmapHeapscan.h |   2 +
src/include/executor/nodeCustom.h         |   2 +
src/include/executor/nodeForeignscan.h    |   2 +
src/include/executor/nodeIndexonlyscan.h  |   2 +
src/include/executor/nodeIndexscan.h      |   1 +
src/include/executor/nodeSeqscan.h        |   1 +
src/include/executor/nodeSort.h           |   1 +
src/include/foreign/fdwapi.h              |   4 ++
src/include/nodes/extensible.h            |   3 +
24 files changed, 328 insertions(+), 133 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: Restore test case froma2b70c89ca1a5fcf6181d3c777d82e7b83d2de1b.
Следующее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: Code review for nodeGatherMerge.c.