From 895dd335327983c2fb9a7362e8bb149a7e1343cd Mon Sep 17 00:00:00 2001 From: happyhust Date: Wed, 27 Oct 2021 10:52:06 +0800 Subject: [PATCH] (#408)Resolves #264, resolves #265, resolves #269 --- src/election/ob_election.h | 2 +- src/election/ob_election_msg_pool.cpp | 6 +++--- src/election/ob_election_msg_pool.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/election/ob_election.h b/src/election/ob_election.h index 77395d45bc..7f985971aa 100644 --- a/src/election/ob_election.h +++ b/src/election/ob_election.h @@ -373,7 +373,7 @@ private: static const int64_t OB_ELECTION_HASH_TIME_US = 10000; // 10ms static const int64_t OB_ELECTION_HASH_TABLE_NUM_NEW = 580; // mod 580 /**************************************************************************************************/ - static const int64_t OB_ELECTION_MAX_CENTRIALIZED_TIME = 100000; // 100ms + static const int64_t OB_ELECTION_MAX_CENTRALIZED_TIME = 100000; // 100ms static const int64_t OB_ELECTION_LEADER_EXPIRED_PRINT_INTERVAL_US = 10 * 1000 * 1000; // 10S // RWLock performs better on ARM platform, but worse on x86 platform #if defined(__x86_64__) diff --git a/src/election/ob_election_msg_pool.cpp b/src/election/ob_election_msg_pool.cpp index a72da981b0..447ca41981 100644 --- a/src/election/ob_election_msg_pool.cpp +++ b/src/election/ob_election_msg_pool.cpp @@ -194,8 +194,8 @@ void ObElectionVoteMsgPool::correct_recordT1_if_necessary(int64_t T1_timestamp) vote_recorder_.correct_recordT1_if_necessary(T1_timestamp); } -// record messages, in [decentralized prepare/decentralizes voting/centralized prepare/centralized voting] -// @param [in] msg messgae for recording +// record messages, in [decentralized prepare/decentralized voting/centralized prepare/centralized voting] +// @param [in] msg message for recording // @return error code int ObElectionVoteMsgPool::store(const ObElectionVoteMsg& msg) { @@ -214,7 +214,7 @@ int ObElectionVoteMsgPool::store(const ObElectionVoteMsg& msg) const ObElectionMsgDEPrepare& casted_msg = static_cast(msg); if (OB_UNLIKELY(!casted_msg.get_priority().is_candidate())) { ret = OB_ELECTION_WARN_NOT_CANDIDATE; - ELECT_ASYNC_LOG(ERROR, "deprepare msg sender is not candidiate", K_(partition), K(msg), K(ret)); + ELECT_ASYNC_LOG(ERROR, "deprepare msg sender is not candidate", K_(partition), K(msg), K(ret)); } else if (OB_UNLIKELY(OB_FAIL(deprepare_recorder_.record_msg(msg)))) { ELECT_ASYNC_LOG(WARN, "fail to store election msg", K_(partition), K(msg), K(ret)); } else if (OB_UNLIKELY(casted_msg.get_T1_timestamp() > cached_devote_prepare_msg_.get_T1_timestamp())) { diff --git a/src/election/ob_election_msg_pool.h b/src/election/ob_election_msg_pool.h index 43a896e907..83bd033ca3 100644 --- a/src/election/ob_election_msg_pool.h +++ b/src/election/ob_election_msg_pool.h @@ -49,7 +49,7 @@ public: void correct_recordT1_if_necessary(int64_t T1_timestamp); int store(const ObElectionVoteMsg& msg); int get_decentralized_candidate(common::ObAddr& server, - ObElectionPriority& priority, // get the highest prioirity of server + ObElectionPriority& priority, // get the highest priority of server const int64_t replica_num, const int64_t t1, int64_t& lease_time); int check_decentralized_majority(common::ObAddr& new_leader, int64_t& ticket, // check if votes for self reach majority -- GitLab