[pgpool-general: 285] Re: Feature Request … Master/Slave Mode Addition

Tatsuo Ishii ishii at postgresql.org
Fri Mar 23 11:50:10 JST 2012


>> First of all, it's pretty difficult to recognize which one is the
>> master. As far as I know, there's no reliable way to detect which one
>> is the master. If you know how to do it, please let me know. We do it
>> in hard way when failover starts but we don't want to it regulary
>> because it's so hard:-)
> 
> How do you guys check the replication delay?

Calls pg_current_xlog_location() against primary. Calls SELECT
pg_last_xlog_replay_location() against standbys. Then calculate
difference between the returned values from those functions.

>> As explained many times the reason why we don't it automatically is,
>> we cannot trust the downed server. It may be right after initdb'ed or
>> it may have completely outdated contents. Who knows.
> 
> When you know the server has been shut down administratively (shutdown command), you 
> ought to be able to pretty safely say that it wasnt corrupted. It could at least be an option. 
>
> In the event of a server crash or abrupt disconnect, you could then not automatically re-add
> the server (config option?). However, if the server comes up and is replicating again OK, cant you
> make a reasonable assumption that its OK?

Not sure. Someone could modify the database after restarting the
database.

Also the database just coming back from crash could fail again due to
hardware problem or so. In this case the system will repeat failover
and it lead to a catastrophe which we really want to avoid.

>> BTW, you could issue pcp_attach_node command from your PostgreSQL
>> starting script if you are sure the downed server's database is fine.
> 
> Yeah, its something I'm considering.. Though really I'd rather have the server validate
> that replication is running, and reasonably up-to-date and do it itself. 
> 
>> 
>>> This model also allows us to run two PGPool servers in parallel.. we
>>> can run one as a primary (that maybe has the failover commands all
>>> configured) and a second one as a backup with no failover commands
>>> configured... just there to accept connections if the first one goes
>>> offline!
>> --
>> Tatsuo Ishii
>> SRA OSS, Inc. Japan
>> English: http://www.sraoss.co.jp/index_en.php
>> Japanese: http://www.sraoss.co.jp
> 


More information about the pgpool-general mailing list