Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Greg Nancarrow <gregn4422@gmail.com>
From: Greg Nancarrow <gregn4422@gmail.com>
To: Robert Haas <robertmhaas@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-05T02:03:04Z
Lists: pgsql-hackers
On Wed, Aug 4, 2021 at 11:43 PM Robert Haas <robertmhaas@gmail.com> wrote: > > Why do you think it's right to install the serialized *active* > snapshot as the *transaction* snapshot? I've been operating on the > presumption that we wanted the worker to install the leader's > transaction snapshot as its transaction snapshot as its transaction > snapshot and the leader's active snapshot as its active snapshot, > because in my mind the active snapshot and the transaction snapshot > are two separate things. However, there's clearly something wrong with > that line of reasoning, because apparently your proposal fixes the > problem and mine doesn't. > In setting up the snapshot for the execution state used in command execution, GetTransactionSnapshot() is called and (possibly a copy of) the returned snapshot is pushed as the ActiveSnapshot. The way I see it is that there is essentially only one snapshot here, the last-acquired TransactionSnapshot, which the ActiveSnapshot points to (or a copy of it). Rightly or wrongly, my v2/v5 patch is basically changing the code to do the same snapshot setup in each of the parallel workers. So why (current Postgres code, no patches applied) in setting up for parallel-worker execution (in InitializeParallelDSM) does the Postgres code then acquire ANOTHER TransactionSnapshot (by calling GetTransactionSnashot(), which could return CurrentSnapshot or a new snapshot) and serialize that, as well as serializing what the ActiveSnapshot points to, and then restore those in the workers as two separate snapshots? Is it a mistake? Or if intentional and correct, how so? Regards, Greg Nancarrow Fujitsu Australia
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