<div dir="ltr"><font face="monospace, monospace">Hello!<br><br>I have a situation where I would like to set master preferences based on practically unbounded measurements, for instance age or connection count. I am trying to figure out how this can be done safely with the current scoring model. <br><br>If I for instance choose to set the score directly based on age in minutes, I will be limited to something like 100000 minutes - 70 days. If I want second resolution, I will only get 100000 seconds ~ 27 hours. <br><br>The problem gets even worse if I want to select primarily on age but secondly on for instance active connection count. That is to make sure that connection count only matters if age is equal. How can I locally compute a single score which reflects this logic? Tricky to say the least, especially if the measurements are non-bounded.<br><br>I am imagining a situation where a node can set local attributes, like { lastModificationTime: X, activeConnections: Y }, and I can provide a score or "master preference" function. I am here illustrating the concept with a simplified function which would only work in a two-node situation:<br><br>compute_scores(node0_lastModificationTime, <br>               node0_activeConnections, <br>               node1_lastModificationTime,<br>               node1_activeConnections) {    <br>    winner = compare(node0_lastModificationTime, node1_lastModificationTime);<br>    if (winner == None) {<br>        winner = compare(node0_activeConnections, node1_activeConnections);                <br>    }<br>    if (winner == None) {<br>        //tie<br>        return { node0: 0, node1: 0 }<br>    } else if (winner == node0) {<br>        return { node0: 1, node1: 0 } <br>    } else {<br>       return { node0: 0, node1: 1 }<br>    }    <br>}<br><br>Is something like this possible today? Has anyone done this already? <br><br>If I am to implement this myself I suppose I could store per-node attributes in the CIB and aggregate them on each node, compare and compute each local score on 'monitor' or 'notify'. I am unsure whether this will give me the result which I need, though. I am primarily concerned that the CIB attributes and/or my score won't be updated by the time that scores are evaluated. I am relying on age today to choose the right master after partitioning and split brain. For a transition to this new model, I would need pacemaker to call my function before making any decision. And I'm not sure it would.<br><br>Any advice/ideas?<br><br>Best regards,<br><br>Alexander Torstling</font><br></div>