Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
56782a5d
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
56782a5d
编写于
6月 01, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:open task case & modify mqRebVgReq encode/decode style
上级
bb772e20
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
65 addition
and
35 deletion
+65
-35
include/common/tmsg.h
include/common/tmsg.h
+35
-25
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+16
-3
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+13
-6
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
56782a5d
...
...
@@ -2807,39 +2807,49 @@ typedef struct {
int64_t
suid
;
}
SMqRebVgReq
;
static
FORCE_INLINE
int32_t
tEncodeSMqRebVgReq
(
void
**
buf
,
const
SMqRebVgReq
*
pReq
)
{
int32_t
tlen
=
0
;
tlen
+=
taosEncodeFixedI64
(
buf
,
pReq
->
leftForVer
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pReq
->
vgId
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pReq
->
oldConsumerId
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pReq
->
newConsumerId
);
tlen
+=
taosEncodeString
(
buf
,
pReq
->
subKey
);
tlen
+=
taosEncodeFixedI8
(
buf
,
pReq
->
subType
);
tlen
+=
taosEncodeFixedI8
(
buf
,
pReq
->
withMeta
);
static
FORCE_INLINE
int
tEncodeSMqRebVgReq
(
SEncoder
*
pCoder
,
const
SMqRebVgReq
*
pReq
)
{
if
(
tStartEncode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pReq
->
leftForVer
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pCoder
,
pReq
->
vgId
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pReq
->
oldConsumerId
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pReq
->
newConsumerId
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pCoder
,
pReq
->
subKey
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pCoder
,
pReq
->
subType
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pCoder
,
pReq
->
withMeta
)
<
0
)
return
-
1
;
if
(
pReq
->
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
tlen
+=
taosEncodeString
(
buf
,
pReq
->
qmsg
)
;
if
(
tEncodeCStr
(
pCoder
,
pReq
->
qmsg
)
<
0
)
return
-
1
;
}
else
if
(
pReq
->
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
tlen
+=
taosEncodeFixedI64
(
buf
,
pReq
->
suid
)
;
tlen
+=
taosEncodeString
(
buf
,
pReq
->
qmsg
)
;
if
(
tEncodeI64
(
pCoder
,
pReq
->
suid
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pCoder
,
pReq
->
qmsg
)
<
0
)
return
-
1
;
}
return
tlen
;
tEndEncode
(
pCoder
);
return
0
;
}
static
FORCE_INLINE
void
*
tDecodeSMqRebVgReq
(
const
void
*
buf
,
SMqRebVgReq
*
pReq
)
{
buf
=
taosDecodeFixedI64
(
buf
,
&
pReq
->
leftForVer
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pReq
->
vgId
);
buf
=
taosDecodeFixedI64
(
buf
,
&
pReq
->
oldConsumerId
);
buf
=
taosDecodeFixedI64
(
buf
,
&
pReq
->
newConsumerId
);
buf
=
taosDecodeStringTo
(
buf
,
pReq
->
subKey
);
buf
=
taosDecodeFixedI8
(
buf
,
&
pReq
->
subType
);
buf
=
taosDecodeFixedI8
(
buf
,
&
pReq
->
withMeta
);
static
FORCE_INLINE
int
tDecodeSMqRebVgReq
(
SDecoder
*
pCoder
,
SMqRebVgReq
*
pReq
)
{
if
(
tStartDecode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pCoder
,
&
pReq
->
leftForVer
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pCoder
,
&
pReq
->
vgId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pCoder
,
&
pReq
->
oldConsumerId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pCoder
,
&
pReq
->
newConsumerId
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pCoder
,
pReq
->
subKey
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pCoder
,
&
pReq
->
subType
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pCoder
,
&
pReq
->
withMeta
)
<
0
)
return
-
1
;
if
(
pReq
->
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
buf
=
taosDecodeString
(
buf
,
&
pReq
->
qmsg
)
;
if
(
tDecodeCStr
(
pCoder
,
&
pReq
->
qmsg
)
<
0
)
return
-
1
;
}
else
if
(
pReq
->
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
buf
=
taosDecodeFixedI64
(
buf
,
&
pReq
->
suid
);
buf
=
taosDecodeString
(
buf
,
&
pReq
->
qmsg
);
if
(
tDecodeI64
(
pCoder
,
&
pReq
->
suid
)
<
0
)
return
-
1
;
if
(
!
tDecodeIsEnd
(
pCoder
)){
if
(
tDecodeCStr
(
pCoder
,
&
pReq
->
qmsg
)
<
0
)
return
-
1
;
}
}
return
(
void
*
)
buf
;
tEndDecode
(
pCoder
);
return
0
;
}
typedef
struct
{
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
56782a5d
...
...
@@ -111,7 +111,14 @@ static int32_t mndBuildSubChangeReq(void **pBuf, int32_t *pLen, const SMqSubscri
req
.
suid
=
pSub
->
stbUid
;
tstrncpy
(
req
.
subKey
,
pSub
->
key
,
TSDB_SUBSCRIBE_KEY_LEN
);
int32_t
tlen
=
sizeof
(
SMsgHead
)
+
tEncodeSMqRebVgReq
(
NULL
,
&
req
);
int32_t
tlen
=
0
;
int32_t
ret
=
0
;
tEncodeSize
(
tEncodeSMqRebVgReq
,
&
req
,
tlen
,
ret
);
if
(
ret
<
0
)
{
return
-
1
;
}
tlen
+=
sizeof
(
SMsgHead
);
void
*
buf
=
taosMemoryMalloc
(
tlen
);
if
(
buf
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -123,8 +130,14 @@ static int32_t mndBuildSubChangeReq(void **pBuf, int32_t *pLen, const SMqSubscri
pMsgHead
->
contLen
=
htonl
(
tlen
);
pMsgHead
->
vgId
=
htonl
(
pRebVg
->
pVgEp
->
vgId
);
void
*
abuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
tEncodeSMqRebVgReq
(
&
abuf
,
&
req
);
SEncoder
encoder
=
{
0
};
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
)),
tlen
);
if
(
tEncodeSMqRebVgReq
(
&
encoder
,
&
req
)
<
0
)
{
taosMemoryFreeClear
(
buf
);
tEncoderClear
(
&
encoder
);
return
-
1
;
}
tEncoderClear
(
&
encoder
);
*
pBuf
=
buf
;
*
pLen
=
tlen
;
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
56782a5d
...
...
@@ -633,7 +633,16 @@ int32_t tqProcessDelCheckInfoReq(STQ* pTq, int64_t sversion, char* msg, int32_t
int32_t
tqProcessSubscribeReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
)
{
int
ret
=
0
;
SMqRebVgReq
req
=
{
0
};
tDecodeSMqRebVgReq
(
msg
,
&
req
);
SDecoder
dc
=
{
0
};
tDecoderInit
(
&
dc
,
msg
,
msgLen
);
// decode req
if
(
tDecodeSMqRebVgReq
(
&
dc
,
&
req
)
<
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
tDecoderClear
(
&
dc
);
return
-
1
;
}
SVnode
*
pVnode
=
pTq
->
pVnode
;
int32_t
vgId
=
TD_VID
(
pVnode
);
...
...
@@ -680,8 +689,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
pHandle
->
snapshotVer
=
ver
;
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
pHandle
->
execHandle
.
execCol
.
qmsg
=
req
.
qmsg
;
req
.
qmsg
=
NULL
;
pHandle
->
execHandle
.
execCol
.
qmsg
=
taosStrdup
(
req
.
qmsg
);;
pHandle
->
execHandle
.
task
=
qCreateQueueExecTaskInfo
(
pHandle
->
execHandle
.
execCol
.
qmsg
,
&
handle
,
vgId
,
&
pHandle
->
execHandle
.
numOfCols
,
req
.
newConsumerId
);
...
...
@@ -701,8 +709,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
pHandle
->
pWalReader
=
walOpenReader
(
pVnode
->
pWal
,
NULL
);
pHandle
->
execHandle
.
execTb
.
suid
=
req
.
suid
;
pHandle
->
execHandle
.
execTb
.
qmsg
=
req
.
qmsg
;
req
.
qmsg
=
NULL
;
pHandle
->
execHandle
.
execTb
.
qmsg
=
taosStrdup
(
req
.
qmsg
);
if
(
strcmp
(
pHandle
->
execHandle
.
execTb
.
qmsg
,
""
)
!=
0
)
{
if
(
nodesStringToNode
(
pHandle
->
execHandle
.
execTb
.
qmsg
,
&
pHandle
->
execHandle
.
execTb
.
node
)
!=
0
)
{
...
...
@@ -766,7 +773,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
end:
taosWUnLockLatch
(
&
pTq
->
lock
);
t
aosMemoryFree
(
req
.
qmsg
);
t
DecoderClear
(
&
dc
);
return
ret
;
}
...
...
tests/parallel_test/cases.task
浏览文件 @
56782a5d
...
...
@@ -564,7 +564,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/user_privilege.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/multilevel.py
#
,,n,system-test,python3 ./test.py -f 0-others/compatibility.py
,,n,system-test,python3 ./test.py -f 0-others/compatibility.py
,,n,system-test,python3 ./test.py -f 0-others/tag_index_basic.py
,,n,system-test,python3 ./test.py -f 0-others/udfpy_main.py
,,n,system-test,python3 ./test.py -N 3 -f 0-others/walRetention.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录