osaf/services/saf/clmsv/nodeagent/election_starter.cc |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


This patch will allow any node in the cluster to start an election, but the node
with the lowest node-id will still be given priority and only after a certain
time has elapsed will other nodes be able initiate an election.

diff --git a/osaf/services/saf/clmsv/nodeagent/election_starter.cc 
b/osaf/services/saf/clmsv/nodeagent/election_starter.cc
--- a/osaf/services/saf/clmsv/nodeagent/election_starter.cc
+++ b/osaf/services/saf/clmsv/nodeagent/election_starter.cc
@@ -122,11 +122,12 @@ timespec ElectionStarter::Poll() {
 
 timespec ElectionStarter::CalculateTimeRemainingUntilNextEvent() const {
   timespec timeout;
-  if (controller_nodes_.tree.empty() &&
-      nodes_with_lower_node_id_.tree.empty()) {
+  if (controller_nodes_.tree.empty()) {
+    timespec delay = election_delay_time_;
+    if (!nodes_with_lower_node_id_.tree.empty()) delay += base::kTwentySeconds;
     timeout =
-        base::Max(controller_nodes_.last_change + election_delay_time_,
-                  nodes_with_lower_node_id_.last_change + election_delay_time_,
+        base::Max(controller_nodes_.last_change + delay,
+                  nodes_with_lower_node_id_.last_change + delay,
                   last_election_start_attempt_ + 
base::kOneHundredMilliseconds);
   } else {
     timeout = base::kTimespecMax;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to