Parallel safety of binary_upgrade_create_empty_extension - Mailing list pgsql-hackers

From Thomas Munro
Subject Parallel safety of binary_upgrade_create_empty_extension
Date
Msg-id CAEepm=2sNDScSLTfyMYu32Q=ob98ZGW-vM_2oLxinzSABGQ6VA@mail.gmail.com
Whole thread Raw
Responses Re: Parallel safety of binary_upgrade_create_empty_extension  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Parallel safety of binary_upgrade_create_empty_extension  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Proposal: http2 wire format
Next
From: Tom Lane
Date:
Subject: Re: Parallel safety of binary_upgrade_create_empty_extension