<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto">
<div>Thanks for your reply Andrei. Whilst I understand what you say about the difficulties of diagnosing issues without all of the info, it's a compromise between a mailing list posting being very verbose in which case nobody wants to read it, and containing
enough relevant information for someone to be able to help. With 20+ resources involved during a failover there are literally thousands of logs generated, and it would be pointless to post them all.</div>
<div dir="auto"><br>
</div>
<div dir="auto">I've tried to focus in on the king resource only to keep things simple, as that is the only resource that can initiate a failover. I provided the real master scores and transition decisions made by pacemaker at the times that I killed the king
master resource by showing the crm_simulator output from both tests, and the CIB config is ss described. As I mentioned, migration-threshold is set to zero for all resources, so it shouldn't prevent a second failover. </div>
<div dir="auto"><br>
</div>
<div dir="auto">Regarding the resource agent return codes, the failure is detected by the 10s king resource master instance monitor operation, which returns OCF_ERR_GENERIC because the resource is expected to be running and isn't (the OCF resource agent developers
guide states that monitor should only return OCF_NOT_RUNNING if there is no error condition that caused the resource to stop).</div>
<div dir="auto"><br>
</div>
<div dir="auto">What would be really helpful would be if you or someone else could help me decipher the crm_simulate output:</div>
<div dir="auto"><br>
</div>
<div dir="auto">1. What is the difference between clone_color and native_color? </div>
<div dir="auto">2. What is the difference between "promotion scores" and "allocation scores" and why does the output show several instances of each? </div>
<div dir="auto">3. How does pacemaker use those scores to decide whether to failover?</div>
<div dir="auto">4. Why is there a -INFINITY score on one node? </div>
<div dir="auto"><br>
</div>
<div dir="auto">Thanks again for your help. </div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
<div class="gmail_extra" dir="auto"><br>
<div class="gmail_quote">On 28 Jun 2019 6:46 pm, Andrei Borzenkov <arvidjaar@gmail.com> wrote:<br type="attribution">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font size="2"><span style="font-size:10pt">
<div>On Fri, Jun 28, 2019 at 7:24 AM Harvey Shepherd<br>
<Harvey.Shepherd@aviatnet.com> wrote:<br>
><br>
> Hi All,<br>
><br>
><br>
> I'm running Pacemaker 2.0.2 on a two node cluster. It runs one master/slave resource (I'll refer to it as the king resource) and about 20 other resources which are a mixture of:<br>
><br>
><br>
> - resources that only run on the king resource master node (colocation constraint with a score of INFINITY)<br>
><br>
> - clone resources that run on both nodes<br>
><br>
> - two other master/slave resources where the masters runs on the same node as the king resource master (colocation constraint with a score of INFINITY)<br>
><br>
><br>
> I'll refer to the above set of resources as servant resources.<br>
><br>
><br>
> All servant resources have a resource-stickiness of zero and the king resource has a resource-stickiness of 100. There is an ordering constraint that the king resource must start before all servant resources. The king resource is controlled by an OCF script
that uses crm_master to set the preferred master for the king resource (current master has value 100, current slave is 5, unassigned role or resource failure is 1) - I've verified that these values are being set as expected upon promotion/demotion/failure
etc, via the logs. That's pretty much all of the configuration - there is no configuration around node preferences and migration-threshold is zero for everything.<br>
><br>
><br>
> What I'm trying to achieve is fairly simple:<br>
><br>
><br>
> 1. If any servant resource fails on either node, it is simply restarted. These resources should never failover onto the other node because of colocation with the king resource, and they should not contribute in any way to deciding whether the king resource
should failover (which is why they have a resource-stickiness of zero).<br>
><br>
> 2. If the slave instance of the king resource fails, it should simply be restarted and again no failover should occur.<br>
><br>
> 3. If the master instance of the king resource fails, then its slave instance should immediately be promoted, and the failed instance should be restarted. Failover of all servant resources should then occur due to the colocation dependency.<br>
><br>
><br>
> It's number 3 above that I'm having trouble with. If I kill the master king resource instance it behaves as I expect - everything fails over and the king resource is restarted on the new slave. If I then kill the master instance of the king resource again
however, instead of failing back over to its original node, it restarts and promotes back to master on the same node. This is not what I want.<br>
><br>
<br>
migration-threshold is the first thing that comes in mind. Another<br>
possibility is hard error returned by resource agent that forces<br>
resource off node.<br>
<br>
But please realize that without actual configuration and logs at the<br>
time undesired behavior happens it just becomes game of riddles.<br>
<br>
><br>
> The relevant output from crm_simulate for the two tests is shown below. Can anyone suggest what might be going wrong? Whilst I really like the concept of crm_simulate, I can't find a good description of how to interpret the output and I don't understand the
difference between clone_color and native_color, or the difference between "promotion scores" and the various instances of "allocation scores", nor does it really tell me what is contributing to the scores. Where does the -INFINITY allocation score come from
for example?<br>
><br>
><br>
> Thanks,<br>
><br>
> Harvey<br>
><br>
><br>
><br>
> FIRST KING RESOURCE MASTER FAILURE (CORRECT BEHAVIOUR - MASTER NODE FAILOVER OCCURS)<br>
><br>
><br>
> Clone Set: ms_king_resource [king_resource] (promotable)<br>
> king_resource (ocf::aviat:king-resource-ocf): FAILED Master secondary<br>
> clone_color: ms_king_resource allocation score on primary: 0<br>
> clone_color: ms_king_resource allocation score on secondary: 0<br>
> clone_color: king_resource:0 allocation score on primary: 0<br>
> clone_color: king_resource:0 allocation score on secondary: 101<br>
> clone_color: king_resource:1 allocation score on primary: 200<br>
> clone_color: king_resource:1 allocation score on secondary: 0<br>
> native_color: king_resource:1 allocation score on primary: 200<br>
> native_color: king_resource:1 allocation score on secondary: 0<br>
> native_color: king_resource:0 allocation score on primary: -INFINITY<br>
> native_color: king_resource:0 allocation score on secondary: 101<br>
> king_resource:1 promotion score on primary: 100<br>
> king_resource:0 promotion score on secondary: 1<br>
> * Recover king_resource:0 ( Master -> Slave secondary )<br>
> * Promote king_resource:1 ( Slave -> Master primary )<br>
> * Resource action: king_resource cancel=10000 on secondary<br>
> * Resource action: king_resource cancel=11000 on primary<br>
> * Pseudo action: ms_king_resource_pre_notify_demote_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-pre_notify_demote_0<br>
> * Pseudo action: ms_king_resource_demote_0<br>
> * Resource action: king_resource demote on secondary<br>
> * Pseudo action: ms_king_resource_demoted_0<br>
> * Pseudo action: ms_king_resource_post_notify_demoted_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-post_notify_demoted_0<br>
> * Pseudo action: ms_king_resource_pre_notify_stop_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-pre_notify_stop_0<br>
> * Pseudo action: ms_king_resource_stop_0<br>
> * Resource action: king_resource stop on secondary<br>
> * Pseudo action: ms_king_resource_stopped_0<br>
> * Pseudo action: ms_king_resource_post_notify_stopped_0<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-post_notify_stopped_0<br>
> * Pseudo action: ms_king_resource_pre_notify_start_0<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-pre_notify_start_0<br>
> * Pseudo action: ms_king_resource_start_0<br>
> * Resource action: king_resource start on secondary<br>
> * Pseudo action: ms_king_resource_running_0<br>
> * Pseudo action: ms_king_resource_post_notify_running_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-post_notify_running_0<br>
> * Pseudo action: ms_king_resource_pre_notify_promote_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-pre_notify_promote_0<br>
> * Pseudo action: ms_king_resource_promote_0<br>
> * Resource action: king_resource promote on primary<br>
> * Pseudo action: ms_king_resource_promoted_0<br>
> * Pseudo action: ms_king_resource_post_notify_promoted_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-post_notify_promoted_0<br>
> * Resource action: king_resource monitor=11000 on secondary<br>
> * Resource action: king_resource monitor=10000 on primary<br>
> Clone Set: ms_king_resource [king_resource] (promotable)<br>
><br>
><br>
> SECOND KING RESOURCE MASTER FAILURE (INCORRECT BEHAVIOUR - SAME NODE IS PROMOTED TO MASTER)<br>
><br>
><br>
> Clone Set: ms_king_resource [king_resource] (promotable)<br>
> king_resource (ocf::aviat:king-resource-ocf): FAILED Master primary<br>
> clone_color: ms_king_resource allocation score on primary: 0<br>
> clone_color: ms_king_resource allocation score on secondary: 0<br>
> clone_color: king_resource:0 allocation score on primary: 0<br>
> clone_color: king_resource:0 allocation score on secondary: 200<br>
> clone_color: king_resource:1 allocation score on primary: 101<br>
> clone_color: king_resource:1 allocation score on secondary: 0<br>
> native_color: king_resource:0 allocation score on primary: 0<br>
> native_color: king_resource:0 allocation score on secondary: 200<br>
> native_color: king_resource:1 allocation score on primary: 101<br>
> native_color: king_resource:1 allocation score on secondary: -INFINITY<br>
> king_resource:1 promotion score on primary: 1<br>
> king_resource:0 promotion score on secondary: 1<br>
> * Recover king_resource:1 ( Master primary )<br>
> * Pseudo action: ms_king_resource_pre_notify_demote_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-pre_notify_demote_0<br>
> * Pseudo action: ms_king_resource_demote_0<br>
> * Resource action: king_resource demote on primary<br>
> * Pseudo action: ms_king_resource_demoted_0<br>
> * Pseudo action: ms_king_resource_post_notify_demoted_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-post_notify_demoted_0<br>
> * Pseudo action: ms_king_resource_pre_notify_stop_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-pre_notify_stop_0<br>
> * Pseudo action: ms_king_resource_stop_0<br>
> * Resource action: king_resource stop on primary<br>
> * Pseudo action: ms_king_resource_stopped_0<br>
> * Pseudo action: ms_king_resource_post_notify_stopped_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Pseudo action: ms_king_resource_confirmed-post_notify_stopped_0<br>
> * Pseudo action: ms_king_resource_pre_notify_start_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Pseudo action: ms_king_resource_confirmed-pre_notify_start_0<br>
> * Pseudo action: ms_king_resource_start_0<br>
> * Resource action: king_resource start on primary<br>
> * Pseudo action: ms_king_resource_running_0<br>
> * Pseudo action: ms_king_resource_post_notify_running_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-post_notify_running_0<br>
> * Pseudo action: ms_king_resource_pre_notify_promote_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-pre_notify_promote_0<br>
> * Pseudo action: ms_king_resource_promote_0<br>
> * Resource action: king_resource promote on primary<br>
> * Pseudo action: ms_king_resource_promoted_0<br>
> * Pseudo action: ms_king_resource_post_notify_promoted_0<br>
> * Resource action: king_resource notify on secondary<br>
> * Resource action: king_resource notify on primary<br>
> * Pseudo action: ms_king_resource_confirmed-post_notify_promoted_0<br>
> * Resource action: king_resource monitor=10000 on primary<br>
> Clone Set: ms_king_resource [king_resource] (promotable)<br>
><br>
><br>
> _______________________________________________<br>
> Manage your subscription:<br>
> <a href="https://lists.clusterlabs.org/mailman/listinfo/users">https://lists.clusterlabs.org/mailman/listinfo/users</a><br>
><br>
> ClusterLabs home: <a href="https://www.clusterlabs.org/">https://www.clusterlabs.org/</a><br>
_______________________________________________<br>
Manage your subscription:<br>
<a href="https://lists.clusterlabs.org/mailman/listinfo/users">https://lists.clusterlabs.org/mailman/listinfo/users</a><br>
<br>
ClusterLabs home: <a href="https://www.clusterlabs.org/">https://www.clusterlabs.org/</a><br>
</div>
</span></font></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>