Cascading replication: should we detect/prevent cycles? - Mailing list pgsql-hackers

From Josh Berkus
Subject Cascading replication: should we detect/prevent cycles?
Date
Msg-id 50D12E8F.8000808@agliodbs.com
Whole thread Raw
Responses Re: Cascading replication: should we detect/prevent cycles?  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Cascading replication: should we detect/prevent cycles?  (Daniel Farina <daniel@heroku.com>)
List pgsql-hackers
Folks,

So as a test I tried to connect a group of 9.3 streaming replicas in a
circle (4 replicas).  This was very easy to do:

1. create r1 as replica of master
2. create r2 as replica of r1
3. create r3 as replica of r2
4. create r4 as replica of r3
5. start traffic on master
6. shut down r1
7. point r1 to r4 in recovery.conf
8. start r1

replicas are now successfully connected in this pattern:

r1 ---> r2^       ||       ||       v
r4 <--- r3

pg_stat_replication displays the correct information on each replica.

So, my question is:

1. should we detect for replication cycles?  *Can* we?
2. should we warn the user, or refuse to start up?

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Switching timeline over streaming replication
Next
From: Josh Berkus
Date:
Subject: Feature Request: pg_replication_master()