All,

I'm trying to work on a OCF resource agent that uses postgresql streaming 
replication.  I'm running into a few issues that I hope might be answered or at 
least some pointers given to steer me in the right direction.

1.  A quick way of obtaining a list of "Online" nodes in the cluster that a 
resource will be able to migrate to.  I've accomplished it with some grep and 
see but its not pretty or fast.

# time pcs status | grep Online | sed -e "s/.*\[\(.*\)\]/\1/" | sed 's/ //'
p1.example.net p2.example.net

real    0m2.797s
user    0m0.084s
sys     0m0.024s

Once I get a list of active/online nodes in the cluster my thinking was to use 
PSQL to get the current xlog location and lag or each of the remaining nodes 
and compare them.  If the node has a greater log position and/or less lag it 
will be given a greater master preference.  

2.  How to force a monitor/probe before a promote is run on ALL nodes to make 
sure that the master preference is up to date before migrating/failing over the 
resource.
        - I was thinking that maybe during the promote call it could get the 
log location and lag from each of the nodes via an psql call ( like above) and 
then force the resource to a specific node.  Is there a way to do this and does 
it sound like a sane idea ?


The start of my RA is located here suggestions and comments 100% welcome 
https://github.com/smbambling/pgsqlsr/blob/master/pgsqlsr

v/r

STEVE

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org

Reply via email to