On May 29, 2017 12:25:35 PM PDT, Petr Jelinek <petr.jeli...@2ndquadrant.com> 
>On 29/05/17 21:21, Petr Jelinek wrote:
>> On 29/05/17 20:59, Andres Freund wrote:
>>> On May 29, 2017 11:58:05 AM PDT, Petr Jelinek
><petr.jeli...@2ndquadrant.com> wrote:
>>>> On 27/05/17 17:17, Andres Freund wrote:
>>>>> On May 27, 2017 9:48:22 AM EDT, Petr Jelinek
>>>> <petr.jeli...@2ndquadrant.com> wrote:
>>>>>> Actually, I guess it's the pid 47457 (COPY process) who is
>>>>>> running the xid 73322726. In that case that's the same thing
>>>> Masahiko
>>>>>> Sawada reported [1]. Which basically is result of snapshot
>>>>>> waiting for transaction to finish, that's normal if there is a
>>>>>> transaction running when the snapshot is being created (and the
>>>> is
>>>>>> a long transaction).
>>>>> Hm.  I suspect the issue is that the exported snapshot needs an
>>>> for some crosscheck, and that's what we're waiting for.  Could you
>>>> check what happens if you don't assign one and just content the
>>>> checks out?   Not at my computer, just theorizing.
>>>> I don't think that's it, in my opinion it's the parallelization of
>>>> table
>>>> data copy where we create snapshot for one process but then the
>>>> one
>>>> has to wait for the first one to finish. Before we fixed the
>>>> snapshotting, the second one would just use the ondisk snapshot so
>>>> would work fine (except the snapshot was corrupted of course). I
>>>> if we could somehow give it a hint to ignore the read-only txes,
>>>> then we have no way to enforce the txes to stay read-only so it
>>>> not
>>>> seem safe.
>>> Read-only txs have no xid ...
>> That's what I mean by hinting, normally they don't but building
>> snapshot in snapshot builder calls GetTopTransactionId() (see
>> SnapBuildInitialSnapshot()) which will assign it xid.
>Looking at the code more, the xid is only used as parameter for
>SnapBuildBuildSnapshot() which never does anything with that parameter,
>I wonder if it's really needed then.

Not at a computer, but by memory that'll trigger the snapshot export routine to 
include it.  Import in turn requires the xid to check if the source is still 
alive.  But there's better ways, e.g. using the virtual xactid.

Sent from my Android device with K-9 Mail. Please excuse my brevity.

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to