Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
895dd335
O
oceanbase
项目概览
Metz
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
895dd335
编写于
10月 27, 2021
作者:
H
happyhust
提交者:
LINGuanRen
10月 27, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
(#408)Resolves #264, resolves #265, resolves #269
上级
10c3950b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
5 addition
and
5 deletion
+5
-5
src/election/ob_election.h
src/election/ob_election.h
+1
-1
src/election/ob_election_msg_pool.cpp
src/election/ob_election_msg_pool.cpp
+3
-3
src/election/ob_election_msg_pool.h
src/election/ob_election_msg_pool.h
+1
-1
未找到文件。
src/election/ob_election.h
浏览文件 @
895dd335
...
...
@@ -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_CENTR
I
ALIZED_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__)
...
...
src/election/ob_election_msg_pool.cpp
浏览文件 @
895dd335
...
...
@@ -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/decentralize
s
voting/centralized prepare/centralized voting]
// @param [in] msg mess
ga
e for recording
// record messages, in [decentralized prepare/decentralize
d
voting/centralized prepare/centralized voting]
// @param [in] msg mess
ag
e 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 candid
i
ate"
,
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
()))
{
...
...
src/election/ob_election_msg_pool.h
浏览文件 @
895dd335
...
...
@@ -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 prio
i
rity 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录