提交 895dd335 编写于 作者: H happyhust 提交者: LINGuanRen

(#408)Resolves #264, resolves #265, resolves #269

上级 10c3950b
......@@ -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__)
......
......@@ -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<const ObElectionMsgDEPrepare&>(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())) {
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册