Re: pg_ctl promote wait

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: pg_ctl promote wait
Date: 2016-02-29 01:30:40
Message-ID: 56D39F40.4060802@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/19/16 3:09 PM, Tom Lane wrote:
> I see no need for an additional mechanism. Just watch pg_control until
> you see DB_IN_PRODUCTION state there, then switch over to the same
> connection probing that "pg_ctl start -w" uses.

Here is a patch set around that idea.

The subsequent discussion mentioned that there might still be a window
between end of waiting and when read-write queries would be accepted. I
don't know how big that window would be in practice and would be
interested in some testing and feedback.

Attachment Content-Type Size
0001-pg_ctl-Add-tests-for-promote-action.patch application/x-patch 3.1 KB
0002-pg_ctl-Detect-current-standby-state-from-pg_control.patch application/x-patch 2.8 KB
0003-pg_ctl-Add-wait-option-to-promote-action.patch application/x-patch 5.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2016-02-29 01:40:06 Re: Proposal: SET ROLE hook
Previous Message Jim Nasby 2016-02-28 23:50:38 Improve error handling in pltcl