<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Courier New" size="1"><span style="font-size:8pt;">
<div>Hello again</div>
<div> </div>
<div>After performing some million try&error testcases (at least it feels like that) I finally come to the following conclusion:</div>
<div>I necessarily need to understand the scoring and allocation algorithm much better!</div>
<div>Unfortunately I could not find any good documentation - just some articles containing hints, but that proved insufficient.</div>
<div>Any pointers are very welcome.</div>
<div> </div>
<div>So first my original request contained a wrong colocation constraint (missing master role) as Ken pointed out correctly.</div>
<div>This would have been fixed successfully with the correct constraint.</div>
<div> </div>
<div>But in the meantime I had advanced to a more complex cluster configuration which exhibited another problem - although it looked at first very much alike.</div>
<div> </div>
<div>The new cluster config was for a system like that:</div>
<div> </div>
<div> node1: node2:</div>
<div> --------------- ---------------</div>
<div> | FS_at_NFS | | FS_avoid_NFS |</div>
<div> --------------- ---------------</div>
<div> | NFS_server |</div>
<div> ---------------</div>
<div> | NFS_ip |</div>
<div> ---------------</div>
<div> | DRBD_fs |</div>
<div> --------------- ---------------</div>
<div> | DRBD-master | | DRBD-slave |</div>
<div> --------------- ---------------</div>
<div> </div>
<div>Again I tried to move the NFS server to the other node but DRBD-master was not promoted to the other node.</div>
<div> </div>
<div>As I now know there are 2 conditions necessary to see that problem:</div>
<div> * the -INFINITY colocation constraint for the FS_avoid_NFS</div>
<div> * a rather high value for resource stickiness (which was originally set to INFINITY)</div>
<div> </div>
<div>If I remove the FS_avoid_NFS resource the problem can no longer be reproduced.</div>
<div>As well if I remove the resource stickiness completely (or set it to a small value) the problem is gone.</div>
<div> </div>
<div>The maximum value I can use for resource stickiness without a problem is the score which the DRBD-slave returns minus "2".</div>
<div>(At least that's what my experiments seem to show.)</div>
<div> </div>
<div>So apparently there is/was a configuration problem with the INFINITY score for stickiness and the -INFINITY score for the colocation constraint.</div>
<div> </div>
<div>Moreover I noticed that with my latter configuration there were some pending transitions (which were automatically resolved after the cluster-recheck-interval, which resulted in my first work-around to reduce this interval significantly and thus resolve
the problem more quickly).</div>
<div>These pending transitions can only be seen with my order constraints. If I remove these then there are no pending transitions (although the demote does not happen, with the stickiness set too high).</div>
<div>So maybe this could be a bug ... but I will no further investigate on this.</div>
<div> </div>
<div>------------------------------------------------------------------------------------------------</div>
<div> </div>
<div>And for all those curious out there here are my scores and what I guess how they are calculated.</div>
<div> </div>
<div>All primitive resources are colocated with DRBD-master (not one on top of the other).</div>
<div>My DRBD-RA returns 10000 for master and 1000 for slave.</div>
<div>I have set resource stickiness to 995.</div>
<div> </div>
<div>Here is the idle state before movement:</div>
<div>[root@deneb682 ~]# crm_simulate -LVs</div>
<div> </div>
<div>Current cluster status:</div>
<div>Online: [ deneb682 deneb683 ]</div>
<div> </div>
<div> Master/Slave Set: DRBD-master [DRBD]</div>
<div> Masters: [ deneb682 ]</div>
<div> Slaves: [ deneb683 ]</div>
<div> DRBD_fs (ocf::heartbeat:Dummy): Started deneb682</div>
<div> NFS_ip (ocf::heartbeat:Dummy): Started deneb682</div>
<div> NFS_server (ocf::heartbeat:Dummy): Started deneb682</div>
<div> FS_at_server (ocf::heartbeat:Dummy): Started deneb682</div>
<div> FS_avoid_server (ocf::heartbeat:Dummy): Started deneb683</div>
<div> </div>
<div>Allocation scores:</div>
<div>clone_color: DRBD-master allocation score on deneb682: 3980 <= 4 * stickiness (once for each resource on top in the chain)</div>
<div>clone_color: DRBD-master allocation score on deneb683: 0</div>
<div>clone_color: DRBD:0 allocation score on deneb682: 10001 <= master + 1 for ‘started on this node’</div>
<div>clone_color: DRBD:0 allocation score on deneb683: 0</div>
<div>clone_color: DRBD:1 allocation score on deneb682: 0</div>
<div>clone_color: DRBD:1 allocation score on deneb683: 1001 <= slave + 1 for ‘started on this node’</div>
<div>native_color: DRBD:0 allocation score on deneb682: 10001 <= same as clone_color above</div>
<div>native_color: DRBD:0 allocation score on deneb683: -995 <= same as clone_color above - stickiness</div>
<div>native_color: DRBD:1 allocation score on deneb682: -INFINITY <= due to DRBD:0 already allocated for this node</div>
<div>native_color: DRBD:1 allocation score on deneb683: 6 <= same as clone_color above - stickiness</div>
<div>DRBD:0 promotion score on deneb682: 17960 <= master + 2 * 4 * stickiness</div>
<div>DRBD:1 promotion score on deneb683: 5 <= slave - stickiness</div>
<div>native_color: DRBD_fs allocation score on deneb682: 10996 <= inherit from DRBD:0 (master) + stickiness</div>
<div>native_color: DRBD_fs allocation score on deneb683: -INFINITY <= due to no DRBD master allocated for this node</div>
<div>native_color: NFS_ip allocation score on deneb682: 10996</div>
<div>native_color: NFS_ip allocation score on deneb683: -INFINITY</div>
<div>native_color: NFS_server allocation score on deneb682: 10996</div>
<div>native_color: NFS_server allocation score on deneb683: -INFINITY</div>
<div>native_color: FS_at_server allocation score on deneb682: 10996</div>
<div>native_color: FS_at_server allocation score on deneb683: -INFINITY</div>
<div>native_color: FS_avoid_server allocation score on deneb682: -INFINITY <= due to DRBD master allocated for this node</div>
<div>native_color: FS_avoid_server allocation score on deneb683: 995 <= stickiness</div>
<div> </div>
<div> </div>
<div>And here is the successful transition following the ‘pcs resource move NFS_server’:</div>
<div>Allocation scores:</div>
<div>clone_color: DRBD-master allocation score on deneb682: 1 <= stickiness no longer considered; just 1 for ‘master on this node’</div>
<div>clone_color: DRBD-master allocation score on deneb683: 0</div>
<div>clone_color: DRBD:0 allocation score on deneb682: 10001 <= no change</div>
<div>clone_color: DRBD:0 allocation score on deneb683: 0</div>
<div>clone_color: DRBD:1 allocation score on deneb682: 0</div>
<div>clone_color: DRBD:1 allocation score on deneb683: 1001 <= no change</div>
<div>native_color: DRBD:0 allocation score on deneb682: 10001 <= no change</div>
<div>native_color: DRBD:0 allocation score on deneb683: -995 <= no change</div>
<div>native_color: DRBD:1 allocation score on deneb682: -INFINITY <= no change</div>
<div>native_color: DRBD:1 allocation score on deneb683: 6 <= no change</div>
<div>DRBD:1 promotion score on deneb683: 5 <= no change</div>
<div>DRBD:0 promotion score on deneb682: 1 <= stickiness no longer considered; just 1 for ‘master on this node’</div>
<div>native_color: DRBD_fs allocation score on deneb682: -INFINITY</div>
<div>native_color: DRBD_fs allocation score on deneb683: 6</div>
<div>native_color: NFS_ip allocation score on deneb682: -INFINITY</div>
<div>native_color: NFS_ip allocation score on deneb683: 6</div>
<div>native_color: NFS_server allocation score on deneb682: -INFINITY <= due to move constraint</div>
<div>native_color: NFS_server allocation score on deneb683: 6 <= inherit from DRBD:1 (slave) - stickiness</div>
<div>native_color: FS_at_server allocation score on deneb682: -INFINITY</div>
<div>native_color: FS_at_server allocation score on deneb683: 6</div>
<div>native_color: FS_avoid_server allocation score on deneb682: 0 <= stickiness no longer considered</div>
<div>native_color: FS_avoid_server allocation score on deneb683: -INFINITY</div>
<div> </div>
<div> </div>
<div>In contrast here the same transition, which does not result in a demote with resource stickiness set to 2002:</div>
<div>Allocation scores:</div>
<div>clone_color: DRBD-master allocation score on deneb682: 1 <= similar to above</div>
<div>clone_color: DRBD-master allocation score on deneb683: 0</div>
<div>clone_color: DRBD:0 allocation score on deneb682: 10001 <= similar to above</div>
<div>clone_color: DRBD:0 allocation score on deneb683: 0</div>
<div>clone_color: DRBD:1 allocation score on deneb682: 0</div>
<div>clone_color: DRBD:1 allocation score on deneb683: 1001 <= similar to above</div>
<div>native_color: DRBD:0 allocation score on deneb682: 10001 <= similar to above</div>
<div>native_color: DRBD:0 allocation score on deneb683: -2002 <= similar to above</div>
<div>native_color: DRBD:1 allocation score on deneb682: -INFINITY <= similar to above</div>
<div>native_color: DRBD:1 allocation score on deneb683: 1001 <= similar to above but with changed sign!?</div>
<div>DRBD:0 promotion score on deneb682: 1 <= similar to above</div>
<div>DRBD:1 promotion score on deneb683: 1 <= I have no clue where this could come from!?</div>
<div>native_color: DRBD_fs allocation score on deneb682: 12003 <= inherit from DRBD:0 (master) + stickiness</div>
<div>native_color: DRBD_fs allocation score on deneb683: -INFINITY</div>
<div>native_color: NFS_ip allocation score on deneb682: 12003</div>
<div>native_color: NFS_ip allocation score on deneb683: -INFINITY</div>
<div>native_color: NFS_server allocation score on deneb682: -INFINITY <= due to move constraint</div>
<div>native_color: NFS_server allocation score on deneb683: -INFINITY <= due to no DRBD master allocated for this node</div>
<div>native_color: FS_at_server allocation score on deneb682: 12003</div>
<div>native_color: FS_at_server allocation score on deneb683: -INFINITY</div>
<div>native_color: FS_avoid_server allocation score on deneb682: -INFINITY</div>
<div>native_color: FS_avoid_server allocation score on deneb683: 2002 <= stickiness</div>
<div> </div>
<div>From these I can guess how (most of) the scores are calculated in this situation.</div>
<div>But unfortunately that does only little help to understand scoring and allocation in advance.</div>
<div>(It’s always much easier to devise an explanation afterwards, but sometimes you should know in advance.)</div>
<div> </div>
<div>Kind regards</div>
<div>Andi</div>
<div> </div>
<div> </div>
</span></font>
</body>
</html>