<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<div dir="auto">
<div dir="auto">I think 10000 is a common number across promotable resource agents writers to pass to crm_master when agent during probe/monitor call thinks that node is really ready to have a resource promoted. Drbd is one of examples.</div><div dir="auto"><br></div><div dir="auto">Best,</div><div dir="auto">Vlad</div><div dir="auto"><br></div>
<div id="aqm-original" style="color: black;">
<div dir="auto">lejeczek via Users <users@clusterlabs.org> 03.06.2023. 19:32:58 wrote:</div>
<div><br></div>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #808080; padding-left: 0.75ex;">
<div dir="auto">On 03/07/2023 18:55, Andrei Borzenkov wrote:</div>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #0099CC; padding-left: 0.75ex;">
<div dir="auto">On 03.07.2023 19:39, Ken Gaillot wrote:</div>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #9933CC; padding-left: 0.75ex;">
<div dir="auto">On Mon, 2023-07-03 at 19:22 +0300, Andrei Borzenkov wrote:</div>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #669900; padding-left: 0.75ex;">
<div dir="auto">On 03.07.2023 18:07, Ken Gaillot wrote:</div>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #FF8800; padding-left: 0.75ex;">
<div dir="auto">On Mon, 2023-07-03 at 12:20 +0200, lejeczek via Users </div>
<div dir="auto">wrote:</div>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #CC0000; padding-left: 0.75ex;">
<div dir="auto">On 03/07/2023 11:16, Andrei Borzenkov wrote:</div>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #0099CC; padding-left: 0.75ex;">
<div dir="auto">On 03.07.2023 12:05, lejeczek via Users wrote:</div>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #9933CC; padding-left: 0.75ex;">
<div dir="auto">Hi guys.</div>
<div dir="auto"><br></div>
<div dir="auto">I have pgsql with I constrain like so:</div>
<div dir="auto"><br></div>
<div dir="auto">-> $ pcs constraint location PGSQL-clone rule </div>
<div dir="auto">role=Promoted</div>
<div dir="auto">score=-1000 gateway-link ne 1</div>
<div dir="auto"><br></div>
<div dir="auto">and I have a few more location constraints with that</div>
<div dir="auto">ethmonitor & those work, but this one does not seem to.</div>
<div dir="auto">When contraint is created cluster is silent, no </div>
<div dir="auto">errors nor</div>
<div dir="auto">warning, but relocation does not take place.</div>
<div dir="auto">I can move promoted resource manually just fine, to </div>
<div dir="auto">that</div>
<div dir="auto">node where 'location' should move it.</div>
<div dir="auto"><br></div>
</blockquote>
<div dir="auto"><br></div>
<div dir="auto">Instance to promote is selected according to promotion</div>
<div dir="auto">scores which are normally set by resource agent.</div>
<div dir="auto">Documentation implies that standard location constraints</div>
<div dir="auto">are also taken in account, but there is no </div>
<div dir="auto">explanation how</div>
<div dir="auto">promotion scores interoperate with location scores. </div>
<div dir="auto">It is</div>
<div dir="auto">possible that promotion score in this case takes </div>
<div dir="auto">precedence.</div>
</blockquote>
<div dir="auto">It seems to have kicked in with score=-10000 but..</div>
<div dir="auto">that was me just guessing.</div>
<div dir="auto">Indeed it would be great to know how those are </div>
<div dir="auto">calculated,</div>
<div dir="auto">in a way which would' be admin friendly or just obvious.</div>
<div dir="auto"><br></div>
<div dir="auto">thanks, L.</div>
</blockquote>
<div dir="auto"><br></div>
<div dir="auto">It's a longstanding goal to have some sort of tool for </div>
<div dir="auto">explaining</div>
<div dir="auto">how</div>
<div dir="auto">scores interact in a given situation. However it's a </div>
<div dir="auto">challenging</div>
<div dir="auto">problem and there's never enough time ...</div>
<div dir="auto"><br></div>
<div dir="auto">Basically, all scores are added together for each node, </div>
<div dir="auto">and the</div>
<div dir="auto">node</div>
<div dir="auto">with the highest score runs the resource, subject to </div>
<div dir="auto">any placement</div>
<div dir="auto">strategy configured. These mainly include stickiness, </div>
<div dir="auto">location</div>
<div dir="auto">constraints, colocation constraints, and node health. </div>
<div dir="auto">Nodes may be</div>
</blockquote>
<div dir="auto"><br></div>
<div dir="auto">And you omitted the promotion scores which was the main </div>
<div dir="auto">question.</div>
</blockquote>
<div dir="auto"><br></div>
<div dir="auto">Oh right -- first, the above is used to determine the </div>
<div dir="auto">nodes on which</div>
<div dir="auto">clone instances will be placed. After that, an </div>
<div dir="auto">appropriate number of</div>
<div dir="auto">nodes are selected for the promoted role, based on </div>
<div dir="auto">promotion scores and</div>
<div dir="auto">location and colocation constraints for the promoted role.</div>
<div dir="auto"><br></div>
</blockquote>
<div dir="auto"><br></div>
<div dir="auto">I am sorry but it does not really explain anything. Let's </div>
<div dir="auto">try concrete examples</div>
<div dir="auto"><br></div>
<div dir="auto">a) master clone instance has location score -1000 for a </div>
<div dir="auto">node and promotion score 1000. Is this node eligible for </div>
<div dir="auto">promoting clone instance (assuming no other scores are </div>
<div dir="auto">present)?</div>
<div dir="auto"><br></div>
<div dir="auto">b) promotion score is equal on two nodes A and B, but node </div>
<div dir="auto">A has better location score than node B. Is it guaranteed </div>
<div dir="auto">that clone will be promoted on A?</div>
<div dir="auto"><br></div>
<div dir="auto"><br></div>
</blockquote>
<div dir="auto">a real-life example:</div>
<div dir="auto">...Colocation Constraints:</div>
<div dir="auto"> Started resource 'HA-10-1-1-253' with Promoted resource </div>
<div dir="auto">'PGSQL-clone' (id:</div>
<div dir="auto"> colocation-HA-10-1-1-253-PGSQL-clone-INFINITY)</div>
<div dir="auto"> score=INFINITY</div>
<div dir="auto">..</div>
<div dir="auto">Order Constraints:</div>
<div dir="auto"> promote resource 'PGSQL-clone' then start resource </div>
<div dir="auto">'HA-10-1-1-253' (id: order-</div>
<div dir="auto"> PGSQL-clone-HA-10-1-1-253-Mandatory)</div>
<div dir="auto"> symmetrical=0 kind=Mandatory</div>
<div dir="auto"> demote resource 'PGSQL-clone' then stop resource </div>
<div dir="auto">'HA-10-1-1-253' (id: order-</div>
<div dir="auto"> PGSQL-clone-HA-10-1-1-253-Mandatory-1)</div>
<div dir="auto"> symmetrical=0 kind=Mandatory</div>
<div dir="auto"><br></div>
<div dir="auto">I had to bump this one up to:</div>
<div dir="auto">...</div>
<div dir="auto"> resource 'PGSQL-clone' (id: location-PGSQL-clone)</div>
<div dir="auto"> Rules:</div>
<div dir="auto"> Rule: role=Promoted score=-10000 (id: </div>
<div dir="auto">location-PGSQL-clone-rule)</div>
<div dir="auto"> Expression: gateway-link ne 1 (id: </div>
<div dir="auto">location-PGSQL-clone-rule-expr)</div>
<div dir="auto"><br></div>
<div dir="auto"><br></div>
<div dir="auto">'-1000' did not seem to be good enough, '-10000' was just a </div>
<div dir="auto">"lucky" guess.</div>
<div dir="auto"><br></div>
<div dir="auto">as earlier: I was able to 'move' the promoted and I think </div>
<div dir="auto">'prefers' also worked.</div>
<div dir="auto">I don't know it 'pgsql' would work with any other </div>
<div dir="auto">constraints, if it was safe to try so.</div>
<div dir="auto"><br></div>
<div dir="auto">many thanks, L.</div>
<div dir="auto"><br></div>
<div dir="auto"><br></div>
<div dir="auto">_______________________________________________</div>
<div dir="auto">Manage your subscription:</div>
<div dir="auto">https://lists.clusterlabs.org/mailman/listinfo/users</div>
<div dir="auto"><br></div>
<div dir="auto">ClusterLabs home: https://www.clusterlabs.org/</div>
</blockquote>
</div><div dir="auto"><br></div>
</div></body>
</html>