Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
59c49b6a
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,发现更多精彩内容 >>
提交
59c49b6a
编写于
8月 20, 2021
作者:
Y
yy0
提交者:
wangzelin.wzl
8月 20, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[clog] fix restart fail due to overwriting OB_DESRRIALIZE_ERROR with OB_INVALID_DATA
上级
7dc47e8e
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
29 addition
and
16 deletion
+29
-16
src/clog/ob_raw_entry_iterator.h
src/clog/ob_raw_entry_iterator.h
+29
-16
未找到文件。
src/clog/ob_raw_entry_iterator.h
浏览文件 @
59c49b6a
...
@@ -485,9 +485,14 @@ int ObRawEntryIterator<Type, Interface>::get_next_entry_(
...
@@ -485,9 +485,14 @@ int ObRawEntryIterator<Type, Interface>::get_next_entry_(
int64_t
uncompress_len
=
0
;
int64_t
uncompress_len
=
0
;
if
(
OB_FAIL
(
if
(
OB_FAIL
(
uncompress
(
buf_cur_
,
buf_size
,
compress_rbuf_
.
buf_
,
compress_rbuf_
.
buf_len_
,
uncompress_len
,
pos
)))
{
uncompress
(
buf_cur_
,
buf_size
,
compress_rbuf_
.
buf_
,
compress_rbuf_
.
buf_len_
,
uncompress_len
,
pos
)))
{
CLOG_LOG
(
CLOG_LOG
(
WARN
,
WARN
,
"failed to uncompress, ret will be overwrite with OB_INVALID_DATA"
,
K
(
ret
),
K
(
param
),
K
(
buf_size
));
"failed to uncompress, ret will be overwrite with OB_INVALID_DATA if not OB_DESERIALIZE_ERROR"
,
K
(
ret
),
K
(
param
),
K
(
buf_size
));
if
(
common
::
OB_DESERIALIZE_ERROR
!=
ret
)
{
ret
=
OB_INVALID_DATA
;
ret
=
OB_INVALID_DATA
;
}
}
else
if
(
OB_FAIL
(
entry
.
deserialize
(
compress_rbuf_
.
buf_
,
uncompress_len
,
local_pos
)))
{
}
else
if
(
OB_FAIL
(
entry
.
deserialize
(
compress_rbuf_
.
buf_
,
uncompress_len
,
local_pos
)))
{
if
(
common
::
OB_DESERIALIZE_ERROR
==
ret
)
{
if
(
common
::
OB_DESERIALIZE_ERROR
==
ret
)
{
ret
=
common
::
OB_INVALID_DATA
;
ret
=
common
::
OB_INVALID_DATA
;
...
@@ -714,9 +719,6 @@ bool ObRawEntryIterator<Type, Interface>::check_last_block_(
...
@@ -714,9 +719,6 @@ bool ObRawEntryIterator<Type, Interface>::check_last_block_(
ObReadParam
param
;
ObReadParam
param
;
ObReadRes
res
;
ObReadRes
res
;
int16_t
magic
=
0
;
int64_t
m_pos
=
0
;
int64_t
pos
=
0
;
ObReadBufGuard
guard
(
common
::
ObModIds
::
OB_LOG_DIRECT_READER_ITER_ID
);
ObReadBufGuard
guard
(
common
::
ObModIds
::
OB_LOG_DIRECT_READER_ITER_ID
);
ObReadBuf
&
rbuf
=
guard
.
get_read_buf
();
ObReadBuf
&
rbuf
=
guard
.
get_read_buf
();
...
@@ -737,22 +739,33 @@ bool ObRawEntryIterator<Type, Interface>::check_last_block_(
...
@@ -737,22 +739,33 @@ bool ObRawEntryIterator<Type, Interface>::check_last_block_(
}
else
{
}
else
{
for
(
int64_t
index
=
0
;
OB_SUCC
(
ret
)
&&
index
<
res
.
data_len_
-
CLOG_DIO_ALIGN_SIZE
;
index
++
)
{
for
(
int64_t
index
=
0
;
OB_SUCC
(
ret
)
&&
index
<
res
.
data_len_
-
CLOG_DIO_ALIGN_SIZE
;
index
++
)
{
meta
.
reset
();
meta
.
reset
();
pos
=
0
;
int64_t
magic_pos
=
0
;
magic
=
0
;
int16_t
magic_value
=
0
;
m_pos
=
0
;
int64_t
pos
=
0
;
if
(
OB_FAIL
(
common
::
serialization
::
decode_i16
(
res
.
buf_
,
sizeof
(
int16_t
),
m_pos
,
&
magic
)))
{
const
int64_t
data_len
=
res
.
data_len_
-
index
;
CLOG_LOG
(
ERROR
,
"decode magic failed"
,
K
(
ret
),
K
(
res
),
K
(
m_pos
),
K
(
magic
));
const
char
*
buf
=
res
.
buf_
+
index
;
}
else
if
(
!
ObLogBlockMetaV2
::
check_magic_number
(
magic
))
{
if
(
OB_FAIL
(
common
::
serialization
::
decode_i16
(
buf
,
data_len
,
magic_pos
,
&
magic_value
)))
{
CLOG_LOG
(
ERROR
,
"decode magic failed"
,
K
(
ret
),
K
(
res
),
K
(
magic_pos
),
K
(
magic_value
));
}
else
if
(
!
ObLogBlockMetaV2
::
check_magic_number
(
magic_value
))
{
// otherwise skip
// otherwise skip
continue
;
continue
;
}
else
if
(
OB_FAIL
(
meta
.
deserialize
(
res
.
buf_
,
res
.
data_len_
,
pos
)))
{
}
else
if
(
OB_FAIL
(
meta
.
deserialize
(
buf
,
data_len
,
pos
)))
{
CLOG_LOG
(
ERROR
,
"meta deserialize failed"
,
K
(
param
),
K
(
ret
));
CLOG_LOG
(
ERROR
,
"meta deserialize failed"
,
K
(
param
),
K
(
file_id
),
K
(
start_offset
),
K
(
last_block_ts
),
K
(
ret
));
}
else
if
(
!
meta
.
check_meta_checksum
())
{
}
else
if
(
!
meta
.
check_meta_checksum
())
{
continue
;
continue
;
}
else
if
(
meta
.
get_timestamp
()
>
last_block_ts
)
{
}
else
if
(
meta
.
get_timestamp
()
>
last_block_ts
)
{
ret
=
common
::
OB_ERR_UNEXPECTED
;
ret
=
common
::
OB_ERR_UNEXPECTED
;
CLOG_LOG
(
CLOG_LOG
(
ERROR
,
ERROR
,
"check last block failed"
,
K
(
ret
),
K
(
last_block_ts
),
"meta timestamp"
,
meta
.
get_timestamp
());
"check last block failed"
,
K
(
ret
),
K
(
file_id
),
K
(
start_offset
),
K
(
last_block_ts
),
"meta timestamp"
,
meta
.
get_timestamp
(),
K
(
param
),
K
(
index
),
K
(
res
));
}
else
{
}
else
{
// do nothing
// do nothing
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录