Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0f4de9da
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看板
提交
0f4de9da
编写于
2月 17, 2023
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: compatible with older versions of wal
上级
d5cd2d36
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
23 deletion
+23
-23
source/dnode/vnode/src/sma/smaTimeRange.c
source/dnode/vnode/src/sma/smaTimeRange.c
+5
-5
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+18
-18
未找到文件。
source/dnode/vnode/src/sma/smaTimeRange.c
浏览文件 @
0f4de9da
...
...
@@ -257,7 +257,6 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
int32_t
rows
=
pDataBlock
->
info
.
rows
;
SSubmitTbData
tbData
=
{
0
};
if
(
!
(
tbData
.
aRowP
=
taosArrayInit
(
rows
,
sizeof
(
SRow
*
))))
{
goto
_end
;
...
...
@@ -313,14 +312,15 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
tEncodeSize
(
tEncodeSSubmitReq2
,
pReq
,
len
,
terrno
);
if
(
TSDB_CODE_SUCCESS
==
terrno
)
{
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
,
pReq
)
<
0
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
/*vError("failed to encode submit req since %s", terrstr());*/
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
0f4de9da
...
...
@@ -311,8 +311,8 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) {
tqDebug
(
"return offset %"
PRId64
", no more valid"
,
ret
->
offset
.
version
);
return
-
1
;
}
void
*
body
=
POINTER_SHIFT
(
pReader
->
pWalReader
->
pHead
->
head
.
body
,
sizeof
(
S
MsgHead
));
int32_t
bodyLen
=
pReader
->
pWalReader
->
pHead
->
head
.
bodyLen
-
sizeof
(
S
MsgHead
);
void
*
body
=
POINTER_SHIFT
(
pReader
->
pWalReader
->
pHead
->
head
.
body
,
sizeof
(
S
SubmitReq2Msg
));
int32_t
bodyLen
=
pReader
->
pWalReader
->
pHead
->
head
.
bodyLen
-
sizeof
(
S
SubmitReq2Msg
);
int64_t
ver
=
pReader
->
pWalReader
->
pHead
->
head
.
version
;
#if 0
if (pReader->pWalReader->pHead->head.msgType != TDMT_VND_SUBMIT) {
...
...
@@ -560,7 +560,7 @@ int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader, SSubmitTbD
SSubmitTbData
*
pSubmitTbData
=
taosArrayGet
(
pReader
->
submit
.
aSubmitTbData
,
pReader
->
nextBlk
);
pReader
->
nextBlk
++
;
if
(
pSubmitTbDataRet
)
*
pSubmitTbDataRet
=
pSubmitTbData
;
if
(
pSubmitTbDataRet
)
*
pSubmitTbDataRet
=
pSubmitTbData
;
int32_t
sversion
=
pSubmitTbData
->
sver
;
int64_t
suid
=
pSubmitTbData
->
suid
;
int64_t
uid
=
pSubmitTbData
->
uid
;
...
...
@@ -1012,7 +1012,7 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
SSubmitTbData
*
pSubmitTbData
=
taosArrayGet
(
pReader
->
submit
.
aSubmitTbData
,
pReader
->
nextBlk
);
pReader
->
nextBlk
++
;
if
(
pSubmitTbDataRet
)
*
pSubmitTbDataRet
=
pSubmitTbData
;
if
(
pSubmitTbDataRet
)
*
pSubmitTbDataRet
=
pSubmitTbData
;
int32_t
sversion
=
pSubmitTbData
->
sver
;
int64_t
suid
=
pSubmitTbData
->
suid
;
int64_t
uid
=
pSubmitTbData
->
uid
;
...
...
@@ -1022,7 +1022,7 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
pReader
->
pSchema
=
metaGetTbTSchema
(
pReader
->
pVnodeMeta
,
uid
,
sversion
,
1
);
if
(
pReader
->
pSchema
==
NULL
)
{
tqWarn
(
"vgId:%d, cannot found tsschema for table: uid:%"
PRId64
" (suid:%"
PRId64
"), version %d, possibly dropped table"
,
"), version %d, possibly dropped table"
,
pReader
->
pWalReader
->
pWal
->
cfg
.
vgId
,
uid
,
suid
,
sversion
);
pReader
->
cachedSchemaSuid
=
0
;
terrno
=
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
;
...
...
@@ -1041,7 +1041,7 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
STSchema
*
pTschema
=
pReader
->
pSchema
;
SSchemaWrapper
*
pSchemaWrapper
=
pReader
->
pSchemaWrapper
;
int32_t
numOfRows
=
0
;
int32_t
numOfRows
=
0
;
if
(
pSubmitTbData
->
flags
&
SUBMIT_REQ_COLUMN_DATA_FORMAT
)
{
SArray
*
pCols
=
pSubmitTbData
->
aCol
;
...
...
@@ -1054,7 +1054,7 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
int32_t
curRow
=
0
;
int32_t
lastRow
=
0
;
char
*
assigned
=
taosMemoryCalloc
(
1
,
pSchemaWrapper
->
nCols
);
char
*
assigned
=
taosMemoryCalloc
(
1
,
pSchemaWrapper
->
nCols
);
if
(
assigned
==
NULL
)
return
-
1
;
// convert and scan one block
...
...
@@ -1064,9 +1064,9 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
i
++
)
{
bool
buildNew
=
false
;
for
(
int32_t
j
=
0
;
j
<
numOfCols
;
j
++
){
for
(
int32_t
j
=
0
;
j
<
numOfCols
;
j
++
)
{
SColData
*
pCol
=
taosArrayGet
(
pCols
,
j
);
SColVal
colVal
;
SColVal
colVal
;
tColDataGetValue
(
pCol
,
i
,
&
colVal
);
if
(
curRow
==
0
)
{
assigned
[
j
]
=
!
COL_VAL_IS_NONE
(
&
colVal
);
...
...
@@ -1087,9 +1087,9 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
lastRow
=
curRow
;
}
SSDataBlock
block
=
{
0
};
SSDataBlock
block
=
{
0
};
SSchemaWrapper
*
pSW
=
taosMemoryCalloc
(
1
,
sizeof
(
SSchemaWrapper
));
if
(
pSW
==
NULL
)
{
if
(
pSW
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
FAIL
;
}
...
...
@@ -1158,10 +1158,10 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
}
else
{
SArray
*
pRows
=
pSubmitTbData
->
aRowP
;
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
i
++
)
{
SRow
*
pRow
=
taosArrayGetP
(
pRows
,
i
);
bool
buildNew
=
false
;
SRow
*
pRow
=
taosArrayGetP
(
pRows
,
i
);
bool
buildNew
=
false
;
for
(
int32_t
j
=
0
;
j
<
pTschema
->
numOfCols
;
j
++
){
for
(
int32_t
j
=
0
;
j
<
pTschema
->
numOfCols
;
j
++
)
{
SColVal
colVal
;
tRowGet
(
pRow
,
pTschema
,
j
,
&
colVal
);
if
(
curRow
==
0
)
{
...
...
@@ -1183,9 +1183,9 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
lastRow
=
curRow
;
}
SSDataBlock
block
=
{
0
};
SSDataBlock
block
=
{
0
};
SSchemaWrapper
*
pSW
=
taosMemoryCalloc
(
1
,
sizeof
(
SSchemaWrapper
));
if
(
pSW
==
NULL
)
{
if
(
pSW
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
FAIL
;
}
...
...
@@ -1220,7 +1220,7 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
int32_t
colActual
=
blockDataGetNumOfCols
(
pBlock
);
while
(
targetIdx
<
colActual
)
{
SColumnInfoData
*
pColData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
targetIdx
);
SColVal
colVal
;
SColVal
colVal
;
tRowGet
(
pRow
,
pTschema
,
sourceIdx
,
&
colVal
);
if
(
colVal
.
cid
<
pColData
->
info
.
colId
)
{
...
...
@@ -1256,7 +1256,7 @@ int32_t tqRetrieveTaosxBlock2(STqReader* pReader, SArray* blocks, SArray* schema
taosMemoryFree
(
assigned
);
return
0
;
FAIL:
FAIL:
taosMemoryFree
(
assigned
);
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录