pgsql: Allow pg_dump to use jobs and serializable transactions together

From: Kevin Grittner <kgrittn(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow pg_dump to use jobs and serializable transactions together
Date: 2015-01-30 15:11:08
Message-ID: E1YHDDw-0007AA-Qv@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow pg_dump to use jobs and serializable transactions together.

Since 9.3, when the --jobs option was introduced, using it together
with the --serializable-deferrable option generated multiple
errors. We can get correct behavior by allowing the connection
which acquires the snapshot to use SERIALIZABLE, READ ONLY,
DEFERRABLE and pass that to the workers running the other
connections using REPEATABLE READ, READ ONLY. This is a bit of a
kluge since the SERIALIZABLE behavior is achieved by running some
of the participating connections at a different isolation level,
but it is a simple and safe change, suitable for back-patching.

This will be followed by a proposal for a more invasive fix with
some slight behavioral changes on just the master branch, based on
suggestions from Andres Freund, but the kluge will be applied to
master until something is agreed along those lines.

Back-patched to 9.3, where the --jobs option was added.

Based on report from Alexander Korotkov

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/cb0168528280fcf5ad5fc6f745603080b979511a

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-01-30 17:18:21 pgsql: Fix query-duration memory leak with GIN rescans.
Previous Message Stephen Frost 2015-01-30 03:37:27 Re: [COMMITTERS] pgsql: Fix column-privilege leak in error-message paths