Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
730345ee
O
oceanbase
项目概览
clmforever
/
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,发现更多精彩内容 >>
提交
730345ee
编写于
3月 03, 2023
作者:
O
obdev
提交者:
ob-robot
3月 03, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the problem of losing extra info in the case of multiple 2.0 protocol packages
上级
bfbe2f86
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
63 addition
and
5 deletion
+63
-5
deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.cpp
deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.cpp
+23
-2
deps/oblib/src/rpc/obmysql/ob_mysql_packet.cpp
deps/oblib/src/rpc/obmysql/ob_mysql_packet.cpp
+24
-0
deps/oblib/src/rpc/obmysql/ob_mysql_packet.h
deps/oblib/src/rpc/obmysql/ob_mysql_packet.h
+7
-1
deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h
deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h
+9
-2
未找到文件。
deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.cpp
浏览文件 @
730345ee
...
...
@@ -397,6 +397,18 @@ inline int Ob20ProtocolProcessor::process_ob20_packet(ObProto20PktContext& conte
mysql_data_size
,
ipacket
,
need_decode_more
)))
{
LOG_ERROR
(
"fail to process fragment mysql packet"
,
KP
(
mysql_data_start
),
K
(
mysql_data_size
),
K
(
need_decode_more
),
K
(
ret
));
}
else
if
(
!
context
.
extra_info_
.
exist_extra_info
()
&&
pkt20
->
get_extra_info
().
exist_extra_info
())
{
char
*
tmp_buffer
=
NULL
;
int64_t
total_len
=
pkt20
->
get_extra_info
().
get_total_len
();
if
(
OB_ISNULL
(
tmp_buffer
=
reinterpret_cast
<
char
*>
(
context
.
arena_
.
alloc
(
total_len
))))
{
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
LOG_ERROR
(
"no memory available"
,
"alloc_size"
,
total_len
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
context
.
extra_info_
.
assign
(
pkt20
->
get_extra_info
(),
tmp_buffer
,
total_len
)))
{
LOG_ERROR
(
"failed to deep copy extra info"
,
K
(
ret
));
}
}
else
{
// do nothing
}
if
(
OB_FAIL
(
ret
))
{
...
...
@@ -415,7 +427,16 @@ inline int Ob20ProtocolProcessor::process_ob20_packet(ObProto20PktContext& conte
ObMySQLRawPacket
*
input_packet
=
reinterpret_cast
<
ObMySQLRawPacket
*>
(
ipacket
);
input_packet
->
set_can_reroute_pkt
(
pkt20
->
get_flags
().
is_proxy_reroute
());
input_packet
->
set_is_weak_read
(
pkt20
->
get_flags
().
is_weak_read
());
input_packet
->
set_extra_info
(
pkt20
->
get_extra_info
());
const
int64_t
t_len
=
context
.
extra_info_
.
get_total_len
();
char
*
t_buffer
=
NULL
;
if
(
OB_ISNULL
(
t_buffer
=
reinterpret_cast
<
char
*>
(
pool
.
alloc
(
t_len
))))
{
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
LOG_ERROR
(
"no memory available"
,
"alloc_size"
,
t_len
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
input_packet
->
extra_info_
.
assign
(
context
.
extra_info_
,
t_buffer
,
t_len
)))
{
LOG_ERROR
(
"failed to assign extra info"
,
K
(
ret
));
}
input_packet
->
set_txn_free_route
(
pkt20
->
get_flags
().
txn_free_route
());
context
.
reset
();
// set again for sending response
...
...
deps/oblib/src/rpc/obmysql/ob_mysql_packet.cpp
浏览文件 @
730345ee
...
...
@@ -177,6 +177,30 @@ int ObMySQLRawPacket::serialize(char *buf, const int64_t length, int64_t &pos) c
return
ret
;
}
int
Ob20ExtraInfo
::
assign
(
const
Ob20ExtraInfo
&
other
,
char
*
buf
,
int64_t
buf_len
)
{
int
ret
=
OB_SUCCESS
;
uint64_t
total_len
=
other
.
get_total_len
();
if
(
total_len
>
buf_len
)
{
ret
=
OB_ERR_UNEXPECTED
;
SERVER_LOG
(
ERROR
,
"invalid alloc size"
,
K
(
total_len
),
K
(
ret
));
}
else
{
uint64_t
len
=
0
;
MEMCPY
(
buf
+
len
,
other
.
trace_info_
.
ptr
(),
other
.
trace_info_
.
length
());
trace_info_
.
assign_ptr
(
buf
+
len
,
other
.
trace_info_
.
length
());
len
+=
other
.
trace_info_
.
length
();
MEMCPY
(
buf
+
len
,
other
.
sync_sess_info_
.
ptr
(),
other
.
sync_sess_info_
.
length
());
sync_sess_info_
.
assign_ptr
(
buf
+
len
,
other
.
sync_sess_info_
.
length
());
len
+=
other
.
sync_sess_info_
.
length
();
MEMCPY
(
buf
+
len
,
other
.
full_link_trace_
.
ptr
(),
other
.
full_link_trace_
.
length
());
full_link_trace_
.
assign_ptr
(
buf
+
len
,
other
.
full_link_trace_
.
length
());
len
+=
other
.
full_link_trace_
.
length
();
}
return
ret
;
}
char
const
*
get_info_func_name
(
const
ObInformationFunctions
func
)
{
const
char
*
str
=
NULL
;
...
...
deps/oblib/src/rpc/obmysql/ob_mysql_packet.h
浏览文件 @
730345ee
...
...
@@ -360,6 +360,11 @@ public:
bool
exist_full_link_trace
()
const
{
return
!
full_link_trace_
.
empty
();
}
const
ObString
&
get_sync_sess_info
()
const
{
return
sync_sess_info_
;
}
const
ObString
&
get_full_link_trace
()
const
{
return
full_link_trace_
;
}
bool
exist_extra_info
()
{
return
!
sync_sess_info_
.
empty
()
||
!
full_link_trace_
.
empty
()
||
exist_trace_info_
;}
bool
exist_extra_info
()
const
{
return
!
sync_sess_info_
.
empty
()
||
!
full_link_trace_
.
empty
()
||
exist_trace_info_
;}
int
assign
(
const
Ob20ExtraInfo
&
other
,
char
*
buf
,
int64_t
len
);
int64_t
get_total_len
()
{
return
trace_info_
.
length
()
+
sync_sess_info_
.
length
()
+
full_link_trace_
.
length
();}
int64_t
get_total_len
()
const
{
return
trace_info_
.
length
()
+
sync_sess_info_
.
length
()
+
full_link_trace_
.
length
();}
TO_STRING_KV
(
K_
(
extra_len
),
K_
(
exist_trace_info
),
K_
(
trace_info
),
K_
(
sync_sess_info
),
K_
(
full_link_trace
));
};
...
...
@@ -511,9 +516,9 @@ public:
inline
void
set_txn_free_route
(
const
bool
txn_free_route
);
inline
bool
txn_free_route
()
const
;
inline
void
set_extra_info
(
const
Ob20ExtraInfo
&
extra_info
)
{
extra_info_
=
extra_info
;
}
inline
const
Ob20ExtraInfo
&
get_extra_info
()
const
{
return
extra_info_
;
}
bool
exist_trace_info
()
const
{
return
extra_info_
.
exist_trace_info_
;
}
bool
exist_extra_info
()
const
{
return
extra_info_
.
exist_extra_info
();
}
const
common
::
ObString
&
get_trace_info
()
const
{
return
extra_info_
.
trace_info_
;
}
virtual
int64_t
get_serialize_size
()
const
;
...
...
@@ -547,6 +552,7 @@ private:
bool
can_reroute_pkt_
;
bool
is_weak_read_
;
bool
txn_free_route_
;
public:
Ob20ExtraInfo
extra_info_
;
};
...
...
deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h
浏览文件 @
730345ee
...
...
@@ -137,7 +137,7 @@ private:
class
ObProto20PktContext
{
public:
ObProto20PktContext
()
{
reset
();
}
ObProto20PktContext
()
:
arena_
(
common
::
ObModIds
::
LIB_MULTI_PACKETS
)
{
reset
();
}
~
ObProto20PktContext
()
{
}
void
reset
()
{
...
...
@@ -145,18 +145,25 @@ public:
is_multi_pkt_
=
false
;
proto20_last_request_id_
=
0
;
proto20_last_pkt_seq_
=
0
;
extra_info_
.
reset
();
arena_
.
reset
();
//fast free memory
}
TO_STRING_KV
(
K_
(
comp_last_pkt_seq
),
K_
(
is_multi_pkt
),
K_
(
proto20_last_request_id
),
K_
(
proto20_last_pkt_seq
));
K_
(
proto20_last_pkt_seq
),
K_
(
extra_info
),
"used"
,
arena_
.
used
(),
"total"
,
arena_
.
total
());
public:
uint8_t
comp_last_pkt_seq_
;
bool
is_multi_pkt_
;
uint32_t
proto20_last_request_id_
;
uint8_t
proto20_last_pkt_seq_
;
Ob20ExtraInfo
extra_info_
;
common
::
ObArenaAllocator
arena_
;
private:
DISALLOW_COPY_AND_ASSIGN
(
ObProto20PktContext
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录