Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
309fba25
O
oceanbase
项目概览
clmforever
/
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,发现更多精彩内容 >>
提交
309fba25
编写于
11月 23, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix check_merge_interval_time in case when cluster has been restarted
上级
5b1e49b0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
70 addition
and
5 deletion
+70
-5
src/rootserver/freeze/ob_major_merge_scheduler.cpp
src/rootserver/freeze/ob_major_merge_scheduler.cpp
+22
-5
src/share/ob_server_table_operator.cpp
src/share/ob_server_table_operator.cpp
+47
-0
src/share/ob_server_table_operator.h
src/share/ob_server_table_operator.h
+1
-0
未找到文件。
src/rootserver/freeze/ob_major_merge_scheduler.cpp
浏览文件 @
309fba25
...
...
@@ -31,6 +31,7 @@
#include "share/ob_global_stat_proxy.h"
#include "share/ob_service_epoch_proxy.h"
#include "share/ob_column_checksum_error_operator.h"
#include "share/ob_server_table_operator.h"
namespace
oceanbase
{
...
...
@@ -784,6 +785,8 @@ void ObMajorMergeScheduler::check_merge_interval_time(const bool is_merging)
int64_t
global_last_merged_time
=
-
1
;
int64_t
global_merge_start_time
=
-
1
;
int64_t
max_merge_time
=
-
1
;
int64_t
start_service_time
=
-
1
;
int64_t
all_service_time
=
-
1
;
if
(
OB_ISNULL
(
zone_merge_mgr_
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"zone_merge_mgr_ is unexpected nullptr"
,
KR
(
ret
),
K_
(
tenant_id
));
...
...
@@ -805,12 +808,25 @@ void ObMajorMergeScheduler::check_merge_interval_time(const bool is_merging)
}
else
{
max_merge_time
=
MAX
(
global_last_merged_time
,
global_merge_start_time
);
}
if
(
OB_SUCC
(
ret
)
&&
!
is_paused
())
{
if
(
OB_SUCC
(
ret
))
{
ObServerTableOperator
st_operator
;
if
(
OB_FAIL
(
st_operator
.
init
(
sql_proxy_
)))
{
LOG_WARN
(
"fail to init server table operator"
,
K
(
ret
),
K_
(
tenant_id
));
}
else
if
(
OB_FAIL
(
st_operator
.
get_start_service_time
(
GCONF
.
self_addr_
,
start_service_time
)))
{
LOG_WARN
(
"fail to get start service time"
,
KR
(
ret
),
K_
(
tenant_id
));
}
else
{
all_service_time
=
now
-
start_service_time
;
}
}
// LOG_ERROR should satisfy one additional condition: all_service_time > MAX_NO_MERGE_INTERVAL.
// So as to avoid LOG_ERROR when the tenant miss daily merge due to the cluster restarted.
if
(
OB_SUCC
(
ret
)
&&
!
is_paused
()
&&
(
all_service_time
>
MAX_NO_MERGE_INTERVAL
))
{
if
(
is_merging
)
{
if
((
now
-
max_merge_time
)
>
MAX_NO_MERGE_INTERVAL
)
{
if
(
TC_REACH_TIME_INTERVAL
(
30
*
60
*
1000
*
1000
))
{
LOG_ERROR
(
"long time major freeze not finish, please check it"
,
KR
(
ret
),
K
(
global_last_merged_time
),
K
(
global_merge_start_time
),
K
(
max_merge_time
),
K
(
now
),
K_
(
tenant_id
),
K
(
is_merging
));
LOG_ERROR
(
"long time major freeze not finish, please check it"
,
KR
(
ret
),
K
(
global_last_merged_time
),
K
(
global_merge_start_time
),
K
(
max_merge_time
),
K
(
now
),
K_
(
tenant_id
),
K
(
is_merging
),
K
(
start_service_time
),
K
(
all_service_time
));
}
}
}
else
{
...
...
@@ -822,8 +838,9 @@ void ObMajorMergeScheduler::check_merge_interval_time(const bool is_merging)
(
GCONF
.
enable_major_freeze
)
&&
(
!
tenant_config
->
major_freeze_duty_time
.
disable
()))
{
if
(
TC_REACH_TIME_INTERVAL
(
30
*
60
*
1000
*
1000
))
{
LOG_ERROR
(
"long time no major freeze, please check it"
,
KR
(
ret
),
K
(
global_last_merged_time
),
K
(
global_merge_start_time
),
K
(
max_merge_time
),
K
(
now
),
K_
(
tenant_id
),
K
(
is_merging
));
LOG_ERROR
(
"long time no major freeze, please check it"
,
KR
(
ret
),
K
(
global_last_merged_time
),
K
(
global_merge_start_time
),
K
(
max_merge_time
),
K
(
now
),
K_
(
tenant_id
),
K
(
is_merging
),
K
(
start_service_time
),
K
(
all_service_time
));
}
}
}
...
...
src/share/ob_server_table_operator.cpp
浏览文件 @
309fba25
...
...
@@ -456,6 +456,53 @@ int ObServerTableOperator::update_with_partition(const common::ObAddr &server,
return
ret
;
}
int
ObServerTableOperator
::
get_start_service_time
(
const
common
::
ObAddr
&
server
,
int64_t
&
start_service_time
)
const
{
int
ret
=
OB_SUCCESS
;
char
svr_ip
[
OB_IP_STR_BUFF
]
=
""
;
if
(
!
inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not init"
,
K
(
ret
));
}
else
if
(
!
server
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
server
));
}
else
if
(
false
==
server
.
ip_to_string
(
svr_ip
,
sizeof
(
svr_ip
)))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"convert server ip to string failed"
,
K
(
ret
),
K
(
server
));
}
else
{
ObSqlString
sql
;
ObTimeoutCtx
ctx
;
if
(
OB_FAIL
(
ObRootUtils
::
get_rs_default_timeout_ctx
(
ctx
)))
{
LOG_WARN
(
"fail to get timeout ctx"
,
K
(
ret
),
K
(
ctx
));
}
else
if
(
OB_FAIL
(
sql
.
assign_fmt
(
"SELECT start_service_time FROM %s WHERE svr_ip = '%s' AND"
" svr_port = %d"
,
OB_ALL_SERVER_TNAME
,
svr_ip
,
server
.
get_port
())))
{
LOG_WARN
(
"fail to append sql"
,
K
(
ret
));
}
else
{
SMART_VAR
(
ObMySQLProxy
::
MySQLResult
,
res
)
{
int
tmp_ret
=
OB_SUCCESS
;
ObMySQLResult
*
result
=
NULL
;
if
(
OB_FAIL
(
proxy_
->
read
(
res
,
OB_SYS_TENANT_ID
,
sql
.
ptr
())))
{
LOG_WARN
(
"fail to execute sql"
,
K
(
sql
),
K
(
ret
));
}
else
if
(
OB_ISNULL
(
result
=
res
.
get_result
()))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"fail to get sql result"
,
K
(
sql
),
K
(
ret
));
}
else
if
(
OB_FAIL
(
result
->
next
()))
{
LOG_WARN
(
"fail to get next"
,
KR
(
ret
),
K
(
sql
));;
}
else
{
EXTRACT_INT_FIELD_MYSQL
(
*
result
,
"start_service_time"
,
start_service_time
,
int64_t
);
}
if
(
OB_SUCC
(
ret
)
&&
(
OB_ITER_END
!=
(
tmp_ret
=
result
->
next
())))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"get more row than one"
,
KR
(
ret
),
KR
(
tmp_ret
),
K
(
sql
));
}
}
}
}
return
ret
;
}
}
//end namespace rootserver
}
//end namespace oceanbase
src/share/ob_server_table_operator.h
浏览文件 @
309fba25
...
...
@@ -53,6 +53,7 @@ public:
virtual
int
update_stop_time
(
const
common
::
ObAddr
&
server
,
const
int64_t
stop_time
);
virtual
int
update_with_partition
(
const
common
::
ObAddr
&
server
,
bool
with_partition
);
int
get_start_service_time
(
const
common
::
ObAddr
&
server
,
int64_t
&
start_service_time
)
const
;
private:
int
build_server_status
(
const
common
::
sqlclient
::
ObMySQLResult
&
res
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录