This commit is contained in:
Pradeep Chhetri 2023-11-07 14:20:40 +08:00
parent 201a7b8d5f
commit 4e8ff997c0
4 changed files with 5 additions and 4 deletions

View File

@ -584,7 +584,8 @@ String FeatureFlagsCommand::run()
String YieldLeadershipCommand::run()
{
return keeper_dispatcher.yieldLeadership() ? "Sent yield leadership request to leader." : "Failed to send yield leadership request to leader.";
keeper_dispatcher.yieldLeadership();
return "Sent yield leadership request to leader.";
}
}

View File

@ -238,7 +238,7 @@ public:
}
/// Yield leadership and become follower.
bool yieldLeadership()
void yieldLeadership()
{
return server->yieldLeadership();
}

View File

@ -1087,7 +1087,7 @@ bool KeeperServer::requestLeader()
return isLeader() || raft_instance->request_leadership();
}
bool KeeperServer::yieldLeadership()
void KeeperServer::yieldLeadership()
{
if (isLeader())
raft_instance->yield_leadership();

View File

@ -141,7 +141,7 @@ public:
bool requestLeader();
bool yieldLeadership();
void yieldLeadership();
void recalculateStorageStats();
};