Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
b79fb0ac
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看板
提交
b79fb0ac
编写于
4月 25, 2022
作者:
H
hiddenbomb
提交者:
wangzelin.wzl
4月 25, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] optimize slog replay info output
上级
25b3b3ff
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
2 deletion
+31
-2
src/storage/blocksstable/slog/ob_storage_log_replayer.cpp
src/storage/blocksstable/slog/ob_storage_log_replayer.cpp
+30
-2
src/storage/ob_partition_log.h
src/storage/ob_partition_log.h
+1
-0
未找到文件。
src/storage/blocksstable/slog/ob_storage_log_replayer.cpp
浏览文件 @
b79fb0ac
...
...
@@ -16,6 +16,7 @@
#include "share/redolog/ob_log_store_factory.h"
#include "storage/blocksstable/slog/ob_storage_log_reader.h"
#include "storage/ob_file_system_router.h"
#include "storage/ob_partition_log.h"
namespace
oceanbase
{
using
namespace
common
;
...
...
@@ -450,7 +451,7 @@ int ObStorageLogReplayer::replay_after_ckpt(
replay_start_cursor
.
log_id_
>
0
?
replay_start_cursor
.
log_id_
-
1
:
0
)))
{
LOG_WARN
(
"Fail to init log_reader, "
,
K
(
ret
));
}
else
{
LogCommand
cmd
=
common
::
OB_LOG_UNKNOWN
;
LogCommand
cmd
=
common
::
LogCommand
::
OB_LOG_UNKNOWN
;
uint64_t
entry_seq
=
0
;
ObBaseStorageLogHeader
log_header
;
char
*
log_data
=
NULL
;
...
...
@@ -463,6 +464,8 @@ int ObStorageLogReplayer::replay_after_ckpt(
ObLogCursor
curr_cursor
;
int64_t
replay_cost
[
OB_REDO_LOG_MAX
]
=
{
0
};
int64_t
replay_cnt
[
OB_REDO_LOG_MAX
]
=
{
0
};
int64_t
partition_replay_cost
[
ObPartitionRedoLogSubcmd
::
REDO_LOG_MAX
]
=
{
0
};
int64_t
partition_replay_cnt
[
ObPartitionRedoLogSubcmd
::
REDO_LOG_MAX
]
=
{
0
};
int64_t
replay_start_time
=
0
;
while
(
OB_SUCC
(
ret
)
&&
OB_SUCC
(
slog_reader
.
read_log
(
cmd
,
entry_seq
,
log_data
,
data_len
)))
{
...
...
@@ -525,8 +528,19 @@ int ObStorageLogReplayer::replay_after_ckpt(
K
(
log_buffer
.
capacity
()),
K
(
data_len
));
}
replay_cost
[
main_type
]
+=
ObTimeUtility
::
current_time
()
-
replay_start_time
;
static
const
int64_t
REPLAY_COST_THRESHOLD_US
=
10
*
1000
;
// 10ms
const
int64_t
gap
=
ObTimeUtility
::
current_time
()
-
replay_start_time
;
replay_cost
[
main_type
]
+=
gap
;
replay_cnt
[
main_type
]
++
;
if
(
ObRedoLogMainType
::
OB_REDO_LOG_PARTITION
==
main_type
)
{
partition_replay_cost
[
sub_type
]
+=
gap
;
partition_replay_cnt
[
sub_type
]
++
;
}
if
(
gap
>
REPLAY_COST_THRESHOLD_US
)
{
LOG_INFO
(
"replaying slog costs too much time"
,
K
(
ret
),
K
(
gap
),
K
(
main_type
),
K
(
sub_type
),
K
(
replay_param
));
}
}
}
// while log_buffer.read_log
...
...
@@ -564,6 +578,20 @@ int ObStorageLogReplayer::replay_after_ckpt(
replay_cnt
[
OB_REDO_LOG_TENANT_FILE
],
"tenant file log cost"
,
replay_cost
[
OB_REDO_LOG_TENANT_FILE
]);
for
(
int
i
=
0
;
i
<
ObPartitionRedoLogSubcmd
::
REDO_LOG_MAX
;
++
i
)
{
if
(
partition_replay_cnt
[
i
]
!=
0
)
{
double
avg_cost
=
partition_replay_cost
[
i
]
*
1.0
/
partition_replay_cnt
[
i
];
FLOG_INFO
(
"print partition replay cost and cnt"
,
"sub type"
,
static_cast
<
ObPartitionRedoLogSubcmd
>
(
i
),
"total cost"
,
partition_replay_cost
[
i
],
"total cnt"
,
partition_replay_cnt
[
i
],
"avg cost per log"
,
avg_cost
);
}
}
}
if
(
OB_SUCC
(
ret
))
{
...
...
src/storage/ob_partition_log.h
浏览文件 @
b79fb0ac
...
...
@@ -79,6 +79,7 @@ enum ObPartitionRedoLogSubcmd {
// DATE: 2020-09-21 (since 2.2.70)
REDO_LOG_ADD_RECOVERY_POINT_DATA
=
38
,
REDO_LOG_REMOVE_RECOVERY_POINT_DATA
=
39
,
REDO_LOG_MAX
=
40
};
struct
ObBeginTransLogEntry
:
public
blocksstable
::
ObIBaseStorageLogEntry
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录