Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
44f28e92
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
44f28e92
编写于
9月 22, 2021
作者:
H
hiddenbomb
提交者:
wangzelin.wzl
9月 22, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix aio check logic error
上级
150a34cc
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
19 addition
and
12 deletion
+19
-12
src/share/redolog/ob_log_file_store.cpp
src/share/redolog/ob_log_file_store.cpp
+19
-12
未找到文件。
src/share/redolog/ob_log_file_store.cpp
浏览文件 @
44f28e92
...
@@ -462,12 +462,15 @@ int ObLogFileStore::read(void* buf, int64_t count, int64_t offset, int64_t& read
...
@@ -462,12 +462,15 @@ int ObLogFileStore::read(void* buf, int64_t count, int64_t offset, int64_t& read
}
else
{
}
else
{
aio_ret
=
static_cast
<
int
>
(
io_events_
[
0
].
res2
);
aio_ret
=
static_cast
<
int
>
(
io_events_
[
0
].
res2
);
event_res
=
static_cast
<
int64_t
>
(
io_events_
[
0
].
res
);
event_res
=
static_cast
<
int64_t
>
(
io_events_
[
0
].
res
);
if
(
0
==
aio_ret
&&
event_res
==
rd_size
)
{
// full complete
if
(
OB_UNLIKELY
(
0
!=
aio_ret
))
{
// res2 should always be 0
ret
=
OB_IO_ERROR
;
COMMON_LOG
(
WARN
,
"aio error"
,
K
(
i
),
K
(
event_res
),
K
(
ret
),
K
(
aio_ret
));
}
else
if
(
event_res
==
rd_size
)
{
// full complete
event_sz
+=
rd_size
;
event_sz
+=
rd_size
;
}
else
if
(
0
==
aio_ret
&&
event_res
==
0
)
{
// read nothing from file
}
else
if
(
event_res
==
0
)
{
// read nothing from file
ret
=
OB_READ_NOTHING
;
ret
=
OB_READ_NOTHING
;
}
else
if
(
0
==
aio_ret
&&
event_res
>
0
&&
event_res
<
rd_size
&&
}
else
if
(
event_res
>
0
&&
event_res
<
rd_size
&&
(
0
==
event_res
%
DIO_ALIGN_SIZE
))
{
// partial complete
(
0
==
event_res
%
DIO_ALIGN_SIZE
))
{
// partial complete
event_sz
+=
event_res
;
event_sz
+=
event_res
;
COMMON_LOG
(
INFO
,
"re-submit read"
,
K
(
i
),
K
(
event_res
),
K
(
rd_size
),
K
(
event_sz
),
K
(
count
));
COMMON_LOG
(
INFO
,
"re-submit read"
,
K
(
i
),
K
(
event_res
),
K
(
rd_size
),
K
(
event_sz
),
K
(
count
));
}
else
{
}
else
{
...
@@ -996,11 +999,15 @@ int ObLogFileStore::process_io_getevents(int64_t& submitted, io_context_t ctx, s
...
@@ -996,11 +999,15 @@ int ObLogFileStore::process_io_getevents(int64_t& submitted, io_context_t ctx, s
for
(
int32_t
i
=
0
;
i
<
gotten
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
gotten
;
i
++
)
{
aio_ret
=
static_cast
<
int
>
(
events
[
i
].
res2
);
aio_ret
=
static_cast
<
int
>
(
events
[
i
].
res2
);
event_res
=
static_cast
<
int64_t
>
(
events
[
i
].
res
);
event_res
=
static_cast
<
int64_t
>
(
events
[
i
].
res
);
wr_info
=
reinterpret_cast
<
ObLogFileIOInfo
*>
(
events
[
i
].
data
);
wr_info
=
reinterpret_cast
<
ObLogFileIOInfo
*>
(
events
[
i
].
data
);
if
(
0
==
aio_ret
&&
event_res
==
wr_info
->
size_
)
{
// full complete
if
(
OB_UNLIKELY
(
0
!=
aio_ret
))
{
// res2 should always be 0
ret
=
OB_IO_ERROR
;
COMMON_LOG
(
WARN
,
"aio error"
,
K
(
ret
),
K
(
wr_info
->
ret_
),
K
(
i
),
K
(
event_res
),
K
(
*
wr_info
),
K
(
aio_ret
));
}
else
if
(
event_res
==
wr_info
->
size_
)
{
// full complete
wr_info
->
complete_
=
true
;
wr_info
->
complete_
=
true
;
wr_info
->
ret_
=
OB_SUCCESS
;
wr_info
->
ret_
=
OB_SUCCESS
;
}
else
if
(
0
==
aio_ret
&&
event_res
>
0
&&
event_res
<
wr_info
->
size_
&&
}
else
if
(
event_res
>
0
&&
event_res
<
wr_info
->
size_
&&
(
0
==
event_res
%
DIO_ALIGN_SIZE
))
{
// partial complete
(
0
==
event_res
%
DIO_ALIGN_SIZE
))
{
// partial complete
wr_info
->
buf_
=
wr_info
->
buf_
+
event_res
;
wr_info
->
buf_
=
wr_info
->
buf_
+
event_res
;
wr_info
->
size_
-=
event_res
;
wr_info
->
size_
-=
event_res
;
...
@@ -1010,11 +1017,11 @@ int ObLogFileStore::process_io_getevents(int64_t& submitted, io_context_t ctx, s
...
@@ -1010,11 +1017,11 @@ int ObLogFileStore::process_io_getevents(int64_t& submitted, io_context_t ctx, s
partial_write
=
true
;
partial_write
=
true
;
COMMON_LOG
(
WARN
,
"re-submit"
,
K
(
wr_info
->
ret_
),
K
(
i
),
K
(
event_res
),
K
(
*
wr_info
));
COMMON_LOG
(
WARN
,
"re-submit"
,
K
(
wr_info
->
ret_
),
K
(
i
),
K
(
event_res
),
K
(
*
wr_info
));
}
else
{
// fail write, check if can retry
}
else
{
// fail write, check if can retry
wr_info
->
complete_
=
(
-
EAGAIN
!=
aio_ret
);
wr_info
->
complete_
=
(
-
EAGAIN
!=
event_res
);
wr_info
->
ret_
=
(
-
EAGAIN
==
aio_ret
)
?
OB_EAGAIN
wr_info
->
ret_
=
(
-
EAGAIN
==
event_res
)
?
OB_EAGAIN
:
(
-
ENOSPC
==
aio_ret
)
?
OB_CS_OUTOF_DISK_SPACE
:
(
-
ENOSPC
==
event_res
)
?
OB_CS_OUTOF_DISK_SPACE
:
OB_IO_ERROR
;
:
OB_IO_ERROR
;
partial_write
=
(
-
EAGAIN
==
aio_ret
)
?
true
:
partial_write
;
partial_write
=
(
-
EAGAIN
==
event_res
)
?
true
:
partial_write
;
COMMON_LOG
(
WARN
,
"write error"
,
K
(
wr_info
->
ret_
),
K
(
i
),
K
(
event_res
),
K
(
*
wr_info
),
K
(
aio_ret
));
COMMON_LOG
(
WARN
,
"write error"
,
K
(
wr_info
->
ret_
),
K
(
i
),
K
(
event_res
),
K
(
*
wr_info
),
K
(
aio_ret
));
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录