Timeout Transactions on Synchronous Replication Standby Failures

From: Yunong Xiao <yjxiao(at)gmail(dot)com>
To: pgsql-general List <pgsql-general(at)postgresql(dot)org>
Subject: Timeout Transactions on Synchronous Replication Standby Failures
Date: 2012-03-09 18:09:33
Message-ID: B706A55A-E13C-421F-9F21-09B13254DFE5@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a vanilla HA synchronous replication setup, consisting of 1 primary and 1 synchronous standby. When a standby fails, it looks like transactions still get written to the primary, and there's no messaging back to the client to indicate standby failure. Rather the primary just never ends the connection to the client, leaving the client hanging.

Ideally, I'd like the ability to add a timeout to the primary such that it will rollback the transaction if it's unable to commit to the standby, and include a mechanism to message this failure to the client. Otherwise, the client has no guarantees that the data written will be durably persisted on two boxes and is essentially left in the dark on whether the transaction committed on a standby failure.

I've looked through literature in the Postgres docs and looked around in the Postgres source, and it looks as if this is not currently supported. Are there plans to support something like this in future versions? Something like a sync_replication_timeout parameter I can set on the master such that the master will time out on the client and rollback the transaction in the face of standby failures.

-Yunong

Browse pgsql-general by date

  From Date Subject
Next Message Randy Ficker 2012-03-09 18:26:08 Re: 9.1 causing "out of shared memory" error and higher serialization conflicts
Previous Message Marti Raudsepp 2012-03-09 17:41:11 Re: 9.1 causing "out of shared memory" error and higher serialization conflicts