Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5d643fcf
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
5d643fcf
编写于
5月 06, 2023
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'main' into test/update_push_message
上级
760ccfd9
ca790277
变更
45
展开全部
显示空白变更内容
内联
并排
Showing
45 changed file
with
432 addition
and
326 deletion
+432
-326
include/common/tcommon.h
include/common/tcommon.h
+0
-8
include/common/tmsg.h
include/common/tmsg.h
+5
-5
include/libs/executor/executor.h
include/libs/executor/executor.h
+0
-2
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+1
-0
include/libs/wal/wal.h
include/libs/wal/wal.h
+0
-2
include/util/taoserror.h
include/util/taoserror.h
+1
-0
source/client/src/clientMain.c
source/client/src/clientMain.c
+2
-2
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+2
-2
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+2
-2
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+5
-5
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+2
-2
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+3
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+7
-7
source/dnode/mnode/impl/inc/mndVgroup.h
source/dnode/mnode/impl/inc/mndVgroup.h
+2
-0
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+20
-0
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+2
-2
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+1
-1
source/dnode/snode/src/snode.c
source/dnode/snode/src/snode.c
+4
-0
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+4
-2
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+1
-1
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+0
-1
source/dnode/vnode/src/meta/metaSnapshot.c
source/dnode/vnode/src/meta/metaSnapshot.c
+2
-2
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+2
-2
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+2
-2
source/dnode/vnode/src/sma/smaTimeRange.c
source/dnode/vnode/src/sma/smaTimeRange.c
+4
-4
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+6
-3
source/dnode/vnode/src/tq/tqPush.c
source/dnode/vnode/src/tq/tqPush.c
+4
-3
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+252
-171
source/dnode/vnode/src/tq/tqRestore.c
source/dnode/vnode/src/tq/tqRestore.c
+10
-24
source/dnode/vnode/src/tq/tqScan.c
source/dnode/vnode/src/tq/tqScan.c
+2
-2
source/dnode/vnode/src/tq/tqSink.c
source/dnode/vnode/src/tq/tqSink.c
+7
-7
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+1
-1
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+6
-6
source/libs/executor/src/dataInserter.c
source/libs/executor/src/dataInserter.c
+6
-6
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+2
-14
source/libs/executor/src/querytask.c
source/libs/executor/src/querytask.c
+3
-3
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+15
-21
source/libs/parser/src/parInsertUtil.c
source/libs/parser/src/parInsertUtil.c
+4
-4
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+25
-1
source/libs/stream/src/streamTask.c
source/libs/stream/src/streamTask.c
+1
-1
source/libs/tdb/src/db/tdbBtree.c
source/libs/tdb/src/db/tdbBtree.c
+5
-0
source/util/src/terror.c
source/util/src/terror.c
+1
-0
tests/pytest/auto_crash_gen.py
tests/pytest/auto_crash_gen.py
+4
-2
tests/pytest/auto_crash_gen_valgrind.py
tests/pytest/auto_crash_gen_valgrind.py
+2
-1
tests/pytest/auto_crash_gen_valgrind_cluster.py
tests/pytest/auto_crash_gen_valgrind_cluster.py
+2
-1
未找到文件。
include/common/tcommon.h
浏览文件 @
5d643fcf
...
...
@@ -212,14 +212,6 @@ enum {
FETCH_TYPE__NONE
,
};
typedef
struct
{
int8_t
fetchType
;
union
{
SSDataBlock
data
;
void
*
meta
;
};
}
SFetchRet
;
typedef
struct
SVarColAttr
{
int32_t
*
offset
;
// start position for each entry in the list
uint32_t
length
;
// used buffer size that contain the valid data
...
...
include/common/tmsg.h
浏览文件 @
5d643fcf
...
...
@@ -415,7 +415,7 @@ static FORCE_INLINE SSchemaWrapper* tCloneSSchemaWrapper(const SSchemaWrapper* p
return
pSW
;
}
static
FORCE_INLINE
void
tDeleteS
S
chemaWrapper
(
SSchemaWrapper
*
pSchemaWrapper
)
{
static
FORCE_INLINE
void
tDeleteSchemaWrapper
(
SSchemaWrapper
*
pSchemaWrapper
)
{
if
(
pSchemaWrapper
)
{
taosMemoryFree
(
pSchemaWrapper
->
pSchema
);
taosMemoryFree
(
pSchemaWrapper
);
...
...
@@ -3421,10 +3421,10 @@ typedef struct {
char
data
[];
// SSubmitReq2
}
SSubmitReq2Msg
;
int32_t
tEncodeS
SubmitReq2
(
SEncoder
*
pCoder
,
const
SSubmitReq2
*
pReq
);
int32_t
tDecodeS
SubmitReq2
(
SDecoder
*
pCoder
,
SSubmitReq2
*
pReq
);
void
tDestroyS
S
ubmitTbData
(
SSubmitTbData
*
pTbData
,
int32_t
flag
);
void
tDestroyS
S
ubmitReq
(
SSubmitReq2
*
pReq
,
int32_t
flag
);
int32_t
tEncodeS
ubmitReq
(
SEncoder
*
pCoder
,
const
SSubmitReq2
*
pReq
);
int32_t
tDecodeS
ubmitReq
(
SDecoder
*
pCoder
,
SSubmitReq2
*
pReq
);
void
tDestroySubmitTbData
(
SSubmitTbData
*
pTbData
,
int32_t
flag
);
void
tDestroySubmitReq
(
SSubmitReq2
*
pReq
,
int32_t
flag
);
typedef
struct
{
int32_t
affectedRows
;
...
...
include/libs/executor/executor.h
浏览文件 @
5d643fcf
...
...
@@ -192,8 +192,6 @@ SArray* qGetQueriedTableListInfo(qTaskInfo_t tinfo);
int32_t
qStreamPrepareScan
(
qTaskInfo_t
tinfo
,
STqOffsetVal
*
pOffset
,
int8_t
subType
);
int32_t
qStreamSetScanMemData
(
qTaskInfo_t
tinfo
,
SPackedData
submit
);
void
qStreamSetOpen
(
qTaskInfo_t
tinfo
);
void
qStreamExtractOffset
(
qTaskInfo_t
tinfo
,
STqOffsetVal
*
pOffset
);
...
...
include/libs/stream/tstream.h
浏览文件 @
5d643fcf
...
...
@@ -340,6 +340,7 @@ typedef struct SStreamMeta {
TTB
*
pTaskDb
;
TTB
*
pCheckpointDb
;
SHashObj
*
pTasks
;
SArray
*
pTaskList
;
// SArray<task_id*>
void
*
ahandle
;
TXN
*
txn
;
FTaskExpand
*
expandFunc
;
...
...
include/libs/wal/wal.h
浏览文件 @
5d643fcf
...
...
@@ -147,8 +147,6 @@ typedef struct SWalReader {
int64_t
curFileFirstVer
;
int64_t
curVersion
;
int64_t
capacity
;
// int8_t curInvalid;
// int8_t curStopped;
TdThreadMutex
mutex
;
SWalFilterCond
cond
;
// TODO remove it
...
...
include/util/taoserror.h
浏览文件 @
5d643fcf
...
...
@@ -261,6 +261,7 @@ int32_t* taosGetErrno();
// #define TSDB_CODE_MND_INVALID_STABLE_NAME TAOS_DEF_ERROR_CODE(0, 0x036D) // 2.x
#define TSDB_CODE_MND_INVALID_STB_OPTION TAOS_DEF_ERROR_CODE(0, 0x036E)
#define TSDB_CODE_MND_INVALID_ROW_BYTES TAOS_DEF_ERROR_CODE(0, 0x036F)
#define TSDB_CODE_MND_FIELD_VALUE_OVERFLOW TAOS_DEF_ERROR_CODE(0, 0x0370)
// mnode-func
...
...
source/client/src/clientMain.c
浏览文件 @
5d643fcf
...
...
@@ -191,7 +191,7 @@ void taos_free_result(TAOS_RES *res) {
taosArrayDestroyP
(
pRsp
->
rsp
.
blockData
,
taosMemoryFree
);
taosArrayDestroy
(
pRsp
->
rsp
.
blockDataLen
);
taosArrayDestroyP
(
pRsp
->
rsp
.
blockTbName
,
taosMemoryFree
);
taosArrayDestroyP
(
pRsp
->
rsp
.
blockSchema
,
(
FDelete
)
tDeleteS
S
chemaWrapper
);
taosArrayDestroyP
(
pRsp
->
rsp
.
blockSchema
,
(
FDelete
)
tDeleteSchemaWrapper
);
// taosx
taosArrayDestroy
(
pRsp
->
rsp
.
createTableLen
);
taosArrayDestroyP
(
pRsp
->
rsp
.
createTableReq
,
taosMemoryFree
);
...
...
@@ -204,7 +204,7 @@ void taos_free_result(TAOS_RES *res) {
taosArrayDestroyP
(
pRsp
->
rsp
.
blockData
,
taosMemoryFree
);
taosArrayDestroy
(
pRsp
->
rsp
.
blockDataLen
);
taosArrayDestroyP
(
pRsp
->
rsp
.
blockTbName
,
taosMemoryFree
);
taosArrayDestroyP
(
pRsp
->
rsp
.
blockSchema
,
(
FDelete
)
tDeleteS
S
chemaWrapper
);
taosArrayDestroyP
(
pRsp
->
rsp
.
blockSchema
,
(
FDelete
)
tDeleteSchemaWrapper
);
pRsp
->
resInfo
.
pRspMsg
=
NULL
;
doFreeReqResultInfo
(
&
pRsp
->
resInfo
);
taosMemoryFree
(
pRsp
);
...
...
source/client/src/clientStmt.c
浏览文件 @
5d643fcf
...
...
@@ -325,7 +325,7 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
taosHashCleanup
(
pStmt
->
exec
.
pBlockHash
);
pStmt
->
exec
.
pBlockHash
=
NULL
;
tDestroyS
S
ubmitTbData
(
pStmt
->
exec
.
pCurrTbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
pStmt
->
exec
.
pCurrTbData
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFreeClear
(
pStmt
->
exec
.
pCurrTbData
);
STMT_ERR_RET
(
stmtCleanBindInfo
(
pStmt
));
...
...
@@ -895,7 +895,7 @@ int stmtExec(TAOS_STMT* stmt) {
if
(
STMT_TYPE_QUERY
==
pStmt
->
sql
.
type
)
{
launchQueryImpl
(
pStmt
->
exec
.
pRequest
,
pStmt
->
sql
.
pQuery
,
true
,
NULL
);
}
else
{
tDestroyS
S
ubmitTbData
(
pStmt
->
exec
.
pCurrTbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
pStmt
->
exec
.
pCurrTbData
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFreeClear
(
pStmt
->
exec
.
pCurrTbData
);
STMT_ERR_RET
(
qCloneCurrentTbData
(
pStmt
->
exec
.
pCurrBlock
,
&
pStmt
->
exec
.
pCurrTbData
));
...
...
source/client/src/clientTmq.c
浏览文件 @
5d643fcf
...
...
@@ -864,7 +864,7 @@ static void* tmqFreeRspWrapper(SMqRspWrapper* rspWrapper) {
taosArrayDestroyP
(
pRsp
->
dataRsp
.
blockData
,
taosMemoryFree
);
taosArrayDestroy
(
pRsp
->
dataRsp
.
blockDataLen
);
taosArrayDestroyP
(
pRsp
->
dataRsp
.
blockTbName
,
taosMemoryFree
);
taosArrayDestroyP
(
pRsp
->
dataRsp
.
blockSchema
,
(
FDelete
)
tDeleteS
S
chemaWrapper
);
taosArrayDestroyP
(
pRsp
->
dataRsp
.
blockSchema
,
(
FDelete
)
tDeleteSchemaWrapper
);
}
else
if
(
rspWrapper
->
tmqRspType
==
TMQ_MSG_TYPE__POLL_META_RSP
)
{
SMqPollRspWrapper
*
pRsp
=
(
SMqPollRspWrapper
*
)
rspWrapper
;
taosMemoryFreeClear
(
pRsp
->
pEpset
);
...
...
@@ -877,7 +877,7 @@ static void* tmqFreeRspWrapper(SMqRspWrapper* rspWrapper) {
taosArrayDestroyP
(
pRsp
->
taosxRsp
.
blockData
,
taosMemoryFree
);
taosArrayDestroy
(
pRsp
->
taosxRsp
.
blockDataLen
);
taosArrayDestroyP
(
pRsp
->
taosxRsp
.
blockTbName
,
taosMemoryFree
);
taosArrayDestroyP
(
pRsp
->
taosxRsp
.
blockSchema
,
(
FDelete
)
tDeleteS
S
chemaWrapper
);
taosArrayDestroyP
(
pRsp
->
taosxRsp
.
blockSchema
,
(
FDelete
)
tDeleteSchemaWrapper
);
// taosx
taosArrayDestroy
(
pRsp
->
taosxRsp
.
createTableLen
);
taosArrayDestroyP
(
pRsp
->
taosxRsp
.
createTableReq
,
taosMemoryFree
);
...
...
source/client/test/clientTests.cpp
浏览文件 @
5d643fcf
...
...
@@ -1053,9 +1053,9 @@ TEST(clientCase, sub_db_test) {
}
TEST
(
clientCase
,
sub_tb_test
)
{
taos_options
(
TSDB_OPTION_CONFIGDIR
,
"
/home/tests/dir/cfg/
"
);
taos_options
(
TSDB_OPTION_CONFIGDIR
,
"
~/first/cfg
"
);
TAOS
*
pConn
=
taos_connect
(
"
vm116
"
,
"root"
,
"taosdata"
,
NULL
,
0
);
TAOS
*
pConn
=
taos_connect
(
"
localhost
"
,
"root"
,
"taosdata"
,
NULL
,
0
);
ASSERT_NE
(
pConn
,
nullptr
);
tmq_conf_t
*
conf
=
tmq_conf_new
();
...
...
@@ -1091,7 +1091,7 @@ TEST(clientCase, sub_tb_test) {
int32_t
precision
=
0
;
int32_t
totalRows
=
0
;
int32_t
msgCnt
=
0
;
int32_t
timeout
=
25000
;
int32_t
timeout
=
25000
00
;
int32_t
count
=
0
;
...
...
@@ -1117,10 +1117,10 @@ TEST(clientCase, sub_tb_test) {
fields
=
taos_fetch_fields
(
pRes
);
numOfFields
=
taos_field_count
(
pRes
);
totalRows
+=
1
;
if
(
totalRows
%
100000
==
0
)
{
//
if (totalRows % 100000 == 0) {
taos_print_row
(
buf
,
row
,
fields
,
numOfFields
);
printf
(
"row content: %s
\n
"
,
buf
);
}
//
}
}
taos_free_result
(
pRes
);
...
...
source/common/src/tdatablock.c
浏览文件 @
5d643fcf
...
...
@@ -2374,7 +2374,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq2** ppReq, const SSDataBlock* pDat
}
SRow
*
pRow
=
NULL
;
if
((
terrno
=
tRowBuild
(
pVals
,
pTSchema
,
&
pRow
))
<
0
)
{
tDestroyS
S
ubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
goto
_end
;
}
ASSERT
(
pRow
);
...
...
@@ -2388,7 +2388,7 @@ _end:
if
(
terrno
!=
0
)
{
*
ppReq
=
NULL
;
if
(
pReq
)
{
tDestroyS
S
ubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFreeClear
(
pReq
);
}
...
...
source/common/src/tdataformat.c
浏览文件 @
5d643fcf
...
...
@@ -1509,7 +1509,9 @@ void tTagSetCid(const STag *pTag, int16_t iTag, int16_t cid) {
// STSchema ========================================
STSchema
*
tBuildTSchema
(
SSchema
*
aSchema
,
int32_t
numOfCols
,
int32_t
version
)
{
STSchema
*
pTSchema
=
taosMemoryCalloc
(
1
,
sizeof
(
STSchema
)
+
sizeof
(
STColumn
)
*
numOfCols
);
if
(
pTSchema
==
NULL
)
return
NULL
;
if
(
pTSchema
==
NULL
)
{
return
NULL
;
}
pTSchema
->
numOfCols
=
numOfCols
;
pTSchema
->
version
=
version
;
...
...
source/common/src/tmsg.c
浏览文件 @
5d643fcf
...
...
@@ -7058,7 +7058,7 @@ void tDeleteSMqDataRsp(SMqDataRsp *pRsp) {
pRsp
->
blockDataLen
=
taosArrayDestroy
(
pRsp
->
blockDataLen
);
taosArrayDestroyP
(
pRsp
->
blockData
,
(
FDelete
)
taosMemoryFree
);
pRsp
->
blockData
=
NULL
;
taosArrayDestroyP
(
pRsp
->
blockSchema
,
(
FDelete
)
tDeleteS
S
chemaWrapper
);
taosArrayDestroyP
(
pRsp
->
blockSchema
,
(
FDelete
)
tDeleteSchemaWrapper
);
pRsp
->
blockSchema
=
NULL
;
taosArrayDestroyP
(
pRsp
->
blockTbName
,
(
FDelete
)
taosMemoryFree
);
pRsp
->
blockTbName
=
NULL
;
...
...
@@ -7159,7 +7159,7 @@ void tDeleteSTaosxRsp(STaosxRsp *pRsp) {
pRsp
->
blockDataLen
=
NULL
;
taosArrayDestroyP
(
pRsp
->
blockData
,
(
FDelete
)
taosMemoryFree
);
pRsp
->
blockData
=
NULL
;
taosArrayDestroyP
(
pRsp
->
blockSchema
,
(
FDelete
)
tDeleteS
S
chemaWrapper
);
taosArrayDestroyP
(
pRsp
->
blockSchema
,
(
FDelete
)
tDeleteSchemaWrapper
);
pRsp
->
blockSchema
=
NULL
;
taosArrayDestroyP
(
pRsp
->
blockTbName
,
(
FDelete
)
taosMemoryFree
);
pRsp
->
blockTbName
=
NULL
;
...
...
@@ -7332,7 +7332,7 @@ _exit:
return
0
;
}
int32_t
tEncodeS
SubmitReq2
(
SEncoder
*
pCoder
,
const
SSubmitReq2
*
pReq
)
{
int32_t
tEncodeS
ubmitReq
(
SEncoder
*
pCoder
,
const
SSubmitReq2
*
pReq
)
{
if
(
tStartEncode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tEncodeU64v
(
pCoder
,
taosArrayGetSize
(
pReq
->
aSubmitTbData
))
<
0
)
return
-
1
;
...
...
@@ -7344,7 +7344,7 @@ int32_t tEncodeSSubmitReq2(SEncoder *pCoder, const SSubmitReq2 *pReq) {
return
0
;
}
int32_t
tDecodeS
SubmitReq2
(
SDecoder
*
pCoder
,
SSubmitReq2
*
pReq
)
{
int32_t
tDecodeS
ubmitReq
(
SDecoder
*
pCoder
,
SSubmitReq2
*
pReq
)
{
int32_t
code
=
0
;
memset
(
pReq
,
0
,
sizeof
(
*
pReq
));
...
...
@@ -7387,7 +7387,7 @@ _exit:
return
code
;
}
void
tDestroyS
S
ubmitTbData
(
SSubmitTbData
*
pTbData
,
int32_t
flag
)
{
void
tDestroySubmitTbData
(
SSubmitTbData
*
pTbData
,
int32_t
flag
)
{
if
(
NULL
==
pTbData
)
{
return
;
}
...
...
@@ -7433,14 +7433,14 @@ void tDestroySSubmitTbData(SSubmitTbData *pTbData, int32_t flag) {
}
}
void
tDestroyS
S
ubmitReq
(
SSubmitReq2
*
pReq
,
int32_t
flag
)
{
void
tDestroySubmitReq
(
SSubmitReq2
*
pReq
,
int32_t
flag
)
{
if
(
pReq
->
aSubmitTbData
==
NULL
)
return
;
int32_t
nSubmitTbData
=
TARRAY_SIZE
(
pReq
->
aSubmitTbData
);
SSubmitTbData
*
aSubmitTbData
=
(
SSubmitTbData
*
)
TARRAY_DATA
(
pReq
->
aSubmitTbData
);
for
(
int32_t
i
=
0
;
i
<
nSubmitTbData
;
i
++
)
{
tDestroyS
S
ubmitTbData
(
&
aSubmitTbData
[
i
],
flag
);
tDestroySubmitTbData
(
&
aSubmitTbData
[
i
],
flag
);
}
taosArrayDestroy
(
pReq
->
aSubmitTbData
);
pReq
->
aSubmitTbData
=
NULL
;
...
...
source/dnode/mnode/impl/inc/mndVgroup.h
浏览文件 @
5d643fcf
...
...
@@ -50,6 +50,8 @@ void *mndBuildCreateVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *p
void
*
mndBuildDropVnodeReq
(
SMnode
*
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
);
bool
mndVgroupInDb
(
SVgObj
*
pVgroup
,
int64_t
dbUid
);
int32_t
mndSplitVgroup
(
SMnode
*
pMnode
,
SRpcMsg
*
pReq
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
5d643fcf
...
...
@@ -797,6 +797,11 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat
return
-
1
;
}
if
(
pDst
->
nextColId
<
0
||
pDst
->
nextColId
>=
0x7fff
-
pDst
->
numOfColumns
-
pDst
->
numOfTags
){
terrno
=
TSDB_CODE_MND_FIELD_VALUE_OVERFLOW
;
return
-
1
;
}
for
(
int32_t
i
=
0
;
i
<
pDst
->
numOfColumns
;
++
i
)
{
SField
*
pField
=
taosArrayGet
(
pCreate
->
pColumns
,
i
);
SSchema
*
pSchema
=
&
pDst
->
pColumns
[
i
];
...
...
@@ -927,6 +932,11 @@ static int32_t mndBuildStbFromAlter(SStbObj *pStb, SStbObj *pDst, SMCreateStbReq
return
-
1
;
}
if
(
pDst
->
nextColId
<
0
&&
pDst
->
nextColId
>=
0x7fff
-
pDst
->
numOfColumns
-
pDst
->
numOfTags
){
terrno
=
TSDB_CODE_MND_FIELD_VALUE_OVERFLOW
;
return
-
1
;
}
for
(
int32_t
i
=
0
;
i
<
pDst
->
numOfColumns
;
++
i
)
{
SField
*
pField
=
taosArrayGet
(
createReq
->
pColumns
,
i
);
SSchema
*
pSchema
=
&
pDst
->
pColumns
[
i
];
...
...
@@ -1154,6 +1164,11 @@ static int32_t mndAddSuperTableTag(const SStbObj *pOld, SStbObj *pNew, SArray *p
return
-
1
;
}
if
(
pNew
->
nextColId
<
0
&&
pNew
->
nextColId
>=
0x7fff
-
ntags
){
terrno
=
TSDB_CODE_MND_FIELD_VALUE_OVERFLOW
;
return
-
1
;
}
for
(
int32_t
i
=
0
;
i
<
ntags
;
i
++
)
{
SField
*
pField
=
taosArrayGet
(
pFields
,
i
);
if
(
mndFindSuperTableColumnIndex
(
pOld
,
pField
->
name
)
>=
0
)
{
...
...
@@ -1461,6 +1476,11 @@ static int32_t mndAddSuperTableColumn(const SStbObj *pOld, SStbObj *pNew, SArray
return
-
1
;
}
if
(
pNew
->
nextColId
<
0
&&
pNew
->
nextColId
>=
0x7fff
-
ncols
){
terrno
=
TSDB_CODE_MND_FIELD_VALUE_OVERFLOW
;
return
-
1
;
}
for
(
int32_t
i
=
0
;
i
<
ncols
;
i
++
)
{
SField
*
pField
=
taosArrayGet
(
pFields
,
i
);
if
(
mndFindSuperTableColumnIndex
(
pOld
,
pField
->
name
)
>=
0
)
{
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
5d643fcf
...
...
@@ -197,7 +197,7 @@ static SMqRebInfo *mndGetOrCreateRebSub(SHashObj *pHash, const char *key) {
return
pRebSub
;
}
static
void
doRemove
Existed
Consumers
(
SMqRebOutputObj
*
pOutput
,
SHashObj
*
pHash
,
const
SMqRebInputObj
*
pInput
)
{
static
void
doRemove
Lost
Consumers
(
SMqRebOutputObj
*
pOutput
,
SHashObj
*
pHash
,
const
SMqRebInputObj
*
pInput
)
{
int32_t
numOfRemoved
=
taosArrayGetSize
(
pInput
->
pRebInfo
->
removedConsumers
);
const
char
*
pSubKey
=
pOutput
->
pSub
->
key
;
...
...
@@ -339,7 +339,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
SHashObj
*
pHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
false
,
HASH_NO_LOCK
);
// 2. check and get actual removed consumers, put their vg into pHash
doRemove
Existed
Consumers
(
pOutput
,
pHash
,
pInput
);
doRemove
Lost
Consumers
(
pOutput
,
pHash
,
pInput
);
// 3. if previously no consumer, there are vgs not assigned, put these vg into pHash
addUnassignedVgroups
(
pOutput
,
pHash
);
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
5d643fcf
...
...
@@ -2006,7 +2006,7 @@ static int32_t mndAddAdjustVnodeHashRangeAction(SMnode *pMnode, STrans *pTrans,
return
0
;
}
static
int32_t
mndSplitVgroup
(
SMnode
*
pMnode
,
SRpcMsg
*
pReq
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
int32_t
mndSplitVgroup
(
SMnode
*
pMnode
,
SRpcMsg
*
pReq
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
NULL
;
SSdbRaw
*
pRaw
=
NULL
;
...
...
source/dnode/snode/src/snode.c
浏览文件 @
5d643fcf
...
...
@@ -153,11 +153,15 @@ int32_t sndProcessTaskDeployReq(SSnode *pSnode, char *msg, int32_t msgLen) {
ASSERT
(
pTask
->
taskLevel
==
TASK_LEVEL__AGG
);
// 2.save task
taosWLockLatch
(
&
pSnode
->
pMeta
->
lock
);
code
=
streamMetaAddDeployedTask
(
pSnode
->
pMeta
,
-
1
,
pTask
);
if
(
code
<
0
)
{
taosWUnLockLatch
(
&
pSnode
->
pMeta
->
lock
);
return
-
1
;
}
taosWUnLockLatch
(
&
pSnode
->
pMeta
->
lock
);
// 3.go through recover steps to fill history
if
(
pTask
->
fillHistory
)
{
streamSetParamForRecover
(
pTask
);
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
5d643fcf
...
...
@@ -231,7 +231,7 @@ typedef struct SSnapContext {
}
SSnapContext
;
typedef
struct
STqReader
{
SPackedData
msg
2
;
SPackedData
msg
;
SSubmitReq2
submit
;
int32_t
nextBlk
;
int64_t
lastBlkUid
;
...
...
@@ -241,8 +241,9 @@ typedef struct STqReader {
SArray
*
pColIdList
;
// SArray<int16_t>
int32_t
cachedSchemaVer
;
int64_t
cachedSchemaSuid
;
int64_t
cachedSchemaUid
;
SSchemaWrapper
*
pSchemaWrapper
;
S
TSchema
*
pSchema
;
S
SDataBlock
*
pResBlock
;
}
STqReader
;
STqReader
*
tqReaderOpen
(
SVnode
*
pVnode
);
...
...
@@ -255,6 +256,7 @@ int32_t tqReaderRemoveTbUidList(STqReader *pReader, const SArray *tbUidList);
int32_t
tqSeekVer
(
STqReader
*
pReader
,
int64_t
ver
,
const
char
*
id
);
int32_t
tqNextBlock
(
STqReader
*
pReader
,
SSDataBlock
*
pBlock
);
int32_t
tqNextBlockInWal
(
STqReader
*
pReader
);
int32_t
extractSubmitMsgFromWal
(
SWalReader
*
pReader
,
SPackedData
*
pPackedData
);
int32_t
tqReaderSetSubmitMsg
(
STqReader
*
pReader
,
void
*
msgStr
,
int32_t
msgLen
,
int64_t
ver
);
...
...
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
5d643fcf
...
...
@@ -193,7 +193,7 @@ STQ* tqOpen(const char* path, SVnode* pVnode);
void
tqNotifyClose
(
STQ
*
);
void
tqClose
(
STQ
*
);
int
tqPushMsg
(
STQ
*
,
void
*
msg
,
int32_t
msgLen
,
tmsg_t
msgType
,
int64_t
ver
);
int
tqRegisterPush
Entry
(
STQ
*
pTq
,
void
*
handle
,
SRpcMsg
*
pMsg
);
int
tqRegisterPush
Handle
(
STQ
*
pTq
,
void
*
handle
,
SRpcMsg
*
pMsg
);
int
tqUnregisterPushHandle
(
STQ
*
pTq
,
void
*
pHandle
);
int
tqStartStreamTasks
(
STQ
*
pTq
);
// restore all stream tasks after vnode launching completed.
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
5d643fcf
...
...
@@ -639,7 +639,6 @@ tb_uid_t metaStbCursorNext(SMStbCursor *pStbCur) {
STSchema
*
metaGetTbTSchema
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int32_t
sver
,
int
lock
)
{
STSchema
*
pTSchema
=
NULL
;
SSchemaWrapper
*
pSW
=
NULL
;
SSchema
*
pSchema
=
NULL
;
pSW
=
metaGetTableSchema
(
pMeta
,
uid
,
sver
,
lock
);
if
(
!
pSW
)
return
NULL
;
...
...
source/dnode/vnode/src/meta/metaSnapshot.c
浏览文件 @
5d643fcf
...
...
@@ -217,8 +217,8 @@ typedef struct STableInfoForChildTable {
static
void
destroySTableInfoForChildTable
(
void
*
data
)
{
STableInfoForChildTable
*
pData
=
(
STableInfoForChildTable
*
)
data
;
taosMemoryFree
(
pData
->
tableName
);
tDeleteS
S
chemaWrapper
(
pData
->
schemaRow
);
tDeleteS
S
chemaWrapper
(
pData
->
tagRow
);
tDeleteSchemaWrapper
(
pData
->
schemaRow
);
tDeleteSchemaWrapper
(
pData
->
tagRow
);
}
static
void
MoveToSnapShotVersion
(
SSnapContext
*
ctx
)
{
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
5d643fcf
...
...
@@ -673,8 +673,8 @@ int metaDropIndexFromSTable(SMeta *pMeta, int64_t version, SDropIndexReq *pReq)
metaUpdateUidIdx
(
pMeta
,
&
nStbEntry
);
metaULock
(
pMeta
);
tDeleteS
S
chemaWrapper
(
tag
);
tDeleteS
S
chemaWrapper
(
row
);
tDeleteSchemaWrapper
(
tag
);
tDeleteSchemaWrapper
(
row
);
if
(
oStbEntry
.
pBuf
)
taosMemoryFree
(
oStbEntry
.
pBuf
);
tDecoderClear
(
&
dc
);
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
5d643fcf
...
...
@@ -684,7 +684,7 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma
}
if
(
pReq
&&
tdProcessSubmitReq
(
sinkTsdb
,
output
->
info
.
version
,
pReq
)
<
0
)
{
tDestroyS
S
ubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFree
(
pReq
);
smaError
(
"vgId:%d, process submit req for rsma suid:%"
PRIu64
", uid:%"
PRIu64
" level %"
PRIi8
" failed since %s"
,
...
...
@@ -696,7 +696,7 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma
SMA_VID
(
pSma
),
suid
,
output
->
info
.
id
.
groupId
,
pItem
->
level
,
output
->
info
.
version
);
if
(
pReq
)
{
tDestroyS
S
ubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFree
(
pReq
);
}
}
...
...
source/dnode/vnode/src/sma/smaTimeRange.c
浏览文件 @
5d643fcf
...
...
@@ -299,7 +299,7 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
}
SRow
*
pRow
=
NULL
;
if
((
terrno
=
tRowBuild
(
pVals
,
(
STSchema
*
)
pTSchema
,
&
pRow
))
<
0
)
{
tDestroyS
S
ubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
goto
_end
;
}
taosArrayPush
(
tbData
.
aRowP
,
&
pRow
);
...
...
@@ -309,7 +309,7 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
}
// encode
tEncodeSize
(
tEncodeS
SubmitReq2
,
pReq
,
len
,
terrno
);
tEncodeSize
(
tEncodeS
ubmitReq
,
pReq
,
len
,
terrno
);
if
(
TSDB_CODE_SUCCESS
==
terrno
)
{
SEncoder
encoder
;
len
+=
sizeof
(
SSubmitReq2Msg
);
...
...
@@ -321,7 +321,7 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
((
SSubmitReq2Msg
*
)
pBuf
)
->
header
.
contLen
=
htonl
(
len
);
((
SSubmitReq2Msg
*
)
pBuf
)
->
version
=
htobe64
(
1
);
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
pBuf
,
sizeof
(
SSubmitReq2Msg
)),
len
-
sizeof
(
SSubmitReq2Msg
));
if
(
tEncodeS
SubmitReq2
(
&
encoder
,
pReq
)
<
0
)
{
if
(
tEncodeS
ubmitReq
(
&
encoder
,
pReq
)
<
0
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
/*vError("failed to encode submit req since %s", terrstr());*/
}
...
...
@@ -332,7 +332,7 @@ _end:
taosArrayDestroy
(
tagArray
);
taosArrayDestroy
(
pVals
);
if
(
pReq
)
{
tDestroyS
S
ubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFree
(
pReq
);
}
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
5d643fcf
...
...
@@ -781,13 +781,17 @@ int32_t tqProcessTaskDeployReq(STQ* pTq, int64_t sversion, char* msg, int32_t ms
tDecoderClear
(
&
decoder
);
// 2.save task, use the newest commit version as the initial start version of stream task.
taosWLockLatch
(
&
pTq
->
pStreamMeta
->
lock
);
code
=
streamMetaAddDeployedTask
(
pTq
->
pStreamMeta
,
sversion
,
pTask
);
if
(
code
<
0
)
{
tqError
(
"vgId:%d failed to add s-task:%s, total:%d"
,
TD_VID
(
pTq
->
pVnode
),
pTask
->
id
.
idStr
,
streamMetaGetNumOfTasks
(
pTq
->
pStreamMeta
));
taosWUnLockLatch
(
&
pTq
->
pStreamMeta
->
lock
);
return
-
1
;
}
taosWUnLockLatch
(
&
pTq
->
pStreamMeta
->
lock
);
// 3.go through recover steps to fill history
if
(
pTask
->
fillHistory
)
{
streamTaskCheckDownstream
(
pTask
,
sversion
);
...
...
@@ -1324,12 +1328,11 @@ int32_t tqCheckLogInWal(STQ* pTq, int64_t sversion) { return sversion <= pTq->wa
int32_t
tqStartStreamTasks
(
STQ
*
pTq
)
{
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
SStreamMeta
*
pMeta
=
pTq
->
pStreamMeta
;
taosWLockLatch
(
&
pMeta
->
lock
);
int32_t
numOfTasks
=
taos
HashGetSize
(
pTq
->
pStreamMeta
->
pTasks
);
int32_t
numOfTasks
=
taos
ArrayGetSize
(
pMeta
->
pTaskList
);
if
(
numOfTasks
==
0
)
{
tqInfo
(
"vgId:%d no stream tasks exists"
,
vgId
);
taosWUnLockLatch
(
&
pTq
->
pStreamMeta
->
lock
);
...
...
source/dnode/vnode/src/tq/tqPush.c
浏览文件 @
5d643fcf
...
...
@@ -262,14 +262,15 @@ int32_t tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t v
// taosWUnLockLatch(&pTq->lock);
}
tqDebug
(
"handle submit, restore:%d, size:%d"
,
pTq
->
pVnode
->
restored
,
(
int
)
taosHashGetSize
(
pTq
->
pStreamMeta
->
pTasks
));
int32_t
numOfTasks
=
streamMetaGetNumOfTasks
(
pTq
->
pStreamMeta
);
tqDebug
(
"handle submit, restore:%d, size:%d"
,
pTq
->
pVnode
->
restored
,
numOfTasks
);
// push data for stream processing:
// 1. the vnode has already been restored.
// 2. the vnode should be the leader.
// 3. the stream is not suspended yet.
if
(
!
tsDisableStream
&&
vnodeIsRoleLeader
(
pTq
->
pVnode
)
&&
pTq
->
pVnode
->
restored
)
{
if
(
taosHashGetSize
(
pTq
->
pStreamMeta
->
pTasks
)
==
0
)
{
if
(
numOfTasks
==
0
)
{
return
0
;
}
...
...
@@ -287,7 +288,7 @@ int32_t tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t v
}
int32_t
tqRegisterPush
Entry
(
STQ
*
pTq
,
void
*
handle
,
SRpcMsg
*
pMsg
)
{
int32_t
tqRegisterPush
Handle
(
STQ
*
pTq
,
void
*
handle
,
SRpcMsg
*
pMsg
)
{
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
STqHandle
*
pHandle
=
(
STqHandle
*
)
handle
;
if
(
pHandle
->
msg
==
NULL
){
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
5d643fcf
此差异已折叠。
点击以展开。
source/dnode/vnode/src/tq/tqRestore.c
浏览文件 @
5d643fcf
...
...
@@ -57,42 +57,28 @@ int32_t tqStreamTasksScanWal(STQ* pTq) {
return
0
;
}
static
SArray
*
extractTaskIdList
(
SStreamMeta
*
pStreamMeta
,
int32_t
numOfTasks
)
{
SArray
*
pTaskIdList
=
taosArrayInit
(
numOfTasks
,
sizeof
(
int32_t
));
void
*
pIter
=
NULL
;
taosWLockLatch
(
&
pStreamMeta
->
lock
);
while
(
1
)
{
pIter
=
taosHashIterate
(
pStreamMeta
->
pTasks
,
pIter
);
if
(
pIter
==
NULL
)
{
break
;
}
SStreamTask
*
pTask
=
*
(
SStreamTask
**
)
pIter
;
taosArrayPush
(
pTaskIdList
,
&
pTask
->
id
.
taskId
);
}
taosWUnLockLatch
(
&
pStreamMeta
->
lock
);
return
pTaskIdList
;
}
int32_t
createStreamRunReq
(
SStreamMeta
*
pStreamMeta
,
bool
*
pScanIdle
)
{
*
pScanIdle
=
true
;
bool
noNewDataInWal
=
true
;
int32_t
vgId
=
pStreamMeta
->
vgId
;
int32_t
numOfTasks
=
taos
HashGetSize
(
pStreamMeta
->
pTasks
);
int32_t
numOfTasks
=
taos
ArrayGetSize
(
pStreamMeta
->
pTaskList
);
if
(
numOfTasks
==
0
)
{
return
TSDB_CODE_SUCCESS
;
}
SArray
*
pTaskList
=
NULL
;
taosWLockLatch
(
&
pStreamMeta
->
lock
);
pTaskList
=
taosArrayDup
(
pStreamMeta
->
pTaskList
,
NULL
);
taosWUnLockLatch
(
&
pStreamMeta
->
lock
);
tqDebug
(
"vgId:%d start to check wal to extract new submit block for %d tasks"
,
vgId
,
numOfTasks
);
SArray
*
pTaskIdList
=
extractTaskIdList
(
pStreamMeta
,
numOfTasks
);
// update the new task number
numOfTasks
=
taosArrayGetSize
(
pTaskIdList
);
numOfTasks
=
taosArrayGetSize
(
pTaskList
);
for
(
int32_t
i
=
0
;
i
<
numOfTasks
;
++
i
)
{
int32_t
*
pTaskId
=
taosArrayGet
(
pTask
Id
List
,
i
);
int32_t
*
pTaskId
=
taosArrayGet
(
pTaskList
,
i
);
SStreamTask
*
pTask
=
streamMetaAcquireTask
(
pStreamMeta
,
*
pTaskId
);
if
(
pTask
==
NULL
)
{
continue
;
...
...
@@ -166,7 +152,7 @@ int32_t createStreamRunReq(SStreamMeta* pStreamMeta, bool* pScanIdle) {
*
pScanIdle
=
true
;
}
taosArrayDestroy
(
pTask
Id
List
);
taosArrayDestroy
(
pTaskList
);
return
0
;
}
source/dnode/vnode/src/tq/tqScan.c
浏览文件 @
5d643fcf
...
...
@@ -215,7 +215,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
int64_t
uid
=
pExec
->
pTqReader
->
lastBlkUid
;
if
(
tqAddTbNameToRsp
(
pTq
,
uid
,
pRsp
,
taosArrayGetSize
(
pBlocks
))
<
0
)
{
taosArrayDestroyEx
(
pBlocks
,
(
FDelete
)
blockDataFreeRes
);
taosArrayDestroyP
(
pSchemas
,
(
FDelete
)
tDeleteS
S
chemaWrapper
);
taosArrayDestroyP
(
pSchemas
,
(
FDelete
)
tDeleteSchemaWrapper
);
pBlocks
=
taosArrayInit
(
0
,
sizeof
(
SSDataBlock
));
pSchemas
=
taosArrayInit
(
0
,
sizeof
(
void
*
));
continue
;
...
...
@@ -274,7 +274,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
int64_t
uid
=
pExec
->
pTqReader
->
lastBlkUid
;
if
(
tqAddTbNameToRsp
(
pTq
,
uid
,
pRsp
,
taosArrayGetSize
(
pBlocks
))
<
0
)
{
taosArrayDestroyEx
(
pBlocks
,
(
FDelete
)
blockDataFreeRes
);
taosArrayDestroyP
(
pSchemas
,
(
FDelete
)
tDeleteS
S
chemaWrapper
);
taosArrayDestroyP
(
pSchemas
,
(
FDelete
)
tDeleteSchemaWrapper
);
pBlocks
=
taosArrayInit
(
0
,
sizeof
(
SSDataBlock
));
pSchemas
=
taosArrayInit
(
0
,
sizeof
(
void
*
));
continue
;
...
...
source/dnode/vnode/src/tq/tqSink.c
浏览文件 @
5d643fcf
...
...
@@ -672,7 +672,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
}
SRow
*
pRow
=
NULL
;
if
((
terrno
=
tRowBuild
(
pVals
,
(
STSchema
*
)
pTSchema
,
&
pRow
))
<
0
)
{
tDestroyS
S
ubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
goto
_end
;
}
ASSERT
(
pRow
);
...
...
@@ -681,7 +681,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
SSubmitReq2
submitReq
=
{
0
};
if
(
!
(
submitReq
.
aSubmitTbData
=
taosArrayInit
(
1
,
sizeof
(
SSubmitTbData
))))
{
tDestroyS
S
ubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
goto
_end
;
}
...
...
@@ -690,28 +690,28 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
// encode
int32_t
len
;
int32_t
code
;
tEncodeSize
(
tEncodeS
SubmitReq2
,
&
submitReq
,
len
,
code
);
tEncodeSize
(
tEncodeS
ubmitReq
,
&
submitReq
,
len
,
code
);
SEncoder
encoder
;
len
+=
sizeof
(
SSubmitReq2Msg
);
pBuf
=
rpcMallocCont
(
len
);
if
(
NULL
==
pBuf
)
{
tDestroyS
S
ubmitReq
(
&
submitReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
&
submitReq
,
TSDB_MSG_FLG_ENCODE
);
goto
_end
;
}
((
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
(
tEncodeS
SubmitReq2
(
&
encoder
,
&
submitReq
)
<
0
)
{
if
(
tEncodeS
ubmitReq
(
&
encoder
,
&
submitReq
)
<
0
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
tqError
(
"failed to encode submit req since %s"
,
terrstr
());
tEncoderClear
(
&
encoder
);
rpcFreeCont
(
pBuf
);
tDestroyS
S
ubmitReq
(
&
submitReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
&
submitReq
,
TSDB_MSG_FLG_ENCODE
);
continue
;
}
tEncoderClear
(
&
encoder
);
tDestroyS
S
ubmitReq
(
&
submitReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
&
submitReq
,
TSDB_MSG_FLG_ENCODE
);
SRpcMsg
msg
=
{
.
msgType
=
TDMT_VND_SUBMIT
,
...
...
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
5d643fcf
...
...
@@ -180,7 +180,7 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle,
dataRsp
.
reqOffset
.
version
==
dataRsp
.
rspOffset
.
version
&&
pHandle
->
consumerId
==
pRequest
->
consumerId
)
{
// lock
taosWLockLatch
(
&
pTq
->
lock
);
code
=
tqRegisterPush
Entry
(
pTq
,
pHandle
,
pMsg
);
code
=
tqRegisterPush
Handle
(
pTq
,
pHandle
,
pMsg
);
taosWUnLockLatch
(
&
pTq
->
lock
);
tDeleteSMqDataRsp
(
&
dataRsp
);
return
code
;
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
5d643fcf
...
...
@@ -1007,7 +1007,7 @@ static int32_t vnodeResetTableCxt(SMeta *pMeta, SSubmitReqConvertCxt *pCxt) {
}
tdSTSRowIterInit
(
&
pCxt
->
rowIter
,
pCxt
->
pTbSchema
);
tDestroyS
S
ubmitTbData
(
pCxt
->
pTbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
pCxt
->
pTbData
,
TSDB_MSG_FLG_ENCODE
);
if
(
NULL
==
pCxt
->
pTbData
)
{
pCxt
->
pTbData
=
taosMemoryCalloc
(
1
,
sizeof
(
SSubmitTbData
));
if
(
NULL
==
pCxt
->
pTbData
)
{
...
...
@@ -1039,7 +1039,7 @@ static int32_t vnodeResetTableCxt(SMeta *pMeta, SSubmitReqConvertCxt *pCxt) {
static
void
vnodeDestroySubmitReqConvertCxt
(
SSubmitReqConvertCxt
*
pCxt
)
{
taosMemoryFreeClear
(
pCxt
->
pTbSchema
);
tDestroyS
S
ubmitTbData
(
pCxt
->
pTbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
pCxt
->
pTbData
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFreeClear
(
pCxt
->
pTbData
);
taosArrayDestroy
(
pCxt
->
pColValues
);
}
...
...
@@ -1149,7 +1149,7 @@ static int32_t vnodeRebuildSubmitReqMsg(SSubmitReq2 *pSubmitReq, void **ppMsg) {
int32_t
code
=
TSDB_CODE_SUCCESS
;
char
*
pMsg
=
NULL
;
uint32_t
msglen
=
0
;
tEncodeSize
(
tEncodeS
SubmitReq2
,
pSubmitReq
,
msglen
,
code
);
tEncodeSize
(
tEncodeS
ubmitReq
,
pSubmitReq
,
msglen
,
code
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
pMsg
=
taosMemoryMalloc
(
msglen
);
if
(
NULL
==
pMsg
)
{
...
...
@@ -1159,7 +1159,7 @@ static int32_t vnodeRebuildSubmitReqMsg(SSubmitReq2 *pSubmitReq, void **ppMsg) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
SEncoder
encoder
;
tEncoderInit
(
&
encoder
,
pMsg
,
msglen
);
code
=
tEncodeS
SubmitReq2
(
&
encoder
,
pSubmitReq
);
code
=
tEncodeS
ubmitReq
(
&
encoder
,
pSubmitReq
);
tEncoderClear
(
&
encoder
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
...
@@ -1199,7 +1199,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
len
-=
sizeof
(
SSubmitReq2Msg
);
SDecoder
dc
=
{
0
};
tDecoderInit
(
&
dc
,
pReq
,
len
);
if
(
tDecodeS
SubmitReq2
(
&
dc
,
pSubmitReq
)
<
0
)
{
if
(
tDecodeS
ubmitReq
(
&
dc
,
pSubmitReq
)
<
0
)
{
code
=
TSDB_CODE_INVALID_MSG
;
goto
_exit
;
}
...
...
@@ -1388,7 +1388,7 @@ _exit:
// clear
taosArrayDestroy
(
newTbUids
);
tDestroyS
S
ubmitReq
(
pSubmitReq
,
0
==
pMsg
->
version
?
TSDB_MSG_FLG_CMPT
:
TSDB_MSG_FLG_DECODE
);
tDestroySubmitReq
(
pSubmitReq
,
0
==
pMsg
->
version
?
TSDB_MSG_FLG_CMPT
:
TSDB_MSG_FLG_DECODE
);
tDestroySSubmitRsp2
(
pSubmitRsp
,
TSDB_MSG_FLG_ENCODE
);
if
(
code
)
terrno
=
code
;
...
...
source/libs/executor/src/dataInserter.c
浏览文件 @
5d643fcf
...
...
@@ -126,7 +126,7 @@ static int32_t submitReqToMsg(int32_t vgId, SSubmitReq2* pReq, void** pData, int
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
len
=
0
;
void
*
pBuf
=
NULL
;
tEncodeSize
(
tEncodeS
SubmitReq2
,
pReq
,
len
,
code
);
tEncodeSize
(
tEncodeS
ubmitReq
,
pReq
,
len
,
code
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
SEncoder
encoder
;
len
+=
sizeof
(
SSubmitReq2Msg
);
...
...
@@ -138,7 +138,7 @@ static int32_t submitReqToMsg(int32_t vgId, SSubmitReq2* pReq, void** pData, int
((
SSubmitReq2Msg
*
)
pBuf
)
->
header
.
contLen
=
htonl
(
len
);
((
SSubmitReq2Msg
*
)
pBuf
)
->
version
=
htobe64
(
1
);
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
pBuf
,
sizeof
(
SSubmitReq2Msg
)),
len
-
sizeof
(
SSubmitReq2Msg
));
code
=
tEncodeS
SubmitReq2
(
&
encoder
,
pReq
);
code
=
tEncodeS
ubmitReq
(
&
encoder
,
pReq
);
tEncoderClear
(
&
encoder
);
}
...
...
@@ -281,7 +281,7 @@ int32_t buildSubmitReqFromBlock(SDataInserterHandle* pInserter, SSubmitReq2** pp
SRow
*
pRow
=
NULL
;
if
((
terrno
=
tRowBuild
(
pVals
,
pTSchema
,
&
pRow
))
<
0
)
{
tDestroyS
S
ubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
&
tbData
,
TSDB_MSG_FLG_ENCODE
);
goto
_end
;
}
taosArrayPush
(
tbData
.
aRowP
,
&
pRow
);
...
...
@@ -301,7 +301,7 @@ _end:
if
(
terrno
!=
0
)
{
*
ppReq
=
NULL
;
if
(
pReq
)
{
tDestroyS
S
ubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFree
(
pReq
);
}
return
terrno
;
...
...
@@ -326,7 +326,7 @@ int32_t dataBlocksToSubmitReq(SDataInserterHandle* pInserter, void** pMsg, int32
code
=
buildSubmitReqFromBlock
(
pInserter
,
&
pReq
,
pDataBlock
,
pTSchema
,
uid
,
vgId
,
suid
);
if
(
code
)
{
if
(
pReq
)
{
tDestroyS
S
ubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFree
(
pReq
);
}
...
...
@@ -335,7 +335,7 @@ int32_t dataBlocksToSubmitReq(SDataInserterHandle* pInserter, void** pMsg, int32
}
code
=
submitReqToMsg
(
vgId
,
pReq
,
pMsg
,
msgLen
);
tDestroyS
S
ubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
pReq
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFree
(
pReq
);
return
code
;
...
...
source/libs/executor/src/executor.c
浏览文件 @
5d643fcf
...
...
@@ -1052,19 +1052,6 @@ int32_t initQueryTableDataCondForTmq(SQueryTableDataCond* pCond, SSnapContext* s
return
TSDB_CODE_SUCCESS
;
}
int32_t
qStreamSetScanMemData
(
qTaskInfo_t
tinfo
,
SPackedData
submit
)
{
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
if
((
pTaskInfo
->
execModel
!=
OPTR_EXEC_MODEL_QUEUE
)
||
(
pTaskInfo
->
streamInfo
.
submit
.
msgStr
!=
NULL
))
{
qError
(
"qStreamSetScanMemData err:%d,%p"
,
pTaskInfo
->
execModel
,
pTaskInfo
->
streamInfo
.
submit
.
msgStr
);
terrno
=
TSDB_CODE_PAR_INTERNAL_ERROR
;
return
-
1
;
}
qDebug
(
"set the submit block for future scan"
);
pTaskInfo
->
streamInfo
.
submit
=
submit
;
return
0
;
}
void
qStreamSetOpen
(
qTaskInfo_t
tinfo
)
{
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
SOperatorInfo
*
pOperator
=
pTaskInfo
->
pRoot
;
...
...
@@ -1086,6 +1073,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
if
(
pOperator
==
NULL
)
{
return
-
1
;
}
SStreamScanInfo
*
pInfo
=
pOperator
->
info
;
STableScanInfo
*
pScanInfo
=
pInfo
->
pTableScanOp
->
info
;
STableScanBase
*
pScanBaseInfo
=
&
pScanInfo
->
base
;
...
...
@@ -1221,7 +1209,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
cleanupQueryTableDataCond
(
&
pTaskInfo
->
streamInfo
.
tableCond
);
strcpy
(
pTaskInfo
->
streamInfo
.
tbName
,
mtInfo
.
tbName
);
tDeleteS
S
chemaWrapper
(
pTaskInfo
->
streamInfo
.
schema
);
tDeleteSchemaWrapper
(
pTaskInfo
->
streamInfo
.
schema
);
pTaskInfo
->
streamInfo
.
schema
=
mtInfo
.
schema
;
qDebug
(
"tmqsnap qStreamPrepareScan snapshot data uid:%"
PRId64
" ts %"
PRId64
" %s"
,
mtInfo
.
uid
,
pOffset
->
ts
,
id
);
...
...
source/libs/executor/src/querytask.c
浏览文件 @
5d643fcf
...
...
@@ -109,8 +109,8 @@ int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHand
void
cleanupQueriedTableScanInfo
(
SSchemaInfo
*
pSchemaInfo
)
{
taosMemoryFreeClear
(
pSchemaInfo
->
dbname
);
taosMemoryFreeClear
(
pSchemaInfo
->
tablename
);
tDeleteS
S
chemaWrapper
(
pSchemaInfo
->
sw
);
tDeleteS
S
chemaWrapper
(
pSchemaInfo
->
qsw
);
tDeleteSchemaWrapper
(
pSchemaInfo
->
sw
);
tDeleteSchemaWrapper
(
pSchemaInfo
->
qsw
);
}
int32_t
initQueriedTableSchemaInfo
(
SReadHandle
*
pHandle
,
SScanPhysiNode
*
pScanNode
,
const
char
*
dbName
,
SExecTaskInfo
*
pTaskInfo
)
{
...
...
@@ -197,7 +197,7 @@ SSchemaWrapper* extractQueriedColumnSchema(SScanPhysiNode* pScanNode) {
return
pqSw
;
}
static
void
cleanupStreamInfo
(
SStreamTaskInfo
*
pStreamInfo
)
{
tDeleteS
S
chemaWrapper
(
pStreamInfo
->
schema
);
}
static
void
cleanupStreamInfo
(
SStreamTaskInfo
*
pStreamInfo
)
{
tDeleteSchemaWrapper
(
pStreamInfo
->
schema
);
}
static
void
freeBlock
(
void
*
pParam
)
{
SSDataBlock
*
pBlock
=
*
(
SSDataBlock
**
)
pParam
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
5d643fcf
...
...
@@ -1623,7 +1623,7 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
pInfo
->
pRes
->
info
.
dataLoad
=
1
;
blockDataUpdateTsWindow
(
pInfo
->
pRes
,
pInfo
->
primaryTsIndex
);
blockDataFreeRes
((
SSDataBlock
*
)
pBlock
);
//
blockDataFreeRes((SSDataBlock*)pBlock);
calBlockTbName
(
pInfo
,
pInfo
->
pRes
);
return
0
;
...
...
@@ -1637,7 +1637,7 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
qDebug
(
"start to exec queue scan, %s"
,
id
);
if
(
pTaskInfo
->
streamInfo
.
submit
.
msgStr
!=
NULL
)
{
if
(
pInfo
->
tqReader
->
msg
2
.
msgStr
==
NULL
)
{
if
(
pInfo
->
tqReader
->
msg
.
msgStr
==
NULL
)
{
SPackedData
submit
=
pTaskInfo
->
streamInfo
.
submit
;
if
(
tqReaderSetSubmitMsg
(
pInfo
->
tqReader
,
submit
.
msgStr
,
submit
.
msgLen
,
submit
.
ver
)
<
0
)
{
qError
(
"submit msg messed up when initing stream submit block %p"
,
submit
.
msgStr
);
...
...
@@ -1649,21 +1649,19 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
SDataBlockInfo
*
pBlockInfo
=
&
pInfo
->
pRes
->
info
;
while
(
tqNextBlockImpl
(
pInfo
->
tqReader
))
{
SSDataBlock
block
=
{
0
};
int32_t
code
=
tqRetrieveDataBlock
(
&
block
,
pInfo
->
tqReader
,
NULL
);
if
(
code
!=
TSDB_CODE_SUCCESS
||
block
.
info
.
rows
==
0
)
{
int32_t
code
=
tqRetrieveDataBlock
(
pInfo
->
tqReader
->
pResBlock
,
pInfo
->
tqReader
,
NULL
);
if
(
code
!=
TSDB_CODE_SUCCESS
||
pInfo
->
tqReader
->
pResBlock
->
info
.
rows
==
0
)
{
continue
;
}
setBlockIntoRes
(
pInfo
,
&
b
lock
,
true
);
setBlockIntoRes
(
pInfo
,
pInfo
->
tqReader
->
pResB
lock
,
true
);
if
(
pBlockInfo
->
rows
>
0
)
{
return
pInfo
->
pRes
;
}
}
pInfo
->
tqReader
->
msg
2
=
(
SPackedData
){
0
};
pInfo
->
tqReader
->
msg
=
(
SPackedData
){
0
};
pTaskInfo
->
streamInfo
.
submit
=
(
SPackedData
){
0
};
return
NULL
;
}
...
...
@@ -1689,20 +1687,18 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
if
(
pTaskInfo
->
streamInfo
.
currentOffset
.
type
==
TMQ_OFFSET__LOG
)
{
while
(
1
)
{
SSDataBlock
block
=
{
0
}
;
int32_t
type
=
tqNextBlock
(
pInfo
->
tqReader
,
&
block
)
;
int32_t
type
=
tqNextBlockInWal
(
pInfo
->
tqReader
)
;
SSDataBlock
*
pRes
=
pInfo
->
tqReader
->
pResBlock
;
// curVersion move to next, so currentOffset = curVersion - 1
tqOffsetResetToLog
(
&
pTaskInfo
->
streamInfo
.
currentOffset
,
pInfo
->
tqReader
->
pWalReader
->
curVersion
-
1
);
if
(
type
==
FETCH_TYPE__DATA
)
{
qDebug
(
"doQueueScan get data from log %"
PRId64
" rows, version:%"
PRId64
,
block
.
info
.
rows
,
qDebug
(
"doQueueScan get data from log %"
PRId64
" rows, version:%"
PRId64
,
pRes
->
info
.
rows
,
pTaskInfo
->
streamInfo
.
currentOffset
.
version
);
blockDataCleanup
(
pInfo
->
pRes
);
setBlockIntoRes
(
pInfo
,
&
block
,
true
);
setBlockIntoRes
(
pInfo
,
pRes
,
true
);
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
qDebug
(
"doQueueScan get data from log %"
PRId64
" rows, return, version:%"
PRId64
,
pInfo
->
pRes
->
info
.
rows
,
pTaskInfo
->
streamInfo
.
currentOffset
.
version
);
return
pInfo
->
pRes
;
}
}
else
if
(
type
==
FETCH_TYPE__NONE
)
{
...
...
@@ -2055,7 +2051,7 @@ FETCH_NEXT_BLOCK:
NEXT_SUBMIT_BLK:
while
(
1
)
{
if
(
pInfo
->
tqReader
->
msg
2
.
msgStr
==
NULL
)
{
if
(
pInfo
->
tqReader
->
msg
.
msgStr
==
NULL
)
{
if
(
pInfo
->
validBlockIndex
>=
totBlockNum
)
{
updateInfoDestoryColseWinSBF
(
pInfo
->
pUpdateInfo
);
doClearBufferedBlocks
(
pInfo
);
...
...
@@ -2075,14 +2071,12 @@ FETCH_NEXT_BLOCK:
blockDataCleanup
(
pInfo
->
pRes
);
while
(
tqNextBlockImpl
(
pInfo
->
tqReader
))
{
SSDataBlock
block
=
{
0
};
int32_t
code
=
tqRetrieveDataBlock
(
&
block
,
pInfo
->
tqReader
,
NULL
);
if
(
code
!=
TSDB_CODE_SUCCESS
||
block
.
info
.
rows
==
0
)
{
int32_t
code
=
tqRetrieveDataBlock
(
pInfo
->
tqReader
->
pResBlock
,
pInfo
->
tqReader
,
NULL
);
if
(
code
!=
TSDB_CODE_SUCCESS
||
pInfo
->
tqReader
->
pResBlock
->
info
.
rows
==
0
)
{
continue
;
}
setBlockIntoRes
(
pInfo
,
&
b
lock
,
false
);
setBlockIntoRes
(
pInfo
,
pInfo
->
tqReader
->
pResB
lock
,
false
);
if
(
updateInfoIgnore
(
pInfo
->
pUpdateInfo
,
&
pInfo
->
pRes
->
info
.
window
,
pInfo
->
pRes
->
info
.
id
.
groupId
,
pInfo
->
pRes
->
info
.
version
))
{
...
...
@@ -2191,7 +2185,7 @@ static SSDataBlock* doRawScan(SOperatorInfo* pOperator) {
qDebug
(
"tmqsnap change get data uid:%"
PRId64
""
,
mtInfo
.
uid
);
}
qStreamPrepareScan
(
pTaskInfo
,
&
offset
,
pInfo
->
sContext
->
subType
);
tDeleteS
S
chemaWrapper
(
mtInfo
.
schema
);
tDeleteSchemaWrapper
(
mtInfo
.
schema
);
return
NULL
;
}
else
if
(
pTaskInfo
->
streamInfo
.
currentOffset
.
type
==
TMQ_OFFSET__SNAPSHOT_META
)
{
SSnapContext
*
sContext
=
pInfo
->
sContext
;
...
...
source/libs/parser/src/parInsertUtil.c
浏览文件 @
5d643fcf
...
...
@@ -313,7 +313,7 @@ void insDestroyTableDataCxt(STableDataCxt* pTableCxt) {
insDestroyBoundColInfo
(
&
pTableCxt
->
boundColsInfo
);
taosArrayDestroyEx
(
pTableCxt
->
pValues
,
destroyColVal
);
if
(
pTableCxt
->
pData
)
{
tDestroyS
S
ubmitTbData
(
pTableCxt
->
pData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitTbData
(
pTableCxt
->
pData
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFree
(
pTableCxt
->
pData
);
}
taosMemoryFree
(
pTableCxt
);
...
...
@@ -324,7 +324,7 @@ void insDestroyVgroupDataCxt(SVgroupDataCxt* pVgCxt) {
return
;
}
tDestroyS
S
ubmitReq
(
pVgCxt
->
pData
,
TSDB_MSG_FLG_ENCODE
);
tDestroySubmitReq
(
pVgCxt
->
pData
,
TSDB_MSG_FLG_ENCODE
);
taosMemoryFree
(
pVgCxt
->
pData
);
taosMemoryFree
(
pVgCxt
);
}
...
...
@@ -499,7 +499,7 @@ static int32_t buildSubmitReq(int32_t vgId, SSubmitReq2* pReq, void** pData, uin
int32_t
code
=
TSDB_CODE_SUCCESS
;
uint32_t
len
=
0
;
void
*
pBuf
=
NULL
;
tEncodeSize
(
tEncodeS
SubmitReq2
,
pReq
,
len
,
code
);
tEncodeSize
(
tEncodeS
ubmitReq
,
pReq
,
len
,
code
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
SEncoder
encoder
;
len
+=
sizeof
(
SSubmitReq2Msg
);
...
...
@@ -511,7 +511,7 @@ static int32_t buildSubmitReq(int32_t vgId, SSubmitReq2* pReq, void** pData, uin
((
SSubmitReq2Msg
*
)
pBuf
)
->
header
.
contLen
=
htonl
(
len
);
((
SSubmitReq2Msg
*
)
pBuf
)
->
version
=
htobe64
(
1
);
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
pBuf
,
sizeof
(
SSubmitReq2Msg
)),
len
-
sizeof
(
SSubmitReq2Msg
));
code
=
tEncodeS
SubmitReq2
(
&
encoder
,
pReq
);
code
=
tEncodeS
ubmitReq
(
&
encoder
,
pReq
);
tEncoderClear
(
&
encoder
);
}
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
5d643fcf
...
...
@@ -57,6 +57,13 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
goto
_err
;
}
// task list
pMeta
->
pTaskList
=
taosArrayInit
(
4
,
sizeof
(
int32_t
));
if
(
pMeta
->
pTaskList
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_err
;
}
if
(
streamMetaBegin
(
pMeta
)
<
0
)
{
goto
_err
;
}
...
...
@@ -70,6 +77,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
_err:
taosMemoryFree
(
pMeta
->
path
);
if
(
pMeta
->
pTasks
)
taosHashCleanup
(
pMeta
->
pTasks
);
if
(
pMeta
->
pTaskList
)
taosArrayDestroy
(
pMeta
->
pTaskList
);
if
(
pMeta
->
pTaskDb
)
tdbTbClose
(
pMeta
->
pTaskDb
);
if
(
pMeta
->
pCheckpointDb
)
tdbTbClose
(
pMeta
->
pCheckpointDb
);
if
(
pMeta
->
db
)
tdbClose
(
pMeta
->
db
);
...
...
@@ -100,6 +108,7 @@ void streamMetaClose(SStreamMeta* pMeta) {
}
taosHashCleanup
(
pMeta
->
pTasks
);
pMeta
->
pTaskList
=
taosArrayDestroy
(
pMeta
->
pTaskList
);
taosMemoryFree
(
pMeta
->
path
);
taosMemoryFree
(
pMeta
);
}
...
...
@@ -180,11 +189,15 @@ int32_t streamMetaAddDeployedTask(SStreamMeta* pMeta, int64_t ver, SStreamTask*
}
taosHashPut
(
pMeta
->
pTasks
,
&
pTask
->
id
.
taskId
,
sizeof
(
int32_t
),
&
pTask
,
POINTER_BYTES
);
taosArrayPush
(
pMeta
->
pTaskList
,
&
pTask
->
id
.
taskId
);
return
0
;
}
int32_t
streamMetaGetNumOfTasks
(
const
SStreamMeta
*
pMeta
)
{
return
(
int32_t
)
taosHashGetSize
(
pMeta
->
pTasks
);
size_t
size
=
taosHashGetSize
(
pMeta
->
pTasks
);
ASSERT
(
taosArrayGetSize
(
pMeta
->
pTaskList
)
==
taosHashGetSize
(
pMeta
->
pTasks
));
return
(
int32_t
)
size
;
}
SStreamTask
*
streamMetaAcquireTask
(
SStreamMeta
*
pMeta
,
int32_t
taskId
)
{
...
...
@@ -224,6 +237,15 @@ void streamMetaRemoveTask(SStreamMeta* pMeta, int32_t taskId) {
atomic_store_8
(
&
pTask
->
status
.
taskStatus
,
TASK_STATUS__STOP
);
int32_t
num
=
taosArrayGetSize
(
pMeta
->
pTaskList
);
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
int32_t
*
pTaskId
=
taosArrayGet
(
pMeta
->
pTaskList
,
i
);
if
(
*
pTaskId
==
taskId
)
{
taosArrayRemove
(
pMeta
->
pTaskList
,
i
);
break
;
}
}
streamMetaReleaseTask
(
pMeta
,
pTask
);
taosWUnLockLatch
(
&
pMeta
->
lock
);
}
...
...
@@ -308,6 +330,8 @@ int32_t streamLoadTasks(SStreamMeta* pMeta, int64_t ver) {
return
-
1
;
}
taosArrayPush
(
pMeta
->
pTaskList
,
&
pTask
->
id
.
taskId
);
if
(
pTask
->
fillHistory
)
{
pTask
->
status
.
taskStatus
=
TASK_STATUS__WAIT_DOWNSTREAM
;
streamTaskCheckDownstream
(
pTask
,
ver
);
...
...
source/libs/stream/src/streamTask.c
浏览文件 @
5d643fcf
...
...
@@ -193,7 +193,7 @@ void tFreeStreamTask(SStreamTask* pTask) {
taosArrayDestroyP
(
pTask
->
childEpInfo
,
taosMemoryFree
);
if
(
pTask
->
outputType
==
TASK_OUTPUT__TABLE
)
{
tDeleteS
S
chemaWrapper
(
pTask
->
tbSink
.
pSchemaWrapper
);
tDeleteSchemaWrapper
(
pTask
->
tbSink
.
pSchemaWrapper
);
taosMemoryFree
(
pTask
->
tbSink
.
pTSchema
);
}
...
...
source/libs/tdb/src/db/tdbBtree.c
浏览文件 @
5d643fcf
...
...
@@ -1814,6 +1814,11 @@ int tdbBtreeNext(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen) {
*
ppVal
=
pVal
;
*
vLen
=
cd
.
vLen
;
}
else
{
if
(
TDB_CELLDECODER_FREE_VAL
(
&
cd
))
{
tdbTrace
(
"tdb/btree-next2 decoder: %p pVal free: %p"
,
&
cd
,
cd
.
pVal
);
tdbFree
(
cd
.
pVal
);
}
}
ret
=
tdbBtcMoveToNext
(
pBtc
);
...
...
source/util/src/terror.c
浏览文件 @
5d643fcf
...
...
@@ -203,6 +203,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_COLUMN_ALREADY_EXIST, "Column already exists
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_COLUMN_NOT_EXIST
,
"Column does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_STB_OPTION
,
"Invalid stable options"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_ROW_BYTES
,
"Invalid row bytes"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FIELD_VALUE_OVERFLOW
,
"out of range and overflow"
)
// mnode-func
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_FUNC_NAME
,
"Invalid func name"
)
...
...
tests/pytest/auto_crash_gen.py
浏览文件 @
5d643fcf
...
...
@@ -353,7 +353,8 @@ def main():
else
:
core_dir
=
"none"
text
=
f
'''exit status:
{
msg_dict
[
status
]
}
text
=
f
'''
exit status:
{
msg_dict
[
status
]
}
test scope: crash_gen
owner: pxiao
hostname:
{
hostname
}
...
...
@@ -362,7 +363,8 @@ def main():
git commit :
{
git_commit
}
log dir:
{
log_dir
}
core dir:
{
core_dir
}
cmd:
{
cmd
}
'''
cmd:
{
cmd
}
'''
send_msg
(
get_msg
(
text
))
except
Exception
as
e
:
...
...
tests/pytest/auto_crash_gen_valgrind.py
浏览文件 @
5d643fcf
...
...
@@ -388,7 +388,8 @@ def main():
else
:
core_dir
=
"none"
text
=
f
'''exit status:
{
msg_dict
[
status
]
}
text
=
f
'''
exit status:
{
msg_dict
[
status
]
}
test scope: crash_gen
owner: pxiao
hostname:
{
hostname
}
...
...
tests/pytest/auto_crash_gen_valgrind_cluster.py
浏览文件 @
5d643fcf
...
...
@@ -388,7 +388,8 @@ def main():
else
:
core_dir
=
"none"
text
=
f
'''exit status:
{
msg_dict
[
status
]
}
text
=
f
'''
exit status:
{
msg_dict
[
status
]
}
test scope: crash_gen
owner: pxiao
hostname:
{
hostname
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录