From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@postgresql.org
Subject: Infinite replication loop with pglogical
Date: Thu, 7 Dec 2017 14:41:31 +0100
Message-ID: <20171207134131.grhh3h6udazmavb3@hjp.at> (raw)
[I'm not sure whether this is the right list to discuss third party
extensions like 2ndQuadrant's pglogical. If there is a better place,
feel free to direct me to it]
We are testing bidirectional replication with pglogical:
Node 1:
postgresql-9.6 9.6.6-1.pgdg90+1
postgresql-9.6-pglogical 2.1.0-1.jessie+1
Node 2:
postgresql-10 10.1-1.pgdg90+1
postgresql-10-pglogical 2.1.0-1.stretch+1
(They are on different versions because we wanted to test a staggered
upgrade)
We have configured bidirectional replication on several tables. In
general that seems to work fine. When a row is inserted/updated/
deleted on one node, it is replicated to the other.
But now I seem to have triggered a replication loop:
wds=> select id, source_id, insert_ts, start_ts, update_ts, finished_ts, module_id, status_id, status_msg, pid, username from qualitygate.jobs where id = 19142008;
id | source_id | insert_ts | start_ts | update_ts | finished_ts | module_id | status_id | status_msg | pid | username
----------+-----------+----------------------------+----------+-----------+-------------+-----------+-----------+------------+-----+----------
19142008 | 9 | 2017-12-07 11:39:09.904071 | | | | 80 | 0 | | 0 | hjp
(1 row)
wds=> select id, source_id, insert_ts, start_ts, update_ts, finished_ts, module_id, status_id, status_msg, pid, username from qualitygate.jobs where id = 19142008;
id | source_id | insert_ts | start_ts | update_ts | finished_ts | module_id | status_id | status_msg | pid | username
----------+-----------+----------------------------+----------------------------+----------------------------+-------------+-----------+-----------+------------+------+----------
19142008 | 9 | 2017-12-07 11:39:09.904071 | 2017-12-07 11:39:09.914616 | 2017-12-07 11:39:09.914616 | | 80 | 0 | | 6863 | hjp
(1 row)
wds=> select id, source_id, insert_ts, start_ts, update_ts, finished_ts, module_id, status_id, status_msg, pid, username from qualitygate.jobs where id = 19142008;
id | source_id | insert_ts | start_ts | update_ts | finished_ts | module_id | status_id | status_msg | pid | username
----------+-----------+----------------------------+----------------------------+---------------------------+---------------------------+-----------+-----------+------------+-----+----------
19142008 | 9 | 2017-12-07 11:39:09.904071 | 2017-12-07 11:39:09.914616 | 2017-12-07 11:39:09.95925 | 2017-12-07 11:39:09.95925 | 80 | 0 | | -1 | hjp
(1 row)
Subsequent selects randomly return one of three states for this row
(other rows are stable). The order above is the "logical order", i.e.
the row was first inserted with the first state, then updated to the
second, and finally to the third.
I suspect that the updates are bounced between the two nodes eternally
overwriting each other and never reaching a stable state.
Has anybody seen this? If so, is there a way to reliably avoid this?
(Maybe with a different pglogical.conflict_resolution setting, but if it
was a conflict, I should see something in the logs, right?)
hp
--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp@hjp.at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/;
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: hjp-pgsql@hjp.at
Subject: Re: Infinite replication loop with pglogical
In-Reply-To: <20171207134131.grhh3h6udazmavb3@hjp.at>
References: <20171207134131.grhh3h6udazmavb3@hjp.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox