Re: [HACKERS] Issue with logical replication: MyPgXact->xmin alreadyis valid - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: [HACKERS] Issue with logical replication: MyPgXact->xmin alreadyis valid
Date
Msg-id 91a97dc3-1981-7d0b-f1f5-8a767e516bff@2ndquadrant.com
Whole thread Raw
In response to [HACKERS] Issue with logical replication: MyPgXact->xmin already is valid  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Responses Re: [HACKERS] Issue with logical replication: MyPgXact->xmin alreadyis valid
List pgsql-hackers
On 06/10/17 12:16, Konstantin Knizhnik wrote:
> When creating logical replication slots we quite often get the following
> error:
> 
> ERROR:  cannot build an initial slot snapshot when MyPgXact->xmin
> already is valid
> 
> which cause restart of WAL sender.
> The comment to this line doesn't clarify much:
> 
>     /* so we don't overwrite the existing value */
>     if (TransactionIdIsValid(MyPgXact->xmin))
>         elog(ERROR, "cannot build an initial slot snapshot when
> MyPgXact->xmin already is valid");
>>
> I wonder if it is normal situation or something goes wrong?
> 

Hi,

no it's not normal situation, it seems you are doing something that
assigns xid before you run the CREATE_REPLICATION_SLOT command on that
connection.

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services


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

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: [HACKERS] On markers of changed data
Next
From: Alexander Kuzmenkov
Date:
Subject: Re: [HACKERS] Proposal: Improve bitmap costing for lossy pages