Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d5cd2d36
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d5cd2d36
编写于
2月 17, 2023
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: compatible with older versions of wal
上级
b7f4b93d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
21 deletion
+22
-21
source/dnode/vnode/src/tq/tqPush.c
source/dnode/vnode/src/tq/tqPush.c
+2
-2
source/dnode/vnode/src/tq/tqSink.c
source/dnode/vnode/src/tq/tqSink.c
+15
-15
source/libs/executor/src/dataInserter.c
source/libs/executor/src/dataInserter.c
+5
-4
未找到文件。
source/dnode/vnode/src/tq/tqPush.c
浏览文件 @
d5cd2d36
...
...
@@ -207,8 +207,8 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
#endif
int
tqPushMsg
(
STQ
*
pTq
,
void
*
msg
,
int32_t
msgLen
,
tmsg_t
msgType
,
int64_t
ver
)
{
void
*
pReq
=
POINTER_SHIFT
(
msg
,
sizeof
(
S
MsgHead
));
int32_t
len
=
msgLen
-
sizeof
(
S
MsgHead
);
void
*
pReq
=
POINTER_SHIFT
(
msg
,
sizeof
(
S
SubmitReq2Msg
));
int32_t
len
=
msgLen
-
sizeof
(
S
SubmitReq2Msg
);
tqDebug
(
"vgId:%d, tq push msg ver %"
PRId64
", type: %s, p head %p, p body %p, len %d"
,
pTq
->
pVnode
->
config
.
vgId
,
ver
,
TMSG_INFO
(
msgType
),
msg
,
pReq
,
len
);
...
...
source/dnode/vnode/src/tq/tqSink.c
浏览文件 @
d5cd2d36
...
...
@@ -71,7 +71,6 @@ int32_t tqBuildDeleteReq(SVnode* pVnode, const char* stbFullName, const SSDataBl
return
0
;
}
void
tqSinkToTablePipeline
(
SStreamTask
*
pTask
,
void
*
vnode
,
int64_t
ver
,
void
*
data
)
{
const
SArray
*
pBlocks
=
(
const
SArray
*
)
data
;
SVnode
*
pVnode
=
(
SVnode
*
)
vnode
;
...
...
@@ -324,7 +323,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
}
static
int32_t
encodeCreateChildTableForRPC
(
SVCreateTbBatchReq
*
pReqs
,
int32_t
vgId
,
void
**
pBuf
,
int32_t
*
contLen
)
{
int32_t
ret
=
0
;
int32_t
ret
=
0
;
tEncodeSize
(
tEncodeSVCreateTbBatchReq
,
pReqs
,
*
contLen
,
ret
);
if
(
ret
<
0
)
{
...
...
@@ -340,7 +339,7 @@ static int32_t encodeCreateChildTableForRPC(SVCreateTbBatchReq* pReqs, int32_t v
((
SMsgHead
*
)(
*
pBuf
))
->
vgId
=
vgId
;
((
SMsgHead
*
)(
*
pBuf
))
->
contLen
=
htonl
(
*
contLen
);
SEncoder
coder
=
{
0
};
tEncoderInit
(
&
coder
,
POINTER_SHIFT
(
*
pBuf
,
sizeof
(
SMsgHead
)),
(
*
contLen
)
-
sizeof
(
SMsgHead
)
);
tEncoderInit
(
&
coder
,
POINTER_SHIFT
(
*
pBuf
,
sizeof
(
SMsgHead
)),
(
*
contLen
)
-
sizeof
(
SMsgHead
)
);
if
(
tEncodeSVCreateTbBatchReq
(
&
coder
,
pReqs
)
<
0
)
{
rpcFreeCont
(
*
pBuf
);
*
pBuf
=
NULL
;
...
...
@@ -440,7 +439,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
goto
_end
;
}
for
(
int32_t
rowId
=
0
;
rowId
<
rows
;
rowId
++
)
{
SVCreateTbReq
createTbReq
=
{
0
};
SVCreateTbReq
createTbReq
=
{
0
};
SVCreateTbReq
*
pCreateTbReq
=
&
createTbReq
;
if
(
!
pCreateTbReq
)
{
goto
_end
;
...
...
@@ -482,9 +481,9 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
}
for
(
int32_t
tagId
=
UD_TAG_COLUMN_INDEX
,
step
=
1
;
tagId
<
size
;
tagId
++
,
step
++
)
{
SColumnInfoData
*
pTagData
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
tagId
);
STagVal
tagVal
=
{
.
cid
=
pTSchema
->
numOfCols
+
step
,
.
type
=
pTagData
->
info
.
type
,
STagVal
tagVal
=
{
.
cid
=
pTSchema
->
numOfCols
+
step
,
.
type
=
pTagData
->
info
.
type
,
};
void
*
pData
=
colDataGetData
(
pTagData
,
rowId
);
if
(
colDataIsNull_s
(
pTagData
,
rowId
))
{
...
...
@@ -514,7 +513,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
SColumnInfoData
*
pTbColInfo
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
UD_TABLE_NAME_COLUMN_INDEX
);
if
(
colDataIsNull_s
(
pTbColInfo
,
rowId
))
{
SColumnInfoData
*
pGpIdColInfo
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
UD_GROUPID_COLUMN_INDEX
);
void
*
pGpIdData
=
colDataGetData
(
pGpIdColInfo
,
rowId
);
void
*
pGpIdData
=
colDataGetData
(
pGpIdColInfo
,
rowId
);
pCreateTbReq
->
name
=
buildCtbNameByGroupId
(
stbFullName
,
*
(
uint64_t
*
)
pGpIdData
);
}
else
{
void
*
pTbData
=
colDataGetData
(
pTbColInfo
,
rowId
);
...
...
@@ -639,16 +638,16 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
taosArrayClear
(
pVals
);
int32_t
dataIndex
=
0
;
for
(
int32_t
k
=
0
;
k
<
pTSchema
->
numOfCols
;
k
++
)
{
const
STColumn
*
pCol
=
&
pTSchema
->
columns
[
k
];
const
STColumn
*
pCol
=
&
pTSchema
->
columns
[
k
];
if
(
k
==
0
)
{
SColumnInfoData
*
pColData
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
dataIndex
);
void
*
colData
=
colDataGetData
(
pColData
,
j
);
void
*
colData
=
colDataGetData
(
pColData
,
j
);
tqDebug
(
"tq sink pipe2, row %d, col %d ts %"
PRId64
,
j
,
k
,
*
(
int64_t
*
)
colData
);
}
if
(
IS_SET_NULL
(
pCol
))
{
SColVal
cv
=
COL_VAL_NULL
(
pCol
->
colId
,
pCol
->
type
);
taosArrayPush
(
pVals
,
&
cv
);
}
else
{
}
else
{
SColumnInfoData
*
pColData
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
dataIndex
);
if
(
colDataIsNull_s
(
pColData
,
j
))
{
SColVal
cv
=
COL_VAL_NULL
(
pCol
->
colId
,
pCol
->
type
);
...
...
@@ -692,14 +691,15 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
int32_t
code
;
tEncodeSize
(
tEncodeSSubmitReq2
,
&
submitReq
,
len
,
code
);
SEncoder
encoder
;
len
+=
sizeof
(
S
MsgHead
);
len
+=
sizeof
(
S
SubmitReq2Msg
);
pBuf
=
rpcMallocCont
(
len
);
if
(
NULL
==
pBuf
)
{
goto
_end
;
}
((
SMsgHead
*
)
pBuf
)
->
vgId
=
TD_VID
(
pVnode
);
((
SMsgHead
*
)
pBuf
)
->
contLen
=
htonl
(
len
);
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
pBuf
,
sizeof
(
SMsgHead
)),
len
-
sizeof
(
SMsgHead
));
((
SSubmitReq2Msg
*
)
pBuf
)
->
header
.
vgId
=
TD_VID
(
pVnode
);
((
SSubmitReq2Msg
*
)
pBuf
)
->
header
.
contLen
=
htonl
(
len
);
((
SSubmitReq2Msg
*
)
pBuf
)
->
version
=
htobe64
(
1
);
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
pBuf
,
sizeof
(
SSubmitReq2Msg
)),
len
-
sizeof
(
SSubmitReq2Msg
));
if
(
tEncodeSSubmitReq2
(
&
encoder
,
&
submitReq
)
<
0
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
tqError
(
"failed to encode submit req since %s"
,
terrstr
());
...
...
source/libs/executor/src/dataInserter.c
浏览文件 @
d5cd2d36
...
...
@@ -129,14 +129,15 @@ static int32_t submitReqToMsg(int32_t vgId, SSubmitReq2* pReq, void** pData, int
tEncodeSize
(
tEncodeSSubmitReq2
,
pReq
,
len
,
code
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
SEncoder
encoder
;
len
+=
sizeof
(
S
MsgHead
);
len
+=
sizeof
(
S
SubmitReq2Msg
);
pBuf
=
taosMemoryMalloc
(
len
);
if
(
NULL
==
pBuf
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
((
SMsgHead
*
)
pBuf
)
->
vgId
=
htonl
(
vgId
);
((
SMsgHead
*
)
pBuf
)
->
contLen
=
htonl
(
len
);
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
pBuf
,
sizeof
(
SMsgHead
)),
len
-
sizeof
(
SMsgHead
));
((
SSubmitReq2Msg
*
)
pBuf
)
->
header
.
vgId
=
htonl
(
vgId
);
((
SSubmitReq2Msg
*
)
pBuf
)
->
header
.
contLen
=
htonl
(
len
);
((
SSubmitReq2Msg
*
)
pBuf
)
->
version
=
htobe64
(
1
);
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
pBuf
,
sizeof
(
SSubmitReq2Msg
)),
len
-
sizeof
(
SSubmitReq2Msg
));
code
=
tEncodeSSubmitReq2
(
&
encoder
,
pReq
);
tEncoderClear
(
&
encoder
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录