Fast Shutdown and Transactions

Поиск
Список
Период
Сортировка
От Alan Gutierrez
Тема Fast Shutdown and Transactions
Дата
Msg-id 591CB8F5-CE42-4ACF-8E43-ACE5A152DB35@prettyrobots.com
обсуждение исходный текст
Список pgsql-admin
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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Bob Lunney
Дата:
Сообщение: Parallel pg_dump on a single database
Следующее
От: Iñigo Martinez Lasala
Дата:
Сообщение: Urgent! Log full with inexistent PID processes