Fast Shutdown and Transactions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm implementing failover for streaming replication using HAProxy. I'm trying to implement soft failover, (or failback), that will give applications in the midst of transaction a clear indication of the state of their transaction.

My question is, if you use:

pg_ctl -D [DIR] stop -m fast

and the application has issue a commit if a transaction and the transaction has completed, will postmaster send an affirmative message before shutting down? Or will it just close the socket?

I can see that stopping fast while a transaction is open in psql will not generate a message until the next statement.

I'm concerned about the case where an application detects that the connection has been terminated and assumes that the transaction failed, so it reattempts the transaction and creates duplicates. I'd like applications to be able to assume that a dropped connection is a failed transaction.

Is there some other, better way to check to see if your transaction was successful or not? One that can be performed across a subsequent connection?

--
Alan Gutierrez - http://twitter.com/bigeasy - http://github.com/bigeasy

--
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux