Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Pavel Borisov <pashkin.elfe@gmail.com>
From: Pavel Borisov <pashkin.elfe@gmail.com>
To: Greg Nancarrow <gregn4422@gmail.com>
Cc: Robert Haas <robertmhaas@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-04T09:55:30Z
Lists: pgsql-hackers
Attachments
- v7-0001-Correct-usage-of-transaction-snapshot-in-a-parall.patch (application/octet-stream) patch v7-0001
ср, 4 авг. 2021 г. в 07:41, Greg Nancarrow <gregn4422@gmail.com>: > On Wed, Aug 4, 2021 at 3:21 AM Robert Haas <robertmhaas@gmail.com> wrote: > > > >The idea I sort of had floating around in my mind is a little > >different than what Greg has implemented. I was thinking that we could > >just skip SerializeSnapshot and the corresponding shm_toc_allocate() > >if !IsolationUsesXactSnapshot(). Then on the restore side we could > >just call shm_toc_lookup() with noError = true and skip > >RestoreTransactionSnapshot/RestoreSnapshot if it returns NULL. > > I've tried to follow your description and have attached a patch to > hopefully match it, but it doesn't pass "make check-world". > Perhaps I messed something up (apologies if so), or additional changes > are needed to match what you had in mind or correct additional issues > you didn't foresee? > > t/001_pgbench_with_server.pl .. 10/? > # Failed test 'pgbench scale 1 initialization status (got 1 vs expected > 0)' > # at t/001_pgbench_with_server.pl line 108. > ... > # creating primary keys... > # pgbench: fatal: query failed: ERROR: cannot take query snapshot > during a parallel operation > # CONTEXT: parallel worker > # pgbench: query was: alter table pgbench_accounts add primary key (aid) > > Greg, thanks for the fast response! I suppose that a check for IsolationUsesXactSnapshot() is also useful in a GetTransactionSnapshot for the correct processing of a case with NULL transaction snapshot. This corrects mentioned check-world test. PFA v7 patch.
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