Cascading replication: should we detect/prevent cycles?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Cascading replication: should we detect/prevent cycles?
Date: 2012-12-19 03:03:43
Message-ID: 50D12E8F.8000808@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2012-12-19 03:43:09 Feature Request: pg_replication_master()
Previous Message Josh Berkus 2012-12-19 02:57:01 Re: Switching timeline over streaming replication