Behaviour of take over the synchronous replication

From: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Behaviour of take over the synchronous replication
Date: 2013-08-23 07:42:23
Message-ID: CAD21AoDtUwVS++dNR8L8e2-F7PzfY+zxvg2Pp9eDYR=iXFeCJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I understand that setting synchronous_standby_name to '*' means that
all priority of standby server are same.
and the standby server, which connected to the master server at first,
become SYNC standby, another server become
ASYNC standby as potential server.

So, how to set the priority to standby server is different between '*'
and setting all standby names.
For example, if there are two standby servers (AAA and BBB)

(a) synchronous_standby_names = 'AAA,BBB'

application_name | sync_priority | sync_state
--------------------------+-------------------+------------
AAA | 1 | sync
BBB | 2 | potential

(b) synchronous_standby_names = '*'

application_name | sync_priority | sync_state
--------------------------+-------------------+------------
AAA | 1 | sync
BBB | 1 | potential

If the AAA server is failed, BBB server take over SYNC replication.
After take over, when AAA server starts, AAA server re-take over SYNC
replication from BBB server in both case (a) and case(b).
That is, AAA server starts as SYNC server again.

in case (a), those priority is clear. So I think that re-taking over
is correct behaviour.
OHOT, in case (b), even if AAA and BBB are set same priority, AAA
server steals SYNC replication.
I think it is better that BBB server continue behaviour SYNC standby,
and AAA should become potential server.

What am I missing?
Please give me feedback.

Regards,

-------
Sawada Masahiko

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2013-08-23 08:14:43 Re: several questions about pg_dumpall, pg_start_backup, pg_basebackup and WAL
Previous Message Fabien COELHO 2013-08-23 07:10:15 Re: pg_system_identifier()