pgsql: Don't shut down Gather[Merge] early under Limit.

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема pgsql: Don't shut down Gather[Merge] early under Limit.
Дата
Msg-id E1iZSQ8-0008KC-Ph@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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
Backpatch-through: 9.6
Discussion: https://postgr.es/m/87ims2amh6.fsf@jsievers.enova.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1ad0df67c7904ff64166d7a453c53943f069ee52

Modified Files
--------------
src/backend/executor/nodeLimit.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Use procsignal_sigusr1_handler for auxiliary processes.
Следующее
От: Michael Paquier
Дата:
Сообщение: pgsql: Add safeguards for pg_fsync() called with incorrectly-opened fds