Parallel safety of binary_upgrade_create_empty_extension

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Parallel safety of binary_upgrade_create_empty_extension
Date: 2018-03-26 22:45:53
Message-ID: CAEepm=2sNDScSLTfyMYu32Q=ob98ZGW-vM_2oLxinzSABGQ6VA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-Mark-binary_upgrade_create_empty_extension-PARALLEL-.patch application/octet-stream 1.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-03-26 22:53:32 Re: Parallel safety of binary_upgrade_create_empty_extension
Previous Message David G. Johnston 2018-03-26 22:33:32 Re: Proposal: http2 wire format