Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
5df0c708
O
oceanbase
项目概览
oceanbase
/
oceanbase
8 个月 前同步成功
通知
260
Star
6084
Fork
1301
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
提交
5df0c708
编写于
1月 04, 2022
作者:
H
hiddenbomb
提交者:
LINGuanRen
1月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check disk warning state if io get events time out in loop
上级
baa96708
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
24 deletion
+34
-24
src/share/redolog/ob_log_file_store.cpp
src/share/redolog/ob_log_file_store.cpp
+33
-23
src/share/redolog/ob_log_file_store.h
src/share/redolog/ob_log_file_store.h
+1
-1
未找到文件。
src/share/redolog/ob_log_file_store.cpp
浏览文件 @
5df0c708
...
...
@@ -389,7 +389,7 @@ int ObLogFileStore::write(void* buf, int64_t count, int64_t offset)
}
else
if
(
OB_FAIL
(
prepare_write_info
(
buf
,
count
,
offset
)))
{
COMMON_LOG
(
ERROR
,
"prepare io info fail"
,
K
(
ret
));
}
else
{
const
int64_t
write_begin_ts
=
common
::
ObTimeUtility
::
fast_current_time
();
int64_t
write_begin_ts
=
common
::
ObTimeUtility
::
fast_current_time
();
while
(
need_retry
)
{
ret
=
OB_SUCCESS
;
new_req_cnt
=
0
;
...
...
@@ -400,18 +400,17 @@ int ObLogFileStore::write(void* buf, int64_t count, int64_t offset)
}
else
if
(
OB_FAIL
(
process_io_getevents
(
submitted
,
io_ctx_
,
io_events_
)))
{
COMMON_LOG
(
ERROR
,
"process get events fail"
,
K
(
ret
),
K
(
new_req_cnt
),
K
(
submitted
),
K
(
retry_cnt
),
K_
(
write_fd
));
}
const
int64_t
write_end_ts
=
common
::
ObTimeUtility
::
fast_current_time
();
if
(
OB_SUCC
(
ret
))
{
if
(
is_disk_warning
())
{
set_disk_warning
(
false
);
}
}
else
if
(
!
is_disk_warning
())
{
const
int64_t
write_finish_ts
=
common
::
ObTimeUtility
::
fast_current_time
();
const
int64_t
log_write_timeout_us
=
GCONF
.
data_storage_warning_tolerance_time
;
if
(
write_finish_ts
-
write_begin_ts
>
log_write_timeout_us
)
{
set_disk_warning
(
true
);
}
}
else
{
check_disk_warning
(
write_begin_ts
,
write_end_ts
);
}
need_retry
=
process_retry
(
ret
,
retry_cnt
);
write_begin_ts
=
write_end_ts
;
}
// whatever success or failure, reset write requests, check and mark bad disk
...
...
@@ -990,24 +989,23 @@ int ObLogFileStore::process_io_getevents(int64_t& submitted, io_context_t ctx, s
int
gotten
=
0
;
struct
timespec
timeout
;
const
int64_t
begin_ts
=
common
::
ObTimeUtility
::
fast_current_time
();
while
(
submitted
>
0
&&
OB_SUCC
(
ret
)
&&
!
partial_write
)
{
timeout
.
tv_sec
=
(
OB_REDO_TYPE_CLOG
==
log_type_
?
CLOG_AIO_TIMEOUT_SECOND
:
AIO_TIMEOUT_SECOND
)
;
timeout
.
tv_sec
=
AIO_TIMEOUT_SECOND
;
timeout
.
tv_nsec
=
0
;
if
(
0
>=
(
gotten
=
ob_io_getevents
(
ctx
,
1
,
submitted
,
events
,
&
timeout
)))
{
// timeout or io error
if
(
0
==
gotten
)
{
COMMON_LOG
(
WARN
,
"io_getevents timeout"
,
K
(
ret
),
K
(
gotten
),
K
(
submitted
),
K
(
write_fd_
.
file_id_
),
LITERAL_K
(
AIO_TIMEOUT_SECOND
));
}
else
{
ret
=
OB_IO_ERROR
;
COMMON_LOG
(
ERROR
,
"io_getevents fail"
,
K
(
ret
),
K
(
gotten
),
K
(
submitted
),
K
(
write_fd_
.
file_id_
),
K
(
errno
),
KERRMSG
);
}
gotten
=
ob_io_getevents
(
ctx
,
1
,
submitted
,
events
,
&
timeout
);
if
(
0
==
gotten
)
{
COMMON_LOG
(
WARN
,
"io_getevents timeout"
,
K
(
ret
),
K
(
gotten
),
K
(
submitted
),
K
(
write_fd_
.
file_id_
),
K
(
timeout
.
tv_sec
),
K
(
timeout
.
tv_nsec
));
}
else
if
(
gotten
<
0
)
{
ret
=
OB_IO_ERROR
;
COMMON_LOG
(
ERROR
,
"io_getevents fail"
,
K
(
ret
),
K
(
gotten
),
K
(
submitted
),
K
(
write_fd_
.
file_id_
),
K
(
errno
),
KERRMSG
);
}
else
{
submitted
-=
gotten
;
for
(
int32_t
i
=
0
;
i
<
gotten
;
i
++
)
{
...
...
@@ -1039,6 +1037,11 @@ int ObLogFileStore::process_io_getevents(int64_t& submitted, io_context_t ctx, s
}
}
}
if
(
OB_SUCC
(
ret
))
{
const
int64_t
end_ts
=
common
::
ObTimeUtility
::
fast_current_time
();
check_disk_warning
(
begin_ts
,
end_ts
);
}
}
return
ret
;
...
...
@@ -1103,5 +1106,12 @@ int ObLogFileStore::process_failed_write()
}
return
ret
;
}
void
ObLogFileStore
::
check_disk_warning
(
const
int64_t
begin_ts
,
const
int64_t
end_ts
)
{
if
(
!
is_disk_warning
()
&&
end_ts
-
begin_ts
>
GCONF
.
data_storage_warning_tolerance_time
)
{
set_disk_warning
(
true
);
}
}
}
// namespace common
}
// namespace oceanbase
src/share/redolog/ob_log_file_store.h
浏览文件 @
5df0c708
...
...
@@ -182,7 +182,6 @@ public:
protected:
static
const
int
MAX_IO_COUNT
=
1024
;
static
const
int64_t
AIO_TIMEOUT_SECOND
=
30
;
static
const
int64_t
CLOG_AIO_TIMEOUT_SECOND
=
300
;
static
const
int64_t
AIO_RETRY_INTERVAL_US
=
100
*
1000
;
// 100ms
static
const
int64_t
MAX_DISK_COUNT
=
ObLogDiskManager
::
MAX_DISK_COUNT
;
static
const
int64_t
MAX_IO_RETRY
=
LLONG_MAX
;
...
...
@@ -283,6 +282,7 @@ private:
bool
process_retry
(
const
int
result
,
int64_t
&
retry
);
int
process_failed_write
();
int
fstat
(
const
int64_t
file_id
,
struct
stat
*
file_stat
)
const
;
void
check_disk_warning
(
const
int64_t
begin_ts
,
const
int64_t
end_ts
);
private:
bool
is_inited_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录