Re: pg_dump with both --serializable-deferrable and -j

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump with both --serializable-deferrable and -j
Date: 2015-01-28 21:46:19
Message-ID: 1101607555.1251730.1422481579658.JavaMail.yahoo@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2015-01-28 15:32:15 +0000, Kevin Grittner wrote:
>> Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>>> ISTM that the check is just overzelous and/or needs to be moved into
>>> ImportSnapshot(). There it then could be made to check if the exporting
>>> xact was also deferrable.
>>
>> That would be great if ImportSnapshot had access to that
>> information; I don't see it, though. Having pg_dump use repeatable
>> read transactions for the processes that import the snapshot would
>> work fine, as long as they are reading a snapshot which was
>> captured by a serializable read only deferrable transaction.
>
> Then add that information? The disk format for snapshot isn't persistent
> across restarts, so we can just extend it.
>
> I really don't like adding hacks like using a lower serializability
> level than what's actually requested just because it happens to be
> easier. Even if it's just in some backend.

I see your point, and will look at that for the master branch, but
it hardly seems like something to back-patch; and the messy failure
of this combination of options on 9.3 and 9.4 seems like it
deserves a fix.

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Kevin Grittner <kgrittn(at)ymail(dot)com> writes:
>>
>> Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:
>>> Having pg_dump use repeatable read transactions for the processes
>>> that import the snapshot would work fine, as long as they are
>>> reading a snapshot which was captured by a serializable read only
>>> deferrable transaction.
>>
>> It looks like the attached patch does it (although it is only
>> lightly tested so far and only on the master branch). This seems
>> like a back-patchable bug fix (to 9.3).
>>
>> Thoughts?
>
> A comment seems essential here, because as written anybody would think
> the test for a snapshot is a bug.

Good point.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2015-01-28 22:01:47 Re: Providing catalog view to pg_hba.conf file - Patch submission
Previous Message Tom Lane 2015-01-28 21:38:07 Re: pg_dump with both --serializable-deferrable and -j