On Thu, Oct 25, 2012 at 03:38:47AM -0700, Takatoshi MATSUO wrote:
> Usually,  we use "crm_master" command instead of "crm_attribute" to change 
> master score in RA.
> But PostgreSQL's slave can't get own replication status, so Master changes 
> Slave's master-score 
> using instance number on Pacemaker 1.0.x .
> This probably is not ordinary usage.
> 
> > Would the existing resource agent work with globally-unique=true ?
> 
> I don't know it works with true.
> I use it with false and it dosen't need true.

I suggested that you actually should use globally-unique clones,
as in that case you still get those instance numbers...

But thinking about it once more, I'm not so sure anymore.

Correct me where I'm wrong.

This is about the master score.
In case the Master instance fails, we preferably want to promote the
slave instance that is as close as possible to the Master.
We only know which *node* was "best" at the last monitoring interval,
which may be "good enough".

We need to then change the master score for *all possible instances*,
for all nodes, accordingly.

Which is what that loop did.
(I think skipping the "current" instance is actually a bug;
 If pacemaker relabeles things in a "bad way", you may hit it).

Now, with pacemaker 1.1.8, all instances become "equal"
(for anonymous clones, aka globally-unique=false),
and we only need to set the score on the resource-id,
not for all resource-id:instance combinations.

Which is great. After all, the master score in this case is attached to
the node (or, the data set accessible from that node), and not to the
(arbitrary, potentially relabeled "anytime") instance number pacemaker
assigned to the clone instance running on that node.


And that is exactly what your patch does:
 * detect if a version of pacemaker is in use that attaches the instance
   number to the resource id
   * if so, do the loop on all possible instance numbers as before
   * if not, only set the master score on the resource-id


Is my understanding correct?
Then I think you patch is good.

Still, other resource agents that use master scores (or any other
attributes that reference instance numbers of anonymous clones)
need to be reviewed.

Though this "I'll set scores for other instances, not only myself"
logic is unique to pgsql, so most other resource agents should "just
work" with whatever is present in the environment, they typically treat
the $OCF_RESOURCE_INSTANCE as opaque.

Thanks,
        Lars

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to