[Pgpool-hackers] patch to add node_id column in pool_nodes "view"

Guillaume Lelarge guillaume at lelarge.info
Wed Nov 17 22:17:14 UTC 2010


Le 17/11/2010 22:59, Jean-Paul Argudo a écrit :
> Hi!
> 
> Thanks Guillaume for such a quick feedback :)
> 
> Guillaume Lelarge a écrit :
>>> I assumed the "i" index in the loop could be used to find from node 0 to
>>> nodecount... Hope this is always true ?
>>>
>>
>> Yes, you're right.
> 
> Cool :) I read quite all the code to find the info... And I assumed that.
> 

I tried the patch on my laptop and it works fine.

> Next step is to add a new column about Read/Write or Read Only status of
> the node.
> 
> In Master/Slave mode it could be usefull to know who's the "master" (in
> case of a failback(.sh) it will be old_node+1 so, at the first failover
> it will be 0+1=1, the next will be 1+1=2, etc..
> 
> I *know* pgpool-II does only *assume* (am I right?) who's the master,
> but doesn't *yet* know for sure the master is in R/W ... because its all
> about the good execution of failback.sh (exit 0). If failback.sh
> succeeds, then pgpool-II *assumes* the n+1 is the new master...
> 
> (am I still right?)
> 
> So for the moment the column "Read-Write status" will only be based on
> what pgpool-II *assumes* to be... I think next step then is to be sure
> that the master is in R/W :)
> 
> This completes the reflexion on the thread on pgpool-general whose
> subject is " Suggestion for Failover on Master/Slave Streaming
> Replication"...
> 
> Now, digging back into pgpool-II code ;)
> 

AFAICT, the only way to make sure which one is the master is to call
pg_is_in_recovery() PostgreSQL function on each living node. The first
one to say no is the master.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com


More information about the Pgpool-hackers mailing list