pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix EvalPlanQual rechecking during MERGE.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix EvalPlanQual rechecking during MERGE.
@ 2023-09-30 09:57  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Dean Rasheed @ 2023-09-30 09:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix EvalPlanQual rechecking during MERGE.

Under some circumstances, concurrent MERGE operations could lead to
inconsistent results, that varied according the plan chosen. This was
caused by a lack of rowmarks on the source relation, which meant that
EvalPlanQual rechecking was not guaranteed to return the same source
tuples when re-running the join query.

Fix by ensuring that preprocess_rowmarks() sets up PlanRowMarks for
all non-target relations used in MERGE, in the same way that it does
for UPDATE and DELETE.

Per bug #18103. Back-patch to v15, where MERGE was introduced.

Dean Rasheed, reviewed by Richard Guo.

Discussion: https://postgr.es/m/18103-c4386baab8e355e3%40postgresql.org

Branch
------
master

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

Modified Files
--------------
src/backend/executor/README                |  12 +--
src/backend/executor/nodeModifyTable.c     |   6 +-
src/backend/optimizer/plan/planner.c       |   5 +-
src/include/nodes/execnodes.h              |   4 +-
src/include/nodes/plannodes.h              |   4 +-
src/test/isolation/expected/merge-join.out | 148 +++++++++++++++++++++++++++++
src/test/isolation/isolation_schedule      |   1 +
src/test/isolation/specs/merge-join.spec   |  45 +++++++++
src/test/regress/expected/merge.out        |   8 +-
src/test/regress/expected/with.out         |  42 ++++----
10 files changed, 237 insertions(+), 38 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix EvalPlanQual rechecking during MERGE.
@ 2023-09-30 09:57  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Dean Rasheed @ 2023-09-30 09:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix EvalPlanQual rechecking during MERGE.

Under some circumstances, concurrent MERGE operations could lead to
inconsistent results, that varied according the plan chosen. This was
caused by a lack of rowmarks on the source relation, which meant that
EvalPlanQual rechecking was not guaranteed to return the same source
tuples when re-running the join query.

Fix by ensuring that preprocess_rowmarks() sets up PlanRowMarks for
all non-target relations used in MERGE, in the same way that it does
for UPDATE and DELETE.

Per bug #18103. Back-patch to v15, where MERGE was introduced.

Dean Rasheed, reviewed by Richard Guo.

Discussion: https://postgr.es/m/18103-c4386baab8e355e3%40postgresql.org

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6d2de076cbf078cd1d6d0df2136fe5b1da96d1fe

Modified Files
--------------
src/backend/executor/README                |  12 +--
src/backend/executor/nodeModifyTable.c     |   6 +-
src/backend/optimizer/plan/planner.c       |   5 +-
src/include/nodes/execnodes.h              |   4 +-
src/include/nodes/plannodes.h              |   4 +-
src/test/isolation/expected/merge-join.out | 148 +++++++++++++++++++++++++++++
src/test/isolation/isolation_schedule      |   1 +
src/test/isolation/specs/merge-join.spec   |  45 +++++++++
src/test/regress/expected/merge.out        |   8 +-
src/test/regress/expected/with.out         |  42 ++++----
10 files changed, 237 insertions(+), 38 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix EvalPlanQual rechecking during MERGE.
@ 2023-09-30 09:57  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Dean Rasheed @ 2023-09-30 09:57 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix EvalPlanQual rechecking during MERGE.

Under some circumstances, concurrent MERGE operations could lead to
inconsistent results, that varied according the plan chosen. This was
caused by a lack of rowmarks on the source relation, which meant that
EvalPlanQual rechecking was not guaranteed to return the same source
tuples when re-running the join query.

Fix by ensuring that preprocess_rowmarks() sets up PlanRowMarks for
all non-target relations used in MERGE, in the same way that it does
for UPDATE and DELETE.

Per bug #18103. Back-patch to v15, where MERGE was introduced.

Dean Rasheed, reviewed by Richard Guo.

Discussion: https://postgr.es/m/18103-c4386baab8e355e3%40postgresql.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3c1a1af91d9504e4ce0319f48e83f7c2d5765969

Modified Files
--------------
src/backend/executor/README                |  12 +--
src/backend/executor/nodeModifyTable.c     |   6 +-
src/backend/optimizer/plan/planner.c       |   5 +-
src/include/nodes/execnodes.h              |   4 +-
src/include/nodes/plannodes.h              |   4 +-
src/test/isolation/expected/merge-join.out | 148 +++++++++++++++++++++++++++++
src/test/isolation/isolation_schedule      |   1 +
src/test/isolation/specs/merge-join.spec   |  45 +++++++++
src/test/regress/expected/merge.out        |   8 +-
src/test/regress/expected/with.out         |  42 ++++----
10 files changed, 237 insertions(+), 38 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-09-30 09:57 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-30 09:57 pgsql: Fix EvalPlanQual rechecking during MERGE. Dean Rasheed <dean.a.rasheed@gmail.com>
2023-09-30 09:57 pgsql: Fix EvalPlanQual rechecking during MERGE. Dean Rasheed <dean.a.rasheed@gmail.com>
2023-09-30 09:57 pgsql: Fix EvalPlanQual rechecking during MERGE. Dean Rasheed <dean.a.rasheed@gmail.com>

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