Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Greg Nancarrow <gregn4422@gmail.com>
Cc: Pavel Borisov <pashkin.elfe@gmail.com>,
Tomas Vondra <tomas.vondra@enterprisedb.com>, Maxim Orlov <m.orlov@postgrespro.ru>, Michael Paquier <michael@paquier.xyz>, Pengchengliu <pengchengliu@tju.edu.cn>, Andres Freund <andres@anarazel.de>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-08-11T19:37:21Z
Lists: pgsql-hackers
On Wed, Aug 11, 2021 at 8:32 AM Greg Nancarrow <gregn4422@gmail.com> wrote: > This is explained by the TransactionSnapshot being a later snapshot in > this case. > So this is why it seems to be wrong to call GetTransactionSnapshot() > in InitializeParallelDSM() and use a separate, potentially later, > snapshot than that used in the execution state for the query. Thanks for the research. I agree with your logic here, but: 1. Then why doesn't the approach I proposed fix it? 2. Consider the case where the toplevel query is something like SELECT complexfunc() FROM generate_series(1,10) g -- in a case like this, I think complexfunc() can cause snapshots to be taken internally. For example suppose we end up inside exec_eval_simple_expr, or SPI_cursor_open_internal, in either case with read_only = false. Here we're going to again call GetTransactionSnapshot() and then execute a query which may use parallelism. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Fix broken snapshot handling in parallel workers.
- 96f6ef9fe451 10.19 landed
- 198cf81e2c64 11.14 landed
- f4b77e82ebf4 12.9 landed
- bc062cb93823 13.5 landed
- 11c1239881b3 14.0 landed
- a780b2fcce6c 15.0 landed
-
Doc: move some catalogs.sgml entries to the right place.
- 713a431c781f 14.0 cited
-
Stamp 13.2.
- 3fb4c75e857a 13.2 cited
-
Create an infrastructure for parallel computation in PostgreSQL.
- 924bcf4f16d5 9.5.0 cited