Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chhetripradeep committed Nov 7, 2023
1 parent 201a7b8 commit 4e8ff99
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Coordination/FourLetterCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
}

}
2 changes: 1 addition & 1 deletion src/Coordination/KeeperDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class KeeperDispatcher
}

/// Yield leadership and become follower.
bool yieldLeadership()
void yieldLeadership()
{
return server->yieldLeadership();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Coordination/KeeperServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/Coordination/KeeperServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class KeeperServer

bool requestLeader();

bool yieldLeadership();
void yieldLeadership();

void recalculateStorageStats();
};
Expand Down

0 comments on commit 4e8ff99

Please sign in to comment.