Support for N synchronous standby servers

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Support for N synchronous standby servers
Date: 2014-08-09 06:03:16
Message-ID: CAB7nPqR9c84ig0ZUvhMQAMq53VQsD4rC82vYci4Dr27PVOFf9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Please find attached a patch to add support of synchronous replication
for multiple standby servers. This is controlled by the addition of a
new GUC parameter called synchronous_standby_num, that makes server
wait for transaction commit on the first N standbys defined in
synchronous_standby_names. The implementation is really
straight-forward, and has just needed a couple of modifications in
walsender.c for pg_stat_get_wal_senders and syncrep.c.

When a process commit is cancelled manually by user or when
ProcDiePending shows up, the message returned to user does not show
the list of walsenders where the commit has not been confirmed as it
partially confirmed. I have not done anything for that but let me know
if that would be useful. This would need a scan of the walsenders to
get their application_name.

Thanks,
--
Michael

Attachment Content-Type Size
0001-syncrep_multi_standbys.patch text/x-diff 13.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2014-08-09 08:20:55 Re: PostgreSQL vs oracle doing 1 million sqrts am I doing it wrong?
Previous Message David G Johnston 2014-08-09 05:18:10 Re: 9.4 pg_restore --help changes