Skip to content

Commit

Permalink
fix typo about CampaignLeader
Browse files Browse the repository at this point in the history
  • Loading branch information
aspirer committed May 7, 2022
1 parent bec8687 commit 1f8dd32
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion curvefs/src/mds/mds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void MDS::StartCompaginLeader() {

InitLeaderElection(electionOption);

while (0 != leaderElection_->CampaginLeader()) {
while (0 != leaderElection_->CampaignLeader()) {
LOG(INFO) << leaderElection_->GetLeaderName()
<< " compagin for leader again";
}
Expand Down
2 changes: 1 addition & 1 deletion src/leader_election/leader_election.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using ::curve::common::Thread;

namespace curve {
namespace election {
int LeaderElection::CampaginLeader() {
int LeaderElection::CampaignLeader() {
LOG(INFO) << opt_.leaderUniqueName << " start campaign leader prefix: "
<< realPrefix_;

Expand Down
4 changes: 2 additions & 2 deletions src/leader_election/leader_election.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ class LeaderElection {
}

/**
* @brief CampaginLeader 竞选leader
* @brief CampaignLeader 竞选leader
*
* @return 0表示竞选成功 -1表示竞选失败
*/
int CampaginLeader();
int CampaignLeader();

/**
* @brief StartObserverLeader 启动leader节点监测线程
Expand Down
2 changes: 1 addition & 1 deletion src/mds/server/mds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void MDS::StartCompaginLeader() {
leaderElectionOp.etcdCli = etcdClient_;
leaderElectionOp.campaginPrefix = "";
InitLeaderElection(leaderElectionOp);
while (0 != leaderElection_->CampaginLeader()) {
while (0 != leaderElection_->CampaignLeader()) {
LOG(INFO) << leaderElection_->GetLeaderName()
<< " campaign for leader again";
}
Expand Down
2 changes: 1 addition & 1 deletion src/snapshotcloneserver/snapshotclone_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void SnapShotCloneServer::StartCompaginLeader(void) {
leaderElection_ = std::make_shared<LeaderElection>(option);

// compagin leader and observe self then return
while (0 != leaderElection_->CampaginLeader()) {
while (0 != leaderElection_->CampaignLeader()) {
LOG(INFO) << option.leaderUniqueName
<< " campaign for leader again";
}
Expand Down
4 changes: 2 additions & 2 deletions test/leaderelection/leader_election_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TEST(TestLeaderElection, test_leader_election) {
_))
.WillOnce(DoAll(SetArgPointee<4>(1),
Return(EtcdErrCode::EtcdCampaignLeaderSuccess)));
ASSERT_EQ(0, leaderElection->CampaginLeader());
ASSERT_EQ(0, leaderElection->CampaignLeader());

EXPECT_CALL(*client, CampaignLeader(
realPrefix,
Expand All @@ -71,7 +71,7 @@ TEST(TestLeaderElection, test_leader_election) {
opts.electionTimeoutMs,
_))
.WillOnce(Return(EtcdErrCode::EtcdCampaignInternalErr));
ASSERT_EQ(-1, leaderElection->CampaginLeader());
ASSERT_EQ(-1, leaderElection->CampaignLeader());

EXPECT_CALL(*client, LeaderResign(1, 1000 * opts.sessionInterSec))
.WillOnce(Return(EtcdErrCode::EtcdLeaderResiginSuccess));
Expand Down

0 comments on commit 1f8dd32

Please sign in to comment.