Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
39fd66a5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
39fd66a5
编写于
7月 22, 2022
作者:
O
obdev
提交者:
羽飞
7月 25, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix: ObConfigMgr::got_version() maybe leave out to update local version
上级
275a546e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
30 deletion
+7
-30
src/share/config/ob_config_manager.cpp
src/share/config/ob_config_manager.cpp
+6
-20
src/share/config/ob_config_manager.h
src/share/config/ob_config_manager.h
+1
-10
未找到文件。
src/share/config/ob_config_manager.cpp
浏览文件 @
39fd66a5
...
@@ -321,8 +321,6 @@ int ObConfigManager::update_local(int64_t expected_version)
...
@@ -321,8 +321,6 @@ int ObConfigManager::update_local(int64_t expected_version)
system_config_
.
get_version
(),
system_config_
.
get_version
(),
"current_version"
,
"current_version"
,
current_version_
,
current_version_
,
"newest_version"
,
newest_version_
,
"expected_version"
,
"expected_version"
,
expected_version
);
expected_version
);
}
else
{
}
else
{
...
@@ -370,26 +368,16 @@ int ObConfigManager::got_version(int64_t version, const bool remove_repeat /* =
...
@@ -370,26 +368,16 @@ int ObConfigManager::got_version(int64_t version, const bool remove_repeat /* =
}
else
if
(
version
<
current_version_
)
{
}
else
if
(
version
<
current_version_
)
{
LOG_WARN
(
"Local config is newer than rs, weird"
,
K_
(
current_version
),
K
(
version
));
LOG_WARN
(
"Local config is newer than rs, weird"
,
K_
(
current_version
),
K
(
version
));
}
else
if
(
version
>
current_version_
)
{
}
else
if
(
version
>
current_version_
)
{
mutex_
.
lock
();
// local:current_version_, got:version
if
(
version
>
newest_version_
)
{
LOG_INFO
(
"Got new config version"
,
K_
(
current_version
),
K
(
version
));
// local:current_version_, newest:newest_version, got:version
update_task_
.
update_local_
=
true
;
LOG_INFO
(
"Got new config version"
,
K_
(
current_version
),
K_
(
newest_version
),
K
(
version
));
schedule_task
=
true
;
newest_version_
=
version
;
// for rootserver hb to others
update_task_
.
update_local_
=
true
;
schedule_task
=
true
;
}
else
if
(
version
<
newest_version_
)
{
// In order to prevent the new version from being
// overwritten by the old version, take the latest value here
version
=
newest_version_
;
}
mutex_
.
unlock
();
}
}
if
(
schedule_task
)
{
if
(
schedule_task
)
{
bool
schedule
=
true
;
bool
schedule
=
true
;
if
(
!
inited_
)
{
if
(
!
inited_
)
{
// if got a config version before manager init, ignore this version
// if got a config version before manager init, ignore this version
newest_version_
=
current_version_
;
schedule
=
false
;
schedule
=
false
;
ret
=
OB_NOT_INIT
;
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"Couldn't update config because timer is NULL"
,
K
(
ret
));
LOG_WARN
(
"Couldn't update config because timer is NULL"
,
K
(
ret
));
...
@@ -409,7 +397,7 @@ int ObConfigManager::got_version(int64_t version, const bool remove_repeat /* =
...
@@ -409,7 +397,7 @@ int ObConfigManager::got_version(int64_t version, const bool remove_repeat /* =
int
tmp_ret
=
TG_TASK_EXIST
(
lib
::
TGDefIDs
::
CONFIG_MGR
,
update_task_
,
task_exist
);
int
tmp_ret
=
TG_TASK_EXIST
(
lib
::
TGDefIDs
::
CONFIG_MGR
,
update_task_
,
task_exist
);
if
(
task_exist
)
{
if
(
task_exist
)
{
TG_CANCEL
(
lib
::
TGDefIDs
::
CONFIG_MGR
,
update_task_
);
TG_CANCEL
(
lib
::
TGDefIDs
::
CONFIG_MGR
,
update_task_
);
LOG_INFO
(
"Cancel pending update task"
,
K
(
tmp_ret
),
K_
(
current_version
),
K
_
(
newest_version
),
K
(
version
));
LOG_INFO
(
"Cancel pending update task"
,
K
(
tmp_ret
),
K_
(
current_version
),
K
(
version
));
}
}
}
}
...
@@ -441,7 +429,7 @@ void ObConfigManager::UpdateTask::runTimerTask()
...
@@ -441,7 +429,7 @@ void ObConfigManager::UpdateTask::runTimerTask()
THIS_WORKER
.
set_timeout_ts
(
INT64_MAX
);
THIS_WORKER
.
set_timeout_ts
(
INT64_MAX
);
if
(
config_mgr_
->
current_version_
==
version
)
{
if
(
config_mgr_
->
current_version_
==
version
)
{
ret
=
OB_ALREADY_DONE
;
ret
=
OB_ALREADY_DONE
;
}
else
if
(
config_mgr_
->
newes
t_version_
>
version
)
{
}
else
if
(
config_mgr_
->
curren
t_version_
>
version
)
{
ret
=
OB_CANCELED
;
ret
=
OB_CANCELED
;
}
else
if
(
update_local_
)
{
}
else
if
(
update_local_
)
{
config_mgr_
->
current_version_
=
version
;
config_mgr_
->
current_version_
=
version
;
...
@@ -469,8 +457,6 @@ void ObConfigManager::UpdateTask::runTimerTask()
...
@@ -469,8 +457,6 @@ void ObConfigManager::UpdateTask::runTimerTask()
old_current_version
,
old_current_version
,
"current_version"
,
"current_version"
,
config_mgr_
->
current_version_
,
config_mgr_
->
current_version_
,
"newest_version"
,
config_mgr_
->
newest_version_
,
"expected_version"
,
"expected_version"
,
version
);
version
);
}
}
...
...
src/share/config/ob_config_manager.h
浏览文件 @
39fd66a5
...
@@ -85,11 +85,9 @@ private:
...
@@ -85,11 +85,9 @@ private:
ObMySQLProxy
*
sql_proxy_
;
ObMySQLProxy
*
sql_proxy_
;
ObSystemConfig
system_config_
;
ObSystemConfig
system_config_
;
ObServerConfig
&
server_config_
;
ObServerConfig
&
server_config_
;
int64_t
newest_version_
;
int64_t
current_version_
;
int64_t
current_version_
;
char
dump_path_
[
OB_MAX_FILE_NAME_LENGTH
];
char
dump_path_
[
OB_MAX_FILE_NAME_LENGTH
];
ObReloadConfig
&
reload_config_func_
;
ObReloadConfig
&
reload_config_func_
;
obutil
::
Mutex
mutex_
;
DISALLOW_COPY_AND_ASSIGN
(
ObConfigManager
);
DISALLOW_COPY_AND_ASSIGN
(
ObConfigManager
);
};
};
...
@@ -101,10 +99,8 @@ inline ObConfigManager::ObConfigManager(ObServerConfig& server_config, ObReloadC
...
@@ -101,10 +99,8 @@ inline ObConfigManager::ObConfigManager(ObServerConfig& server_config, ObReloadC
sql_proxy_
(
NULL
),
sql_proxy_
(
NULL
),
system_config_
(),
system_config_
(),
server_config_
(
server_config
),
server_config_
(
server_config
),
newest_version_
(
1
),
current_version_
(
1
),
current_version_
(
1
),
reload_config_func_
(
reload_config
),
reload_config_func_
(
reload_config
)
mutex_
()
{
{
dump_path_
[
0
]
=
'\0'
;
dump_path_
[
0
]
=
'\0'
;
}
}
...
@@ -114,11 +110,6 @@ inline int64_t ObConfigManager::get_current_version() const
...
@@ -114,11 +110,6 @@ inline int64_t ObConfigManager::get_current_version() const
return
current_version_
;
return
current_version_
;
}
}
inline
const
int64_t
&
ObConfigManager
::
get_version
()
const
{
return
newest_version_
;
}
inline
ObServerConfig
&
ObConfigManager
::
get_config
(
void
)
inline
ObServerConfig
&
ObConfigManager
::
get_config
(
void
)
{
{
return
server_config_
;
return
server_config_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录