Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
不争之德
oceanbase
提交
062a57e1
O
oceanbase
项目概览
不争之德
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
062a57e1
编写于
9月 07, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
9月 07, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] add defense for drop tenant and trans desc reset
上级
0336a929
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
0 deletion
+24
-0
src/storage/transaction/ob_trans_define.cpp
src/storage/transaction/ob_trans_define.cpp
+12
-0
src/storage/transaction/ob_ts_mgr.h
src/storage/transaction/ob_ts_mgr.h
+12
-0
未找到文件。
src/storage/transaction/ob_trans_define.cpp
浏览文件 @
062a57e1
...
...
@@ -1075,6 +1075,18 @@ void ObTransDesc::consistency_wait()
void
ObTransDesc
::
reset
()
{
if
(
OB_NOT_NULL
(
sche_ctx_
))
{
need_print_trace_log_
=
true
;
if
(
EXECUTE_COUNT_PER_SEC
(
64
))
{
TRANS_LOG
(
WARN
,
"reset trans desc without release sche ctx"
,
K
(
*
this
),
KP
(
sche_ctx_
),
"lbt"
,
lbt
());
}
}
if
(
OB_NOT_NULL
(
part_ctx_
))
{
need_print_trace_log_
=
true
;
if
(
EXECUTE_COUNT_PER_SEC
(
64
))
{
TRANS_LOG
(
WARN
,
"reset trans desc without release part ctx"
,
K
(
*
this
),
KP
(
part_ctx_
),
"lbt"
,
lbt
());
}
}
if
(
need_print_trace_log_
)
{
FORCE_PRINT_TRACE
(
&
tlog_
,
"[trans error] "
);
}
...
...
src/storage/transaction/ob_ts_mgr.h
浏览文件 @
062a57e1
...
...
@@ -14,6 +14,7 @@
#define OCEANBASE_TRANSACTION_OB_TS_MGR_
#include <stdint.h>
#include "common/ob_clock_generator.h"
#include "lib/utility/ob_print_utils.h"
#include "lib/lock/ob_drw_lock.h"
#include "lib/hash/ob_link_hashmap.h"
...
...
@@ -189,11 +190,16 @@ public:
}
int
set_invalid
();
int
switch_ts_source
(
const
uint64_t
tenant_id
,
const
int
ts_type
);
TO_STRING_KV
(
K_
(
tenant_id
),
K_
(
last_check_switch_ts
),
K_
(
last_obtain_switch_ts
),
K_
(
check_switch_interval
),
K_
(
cur_ts_type
),
K_
(
last_access_ts
));
private:
int
switch_ts_source_
(
const
uint64_t
tenant_id
,
const
int
ts_type
);
void
revert_ts_source_
(
ObTsSourceGuard
&
guard
);
public:
static
const
int64_t
DEFAULT_NEED_PRINT_INTERVAL_US
=
120
*
1000
*
1000
;
private:
static
const
int64_t
DEFAULT_CHECK_SWITCH_INTERVAL_US
=
100
*
1000
;
static
const
int64_t
MAX_CHECK_SWITCH_INTERVAL_US
=
3
*
1000
*
1000
;
...
...
@@ -265,6 +271,12 @@ public:
ret
=
common
::
OB_ERR_UNEXPECTED
;
TRANS_LOG
(
ERROR
,
"ha gts source is null"
,
KR
(
ret
),
K
(
gts_tenant_info
));
}
else
{
if
(
common
::
ObClockGenerator
::
getClock
()
-
ts_source_info
->
get_last_obtain_switch_ts
()
>=
ObTsSourceInfo
::
DEFAULT_NEED_PRINT_INTERVAL_US
)
{
if
(
EXECUTE_COUNT_PER_SEC
(
5
))
{
TRANS_LOG
(
WARN
,
"gts source maybe need delete"
,
K
(
gts_tenant_info
),
K
(
*
ts_source_info
));
}
}
if
(
OB_FAIL
(
gts_source
->
refresh_gts
(
false
)))
{
if
(
EXECUTE_COUNT_PER_SEC
(
1
))
{
TRANS_LOG
(
WARN
,
"refresh gts failed"
,
KR
(
ret
),
K
(
gts_tenant_info
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录