Re: [HACKERS] Pg_ctl promote -- wait for slave to be promoted fully ?

2012-08-07 Thread Robert Haas
On Tue, Aug 7, 2012 at 1:09 PM, Fujii Masao  wrote:
> On Tue, Aug 7, 2012 at 10:22 PM, Magnus Hagander  wrote:
>> Should we consider if we can make "pg_ctl -w" work for "promote" as well?
>
> +1
>
>> The main problem is, I guess, that it can't log in - so wed' need
>> something like "PQping()" that actually checked if it was master or
>> slave?
>
> Yes.

Is there a security concern with exposing this information to people
who haven't authenticated?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] Pg_ctl promote -- wait for slave to be promoted fully ?

2012-08-07 Thread Fujii Masao
On Tue, Aug 7, 2012 at 10:22 PM, Magnus Hagander  wrote:
> Should we consider if we can make "pg_ctl -w" work for "promote" as well?

+1

> The main problem is, I guess, that it can't log in - so wed' need
> something like "PQping()" that actually checked if it was master or
> slave?

Yes.

Regards,

-- 
Fujii Masao

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


[HACKERS] Pg_ctl promote -- wait for slave to be promoted fully ?

2012-08-07 Thread Magnus Hagander
Should we consider if we can make "pg_ctl -w" work for "promote" as well?

The main problem is, I guess, that it can't log in - so wed' need
something like "PQping()" that actually checked if it was master or
slave?

//Magnus


-- Forwarded message --
From: Manoj Govindassamy 
Date: Fri, Jul 20, 2012 at 9:28 PM
Subject: [GENERAL] Pg_ctl promote -- wait for slave to be promoted fully ?
To: pgsql-gene...@postgresql.org


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



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


-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

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