Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
90cb52ce
O
oceanbase
项目概览
大炮V587
/
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,发现更多精彩内容 >>
提交
90cb52ce
编写于
3月 06, 2023
作者:
O
obdev
提交者:
ob-robot
3月 06, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change barrier type for medium clog
上级
bbf81bb5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
29 deletion
+30
-29
src/storage/compaction/ob_compaction_diagnose.cpp
src/storage/compaction/ob_compaction_diagnose.cpp
+24
-25
src/storage/compaction/ob_medium_compaction_func.cpp
src/storage/compaction/ob_medium_compaction_func.cpp
+2
-2
src/storage/compaction/ob_medium_compaction_mgr.cpp
src/storage/compaction/ob_medium_compaction_mgr.cpp
+3
-1
src/storage/compaction/ob_tenant_tablet_scheduler.h
src/storage/compaction/ob_tenant_tablet_scheduler.h
+1
-1
未找到文件。
src/storage/compaction/ob_compaction_diagnose.cpp
浏览文件 @
90cb52ce
...
...
@@ -378,7 +378,7 @@ int ObCompactionDiagnoseMgr::diagnose_tenant_tablet()
int
tmp_ret
=
OB_SUCCESS
;
bool
diagnose_major_flag
=
false
;
ObTenantTabletScheduler
*
scheduler
=
MTL
(
ObTenantTabletScheduler
*
);
int64_t
compaction_scn
=
scheduler
->
get_frozen_version
(
);
int64_t
compaction_scn
=
MAX
(
scheduler
->
get_frozen_version
(),
MTL
(
ObTenantFreezeInfoMgr
*
)
->
get_latest_frozen_version
()
);
ObTenantFreezeInfoMgr
::
FreezeInfo
freeze_info
;
if
(
compaction_scn
>
scheduler
->
get_merged_version
())
{
// check major merge
...
...
@@ -422,7 +422,7 @@ int ObCompactionDiagnoseMgr::diagnose_tenant_tablet()
}
}
while
(
OB_SUCC
(
ret
))
{
// loop all log_stream
while
(
OB_SUCC
(
ret
)
&&
can_add_diagnose_info
()
)
{
// loop all log_stream
bool
need_merge
=
false
;
if
(
OB_FAIL
(
ls_iter_guard
.
get_ptr
()
->
get_next
(
ls
)))
{
if
(
OB_ITER_END
!=
ret
)
{
...
...
@@ -470,7 +470,7 @@ int ObCompactionDiagnoseMgr::diagnose_tenant_tablet()
LOG_WARN
(
"failed to build ls tablet iter"
,
K
(
ret
),
K
(
ls
));
}
else
{
ObTabletHandle
tablet_handle
;
while
(
OB_SUCC
(
ret
))
{
// loop all tablets in ls
while
(
OB_SUCC
(
ret
)
&&
can_add_diagnose_info
()
)
{
// loop all tablets in ls
if
(
OB_FAIL
(
tablet_iter
.
get_next_tablet
(
tablet_handle
)))
{
if
(
OB_ITER_END
==
ret
)
{
ret
=
OB_SUCCESS
;
...
...
@@ -689,16 +689,15 @@ int ObCompactionDiagnoseMgr::diagnose_tablet_medium_merge(
const
storage
::
ObMergeType
merge_type
=
MEDIUM_MERGE
;
const
ObTabletID
&
tablet_id
=
tablet
.
get_tablet_meta
().
tablet_id_
;
const
int64_t
max_serialized_medium_scn
=
tablet
.
get_tablet_meta
().
max_serialized_medium_scn_
;
const
ObMediumCompactionInfoList
&
medium_list
=
tablet
.
get_medium_compaction_info_list
();
ObITable
*
table
=
tablet
.
get_table_store
().
get_major_sstables
().
get_boundary_table
(
true
/*last*/
);
const
int64_t
wait_check_medium_scn
=
medium_list
.
get_wait_check_medium_scn
();
ObITable
*
last_major
=
tablet
.
get_table_store
().
get_major_sstables
().
get_boundary_table
(
true
/*last*/
);
int64_t
max_sync_medium_scn
=
0
;
if
(
OB_FAIL
(
tablet
.
get_max_sync_medium_scn
(
max_sync_medium_scn
))){
if
(
OB_ISNULL
(
last_major
))
{
}
else
if
(
OB_FAIL
(
tablet
.
get_max_sync_medium_scn
(
max_sync_medium_scn
))){
LOG_WARN
(
"failed to get max sync medium scn"
,
K
(
ret
),
K
(
ls_id
),
K
(
tablet_id
));
}
else
if
(
max_sync_medium_scn
>
max_serialized_medium_scn
)
{
// wait memtable dump
if
(
ObTimeUtility
::
fast_current_time
()
>
max_sync_medium_scn
+
WAIT_MEDIUM_SCHEDULE_INTERVAL
*
2
}
else
if
(
max_sync_medium_scn
>
last_major
->
get_snapshot_version
()
)
{
if
(
tablet
.
get_snapshot_version
()
<
max_sync_medium_scn
)
{
// wait mini compaction or tablet freeze
if
(
ObTimeUtility
::
fast_current_time
()
>
max_sync_medium_scn
+
WAIT_MEDIUM_SCHEDULE_INTERVAL
*
2
&&
can_add_diagnose_info
()
&&
OB_FAIL
(
SET_DIAGNOSE_INFO
(
info_array_
[
idx_
++
],
...
...
@@ -709,20 +708,20 @@ int ObCompactionDiagnoseMgr::diagnose_tablet_medium_merge(
ObCompactionDiagnoseInfo
::
DIA_STATUS_NOT_SCHEDULE
,
ObTimeUtility
::
fast_current_time
(),
"max_receive_medium_scn"
,
max_sync_medium_scn
,
"max_serialized_medium_scn"
,
max_serialized_medium_scn
)))
{
LOG_WARN
(
"failed to add diagnose info"
,
K
(
ret
),
K
(
ls_id
),
K
(
tablet_id
));
}
}
else
if
(
0
==
wait_check_medium_scn
)
{
// do nothing
}
else
if
(
OB_NOT_NULL
(
table
)
&&
table
->
get_snapshot_version
()
<
wait_check_medium_scn
)
{
ObTabletMajorMergeDag
dag
;
if
(
OB_FAIL
(
diagnose_tablet_merge
(
dag
,
merge_type
,
ls
_id
,
tablet_id
,
wait_check_medium_scn
)))
{
LOG_WARN
(
"diagnose failed"
,
K
(
ret
),
K
(
ls_id
),
K
(
tablet_id
),
KPC
(
table
));
"max_serialized_medium_scn"
,
max_serialized_medium_scn
,
"tablet_snapshot"
,
tablet
.
get_snapshot_version
())))
{
LOG_WARN
(
"failed to add diagnose info"
,
K
(
ret
),
K
(
ls_id
),
K
(
tablet_id
));
}
}
else
{
ObTabletMajorMergeDag
dag
;
if
(
OB_FAIL
(
diagnose_tablet_merge
(
dag
,
merge_type
,
ls_id
,
tablet
_id
,
max_sync_medium_scn
)))
{
LOG_WARN
(
"diagnose failed"
,
K
(
ret
),
K
(
ls_id
),
K
(
tablet_id
),
KPC
(
last_major
));
}
}
}
return
ret
;
...
...
@@ -944,7 +943,7 @@ int ObCompactionDiagnoseMgr::diagnose_medium_scn_table(const int64_t compaction_
MTL_ID
(),
ObLSID
(
INT64_MAX
),
ObTabletID
(
INT64_MAX
),
ObCompactionDiagnoseInfo
::
DIA_STATUS_
RUNNING
,
ObCompactionDiagnoseInfo
::
DIA_STATUS_
FAILED
,
ObTimeUtility
::
fast_current_time
(),
"error_tablet_cnt"
,
error_tablet_cnt
)))
{
LOG_WARN
(
"failed to add diagnose info"
,
K
(
ret
));
...
...
src/storage/compaction/ob_medium_compaction_func.cpp
浏览文件 @
90cb52ce
...
...
@@ -323,10 +323,10 @@ int ObMediumCompactionScheduleFunc::decide_medium_snapshot(
if
(
OB_NO_NEED_MERGE
!=
ret
)
{
LOG_WARN
(
"failed to choose medium snapshot"
,
K
(
ret
),
KPC
(
this
));
}
}
else
if
(
is_major
)
{
// do nothing
}
else
if
(
medium_info
.
medium_snapshot_
<=
max_sync_medium_scn
)
{
ret
=
OB_NO_NEED_MERGE
;
}
else
if
(
is_major
)
{
// do nothing
}
else
if
(
OB_FAIL
(
get_max_reserved_snapshot
(
max_reserved_snapshot
)))
{
LOG_WARN
(
"failed to get multi_version_start"
,
K
(
ret
),
KPC
(
this
));
}
else
if
(
medium_info
.
medium_snapshot_
<
max_reserved_snapshot
)
{
...
...
src/storage/compaction/ob_medium_compaction_mgr.cpp
浏览文件 @
90cb52ce
...
...
@@ -236,7 +236,9 @@ int ObTabletMediumCompactionInfoRecorder::prepare_struct_in_lock(
clog_len
=
0
;
const
logservice
::
ObLogBaseHeader
log_header
(
logservice
::
ObLogBaseType
::
MEDIUM_COMPACTION_LOG_BASE_TYPE
,
logservice
::
ObReplayBarrierType
::
PRE_BARRIER
);
logservice
::
ObReplayBarrierType
::
NO_NEED_BARRIER
,
tablet_id_
.
id
());
// record tablet_id as trans_id to make medium clogs of same tablet replay serially
int64_t
pos
=
0
;
char
*
buf
=
nullptr
;
...
...
src/storage/compaction/ob_tenant_tablet_scheduler.h
浏览文件 @
90cb52ce
...
...
@@ -195,7 +195,7 @@ private:
class
MediumLoopTask
:
public
common
::
ObTimerTask
{
public:
MediumLoopTask
()
=
default
;
MediumLoopTask
()
{
disable_timeout_check
();
}
virtual
~
MediumLoopTask
()
=
default
;
virtual
void
runTimerTask
()
override
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录