Parallel safety of binary_upgrade_create_empty_extension
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-03-26T22:45:53Z
Lists: pgsql-hackers
Attachments
- 0001-Mark-binary_upgrade_create_empty_extension-PARALLEL-.patch (application/octet-stream) patch 0001
Hi,
My colleague Richard Yen came across this situation:
pg_restore: [archiver (db)] could not execute query: ERROR: cannot
assign XIDs during a parallel operation
Command was: -- For binary upgrade, create an empty extension and
insert objects into it
DROP EXTENSION IF EXISTS "btree_gin";
SELECT pg_catalog.binary_upgrade_create_empty_extension('btree_gin',
'public', true, '1.0', NULL, NULL, ARRAY[]::pg_catalog.text[]);
It turned out that the target cluster was running with
force_parallel_mode = on. Here's a single character patch to mark
that function PARALLEL UNSAFE. Obviously that'll affect only newly
initdb'd clusters after this patch, but that's what people have in a
pg_upgrade scenario.
This goes back to d89f06f0482 so I think it should probably be
back-patched to 9.6 and 10.
--
Thomas Munro
http://www.enterprisedb.com
Commits
-
Fix bogus provolatile/proparallel markings on a few built-in functions.
- ea83c7e66fe1 9.5.13 landed
- b7537ffb1ab5 9.4.18 landed
- 91d82317d252 9.6.9 landed
- 485857d447c9 9.3.23 landed
- 283262cd9580 10.4 landed
- 11002f8afa55 11.0 landed