Pg_ctl promote -- wait for slave to be promoted fully ?

From: Manoj Govindassamy <manoj(at)nimblestorage(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Pg_ctl promote -- wait for slave to be promoted fully ?
Date: 2012-07-20 19:28:33
Message-ID: 5009B161.6060602@nimblestorage.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi team,

I am using PG 9.1.2 and I am promoting a slave to master with the
following command.

pg_ctl promote -D /pat/to/data

Command does return back faster with code 0 ( = success). I assumed the
slave is now the master and issued write operations. But the statement
failed as the DB complained that it can do only read operation.
Postgres.log showed "ready to accept connection" a second later after I
issued the statement. So, my understanding is "pg_ctl promote" is
triggering a slave promote and is "asynchornous".

-- Anyway I can query the state of DB to know its status slave or master
?? So, that i can issue write statements only after I know that the DB
is the new master now

-- Or anyway to make pg_ctl promote to wait till the slave is completely
promoted ?

Any help is appreciated.

--
thanks,
Manoj

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2012-07-20 20:30:29 A Better Way? (Multi-Left Join Lookup)
Previous Message Tom Lane 2012-07-20 18:46:43 Re: big database resulting in small dump

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-07-20 19:39:33 Re: Restrict ALTER FUNCTION CALLED ON NULL INPUT (was Re: Not quite a security hole: CREATE LANGUAGE for non-superusers)
Previous Message Andrew Dunstan 2012-07-20 19:16:45 Re: isolation check takes a long time