Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
972ad9e7
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
972ad9e7
编写于
8月 19, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into refact/tsdb_last
上级
a14aa3aa
240747ab
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
132 addition
and
61 deletion
+132
-61
source/dnode/mnode/impl/src/mndSma.c
source/dnode/mnode/impl/src/mndSma.c
+4
-2
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+2
-1
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+1
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+18
-18
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+55
-21
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+5
-1
source/libs/stream/src/streamTask.c
source/libs/stream/src/streamTask.c
+2
-1
source/libs/transport/inc/transComm.h
source/libs/transport/inc/transComm.h
+6
-0
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+14
-6
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+0
-1
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+10
-7
tests/script/tsim/stream/basic0.sim
tests/script/tsim/stream/basic0.sim
+15
-2
未找到文件。
source/dnode/mnode/impl/src/mndSma.c
浏览文件 @
972ad9e7
...
...
@@ -489,7 +489,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
smaObj
.
uid
=
mndGenerateUid
(
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
ASSERT
(
smaObj
.
uid
!=
0
);
char
resultTbName
[
TSDB_TABLE_FNAME_LEN
+
16
]
=
{
0
};
snprintf
(
resultTbName
,
TSDB_TABLE_FNAME_LEN
+
16
,
"%s_td_tsma_rst_tb"
,
pCreate
->
name
);
snprintf
(
resultTbName
,
TSDB_TABLE_FNAME_LEN
+
16
,
"%s_td_tsma_rst_tb"
,
pCreate
->
name
);
memcpy
(
smaObj
.
dstTbName
,
resultTbName
,
TSDB_TABLE_FNAME_LEN
);
smaObj
.
dstTbUid
=
mndGenerateUid
(
smaObj
.
dstTbName
,
TSDB_TABLE_FNAME_LEN
);
smaObj
.
stbUid
=
pStb
->
uid
;
...
...
@@ -530,7 +530,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
streamObj
.
sourceDbUid
=
pDb
->
uid
;
streamObj
.
targetDbUid
=
pDb
->
uid
;
streamObj
.
version
=
1
;
streamObj
.
sql
=
pCreate
->
sql
;
streamObj
.
sql
=
strdup
(
pCreate
->
sql
)
;
streamObj
.
smaId
=
smaObj
.
uid
;
streamObj
.
watermark
=
pCreate
->
watermark
;
streamObj
.
trigger
=
STREAM_TRIGGER_WINDOW_CLOSE
;
...
...
@@ -585,6 +585,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
return
-
1
;
}
if
(
pAst
!=
NULL
)
nodesDestroyNode
(
pAst
);
nodesDestroyNode
((
SNode
*
)
pPlan
);
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_CONFLICT_DB
,
pReq
);
...
...
@@ -609,6 +610,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
code
=
0
;
_OVER:
tFreeStreamObj
(
&
streamObj
);
mndDestroySmaObj
(
&
smaObj
);
mndTransDrop
(
pTrans
);
return
code
;
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
972ad9e7
...
...
@@ -509,6 +509,7 @@ int32_t mndAllocSmaVgroup(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup) {
pVgroup
->
replica
=
1
;
if
(
mndGetAvailableDnode
(
pMnode
,
pDb
,
pVgroup
,
pArray
)
!=
0
)
return
-
1
;
taosArrayDestroy
(
pArray
);
mInfo
(
"db:%s, sma vgId:%d is alloced"
,
pDb
->
name
,
pVgroup
->
vgId
);
return
0
;
...
...
@@ -1862,4 +1863,4 @@ _OVER:
#endif
}
bool
mndVgroupInDb
(
SVgObj
*
pVgroup
,
int64_t
dbUid
)
{
return
!
pVgroup
->
isTsma
&&
pVgroup
->
dbUid
==
dbUid
;
}
\ No newline at end of file
bool
mndVgroupInDb
(
SVgObj
*
pVgroup
,
int64_t
dbUid
)
{
return
!
pVgroup
->
isTsma
&&
pVgroup
->
dbUid
==
dbUid
;
}
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
972ad9e7
...
...
@@ -341,7 +341,7 @@ FAIL:
return
-
1
;
}
void
tqReaderSetColIdList
(
STqReader
*
pRead
Handle
,
SArray
*
pColIdList
)
{
pReadHandle
->
pColIdList
=
pColIdList
;
}
void
tqReaderSetColIdList
(
STqReader
*
pRead
er
,
SArray
*
pColIdList
)
{
pReader
->
pColIdList
=
pColIdList
;
}
int
tqReaderSetTbUidList
(
STqReader
*
pReader
,
const
SArray
*
tbUidList
)
{
if
(
pReader
->
tbIdHash
)
{
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
972ad9e7
...
...
@@ -3223,8 +3223,8 @@ int32_t handleLimitOffset(SOperatorInfo* pOperator, SLimitInfo* pLimitInfo, SSDa
}
static
void
doApplyScalarCalculation
(
SOperatorInfo
*
pOperator
,
SSDataBlock
*
pBlock
,
int32_t
order
,
int32_t
scanFlag
);
static
void
doHandleRemainBlockForNewGroupImpl
(
SOperatorInfo
*
pOperator
,
SFillOperatorInfo
*
pInfo
,
SResultInfo
*
pResult
Info
,
SExecTaskInfo
*
pTaskInfo
)
{
static
void
doHandleRemainBlockForNewGroupImpl
(
SOperatorInfo
*
pOperator
,
SFillOperatorInfo
*
p
Info
,
S
ResultInfo
*
pResultInfo
,
S
ExecTaskInfo
*
pTaskInfo
)
{
pInfo
->
totalInputRows
=
pInfo
->
existNewGroupBlock
->
info
.
rows
;
SSDataBlock
*
pResBlock
=
pInfo
->
pFinalRes
;
...
...
@@ -3248,8 +3248,8 @@ static void doHandleRemainBlockForNewGroupImpl(SOperatorInfo *pOperator, SFillOp
pInfo
->
existNewGroupBlock
=
NULL
;
}
static
void
doHandleRemainBlockFromNewGroup
(
SOperatorInfo
*
pOperator
,
SFillOperatorInfo
*
pInfo
,
SResultInfo
*
pResultInfo
,
SExecTaskInfo
*
pTaskInfo
)
{
static
void
doHandleRemainBlockFromNewGroup
(
SOperatorInfo
*
pOperator
,
SFillOperatorInfo
*
pInfo
,
S
ResultInfo
*
pResultInfo
,
S
ExecTaskInfo
*
pTaskInfo
)
{
if
(
taosFillHasMoreResults
(
pInfo
->
pFillInfo
))
{
int32_t
numOfResultRows
=
pResultInfo
->
capacity
-
pInfo
->
pFinalRes
->
info
.
rows
;
taosFillResultDataBlock
(
pInfo
->
pFillInfo
,
pInfo
->
pFinalRes
,
numOfResultRows
);
...
...
@@ -3265,8 +3265,8 @@ static void doHandleRemainBlockFromNewGroup(SOperatorInfo* pOperator, SFillOpera
static
void
doApplyScalarCalculation
(
SOperatorInfo
*
pOperator
,
SSDataBlock
*
pBlock
,
int32_t
order
,
int32_t
scanFlag
)
{
SFillOperatorInfo
*
pInfo
=
pOperator
->
info
;
SExprSupp
*
pSup
=
&
pOperator
->
exprSupp
;
SSDataBlock
*
pResBlock
=
pInfo
->
pFinalRes
;
SExprSupp
*
pSup
=
&
pOperator
->
exprSupp
;
SSDataBlock
*
pResBlock
=
pInfo
->
pFinalRes
;
setInputDataBlock
(
pOperator
,
pSup
->
pCtx
,
pBlock
,
order
,
scanFlag
,
false
);
projectApplyFunctions
(
pSup
->
pExprInfo
,
pInfo
->
pRes
,
pBlock
,
pSup
->
pCtx
,
pSup
->
numOfExprs
,
NULL
);
...
...
@@ -3276,13 +3276,13 @@ static void doApplyScalarCalculation(SOperatorInfo* pOperator, SSDataBlock* pBlo
SColumnInfoData
*
pSrc
=
taosArrayGet
(
pBlock
->
pDataBlock
,
pInfo
->
primarySrcSlotId
);
colDataAssign
(
pDst
,
pSrc
,
pInfo
->
pRes
->
info
.
rows
,
&
pResBlock
->
info
);
for
(
int32_t
i
=
0
;
i
<
pInfo
->
numOfNotFillExpr
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pInfo
->
numOfNotFillExpr
;
++
i
)
{
SFillColInfo
*
pCol
=
&
pInfo
->
pFillInfo
->
pFillCol
[
i
+
pInfo
->
numOfExpr
];
ASSERT
(
pCol
->
notFillCol
);
SExprInfo
*
pExpr
=
pCol
->
pExpr
;
int32_t
srcSlotId
=
pExpr
->
base
.
pParam
[
0
].
pCol
->
slotId
;
int32_t
dstSlotId
=
pExpr
->
base
.
resSchema
.
slotId
;
int32_t
srcSlotId
=
pExpr
->
base
.
pParam
[
0
].
pCol
->
slotId
;
int32_t
dstSlotId
=
pExpr
->
base
.
resSchema
.
slotId
;
SColumnInfoData
*
pDst1
=
taosArrayGet
(
pInfo
->
pRes
->
pDataBlock
,
dstSlotId
);
SColumnInfoData
*
pSrc1
=
taosArrayGet
(
pBlock
->
pDataBlock
,
srcSlotId
);
...
...
@@ -3670,7 +3670,7 @@ void destroyExchangeOperatorInfo(void* param, int32_t numOfOutput) {
taosRemoveRef
(
exchangeObjRefPool
,
pExInfo
->
self
);
}
void
freeSourceDataInfo
(
void
*
p
)
{
void
freeSourceDataInfo
(
void
*
p
)
{
SSourceDataInfo
*
pInfo
=
(
SSourceDataInfo
*
)
p
;
taosMemoryFreeClear
(
pInfo
->
pRsp
);
}
...
...
@@ -3700,8 +3700,8 @@ static int32_t initFillInfo(SFillOperatorInfo* pInfo, SExprInfo* pExpr, int32_t
STimeWindow
w
=
getAlignQueryTimeWindow
(
pInterval
,
pInterval
->
precision
,
win
.
skey
);
w
=
getFirstQualifiedTimeWindow
(
win
.
skey
,
&
w
,
pInterval
,
TSDB_ORDER_ASC
);
pInfo
->
pFillInfo
=
taosCreateFillInfo
(
w
.
skey
,
numOfCols
,
numOfNotFillCols
,
capacity
,
pInterval
,
fillType
,
pColInfo
,
pInfo
->
primaryTsCol
,
order
,
id
);
pInfo
->
pFillInfo
=
taosCreateFillInfo
(
w
.
skey
,
numOfCols
,
numOfNotFillCols
,
capacity
,
pInterval
,
fillType
,
pColInfo
,
pInfo
->
primaryTsCol
,
order
,
id
);
pInfo
->
win
=
win
;
pInfo
->
p
=
taosMemoryCalloc
(
numOfCols
,
POINTER_BYTES
);
...
...
@@ -3727,10 +3727,10 @@ SOperatorInfo* createFillOperatorInfo(SOperatorInfo* downstream, SFillPhysiNode*
SExprInfo
*
pExprInfo
=
createExprInfo
(
pPhyFillNode
->
pFillExprs
,
NULL
,
&
pInfo
->
numOfExpr
);
pInfo
->
pNotFillExprInfo
=
createExprInfo
(
pPhyFillNode
->
pNotFillExprs
,
NULL
,
&
pInfo
->
numOfNotFillExpr
);
SInterval
*
pInterval
=
SInterval
*
pInterval
=
QUERY_NODE_PHYSICAL_PLAN_MERGE_ALIGNED_INTERVAL
==
downstream
->
operatorType
?
&
((
SMergeAlignedIntervalAggOperatorInfo
*
)
downstream
->
info
)
->
intervalAggOperatorInfo
->
interval
:
&
((
SIntervalAggOperatorInfo
*
)
downstream
->
info
)
->
interval
;
?
&
((
SMergeAlignedIntervalAggOperatorInfo
*
)
downstream
->
info
)
->
intervalAggOperatorInfo
->
interval
:
&
((
SIntervalAggOperatorInfo
*
)
downstream
->
info
)
->
interval
;
int32_t
order
=
(
pPhyFillNode
->
inputTsOrder
==
ORDER_ASC
)
?
TSDB_ORDER_ASC
:
TSDB_ORDER_DESC
;
int32_t
type
=
convertFillType
(
pPhyFillNode
->
mode
);
...
...
@@ -3747,9 +3747,9 @@ SOperatorInfo* createFillOperatorInfo(SOperatorInfo* downstream, SFillPhysiNode*
SArray
*
pColMatchColInfo
=
extractColMatchInfo
(
pPhyFillNode
->
pFillExprs
,
pPhyFillNode
->
node
.
pOutputDataBlockDesc
,
&
numOfOutputCols
,
COL_MATCH_FROM_SLOT_ID
);
int32_t
code
=
initFillInfo
(
pInfo
,
pExprInfo
,
pInfo
->
numOfExpr
,
pInfo
->
pNotFillExprInfo
,
pInfo
->
numOfNotFillExpr
,
(
SNodeListNode
*
)
pPhyFillNode
->
pValues
,
pPhyFillNode
->
timeRange
,
pResultInfo
->
capacity
,
pTaskInfo
->
id
.
str
,
pInterval
,
type
,
order
);
int32_t
code
=
initFillInfo
(
pInfo
,
pExprInfo
,
pInfo
->
numOfExpr
,
pInfo
->
pNotFillExprInfo
,
pInfo
->
numOfNotFillExpr
,
(
SNodeListNode
*
)
pPhyFillNode
->
pValues
,
pPhyFillNode
->
timeRange
,
pResultInfo
->
capacity
,
pTaskInfo
->
id
.
str
,
pInterval
,
type
,
order
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
972ad9e7
...
...
@@ -139,7 +139,7 @@ static bool overlapWithTimeWindow(SInterval* pInterval, SDataBlockInfo* pBlockIn
}
assert
(
w
.
ekey
>
pBlockInfo
->
window
.
ekey
);
if
(
w
.
skey
<=
pBlockInfo
->
window
.
ekey
&&
w
.
skey
>
pBlockInfo
->
window
.
s
key
)
{
if
(
TMAX
(
w
.
skey
,
pBlockInfo
->
window
.
skey
)
<=
pBlockInfo
->
window
.
e
key
)
{
return
true
;
}
}
...
...
@@ -147,7 +147,7 @@ static bool overlapWithTimeWindow(SInterval* pInterval, SDataBlockInfo* pBlockIn
w
=
getAlignQueryTimeWindow
(
pInterval
,
pInterval
->
precision
,
pBlockInfo
->
window
.
ekey
);
assert
(
w
.
skey
<=
pBlockInfo
->
window
.
ekey
);
if
(
w
.
skey
>
pBlockInfo
->
window
.
skey
)
{
if
(
TMAX
(
w
.
skey
,
pBlockInfo
->
window
.
skey
)
<=
TMIN
(
w
.
ekey
,
pBlockInfo
->
window
.
ekey
)
)
{
return
true
;
}
...
...
@@ -158,7 +158,7 @@ static bool overlapWithTimeWindow(SInterval* pInterval, SDataBlockInfo* pBlockIn
}
assert
(
w
.
skey
<
pBlockInfo
->
window
.
skey
);
if
(
w
.
ekey
<
pBlockInfo
->
window
.
ekey
&&
w
.
ekey
>=
pBlockInfo
->
window
.
skey
)
{
if
(
pBlockInfo
->
window
.
skey
<=
TMIN
(
w
.
ekey
,
pBlockInfo
->
window
.
ekey
)
)
{
return
true
;
}
}
...
...
@@ -1649,6 +1649,8 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys
}
taosArrayDestroy
(
tableIdList
);
memcpy
(
&
pTaskInfo
->
streamInfo
.
tableCond
,
&
pTSInfo
->
cond
,
sizeof
(
SQueryTableDataCond
));
}
else
{
taosArrayDestroy
(
pColIds
);
}
// create the pseduo columns info
...
...
@@ -2038,10 +2040,34 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
metaReaderClear
(
&
smr
);
if
(
numOfRows
>=
pOperator
->
resultInfo
.
capacity
)
{
break
;
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
relocateColumnData
(
pInfo
->
pRes
,
pInfo
->
scanCols
,
p
->
pDataBlock
,
false
);
doFilterResult
(
pInfo
);
blockDataCleanup
(
p
);
numOfRows
=
0
;
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
break
;
}
}
}
if
(
numOfRows
>
0
)
{
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
relocateColumnData
(
pInfo
->
pRes
,
pInfo
->
scanCols
,
p
->
pDataBlock
,
false
);
doFilterResult
(
pInfo
);
blockDataCleanup
(
p
);
numOfRows
=
0
;
}
blockDataDestroy
(
p
);
// todo temporarily free the cursor here, the true reason why the free is not valid needs to be found
if
(
ret
!=
0
)
{
metaCloseTbCursor
(
pInfo
->
pCur
);
...
...
@@ -2049,14 +2075,6 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
doSetOperatorCompleted
(
pOperator
);
}
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
relocateColumnData
(
pInfo
->
pRes
,
pInfo
->
scanCols
,
p
->
pDataBlock
,
false
);
doFilterResult
(
pInfo
);
blockDataDestroy
(
p
);
pInfo
->
loadInfo
.
totalRows
+=
pInfo
->
pRes
->
info
.
rows
;
return
(
pInfo
->
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
}
...
...
@@ -2213,10 +2231,34 @@ static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) {
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
false
);
if
(
++
numOfRows
>=
pOperator
->
resultInfo
.
capacity
)
{
break
;
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
relocateColumnData
(
pInfo
->
pRes
,
pInfo
->
scanCols
,
p
->
pDataBlock
,
false
);
doFilterResult
(
pInfo
);
blockDataCleanup
(
p
);
numOfRows
=
0
;
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
break
;
}
}
}
if
(
numOfRows
>
0
)
{
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
relocateColumnData
(
pInfo
->
pRes
,
pInfo
->
scanCols
,
p
->
pDataBlock
,
false
);
doFilterResult
(
pInfo
);
blockDataCleanup
(
p
);
numOfRows
=
0
;
}
blockDataDestroy
(
p
);
// todo temporarily free the cursor here, the true reason why the free is not valid needs to be found
if
(
ret
!=
0
)
{
metaCloseTbCursor
(
pInfo
->
pCur
);
...
...
@@ -2224,14 +2266,6 @@ static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) {
doSetOperatorCompleted
(
pOperator
);
}
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
relocateColumnData
(
pInfo
->
pRes
,
pInfo
->
scanCols
,
p
->
pDataBlock
,
false
);
doFilterResult
(
pInfo
);
blockDataDestroy
(
p
);
pInfo
->
loadInfo
.
totalRows
+=
pInfo
->
pRes
->
info
.
rows
;
return
(
pInfo
->
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
}
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
972ad9e7
...
...
@@ -1706,14 +1706,19 @@ void destroyStreamFinalIntervalOperatorInfo(void* param, int32_t numOfOutput) {
blockDataDestroy
(
pInfo
->
pPullDataRes
);
taosArrayDestroy
(
pInfo
->
pRecycledPages
);
blockDataDestroy
(
pInfo
->
pUpdateRes
);
taosArrayDestroy
(
pInfo
->
pDelWins
);
blockDataDestroy
(
pInfo
->
pDelRes
);
if
(
pInfo
->
pChildren
)
{
int32_t
size
=
taosArrayGetSize
(
pInfo
->
pChildren
);
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
SOperatorInfo
*
pChildOp
=
taosArrayGetP
(
pInfo
->
pChildren
,
i
);
destroyStreamFinalIntervalOperatorInfo
(
pChildOp
->
info
,
numOfOutput
);
taosMemoryFree
(
pChildOp
->
pDownstream
);
cleanupExprSupp
(
&
pChildOp
->
exprSupp
);
taosMemoryFreeClear
(
pChildOp
);
}
taosArrayDestroy
(
pInfo
->
pChildren
);
}
nodesDestroyNode
((
SNode
*
)
pInfo
->
pPhyNode
);
colDataDestroy
(
&
pInfo
->
twAggSup
.
timeWindowData
);
...
...
@@ -2644,7 +2649,6 @@ void destroyTimeSliceOperatorInfo(void* param, int32_t numOfOutput) {
taosMemoryFreeClear
(
param
);
}
SOperatorInfo
*
createTimeSliceOperatorInfo
(
SOperatorInfo
*
downstream
,
SPhysiNode
*
pPhyNode
,
SExecTaskInfo
*
pTaskInfo
)
{
STimeSliceOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
STimeSliceOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
...
...
source/libs/stream/src/streamTask.c
浏览文件 @
972ad9e7
...
...
@@ -152,11 +152,12 @@ int32_t tDecodeSStreamTask(SDecoder* pDecoder, SStreamTask* pTask) {
}
void
tFreeSStreamTask
(
SStreamTask
*
pTask
)
{
qDebug
(
"free stream task %d"
,
pTask
->
taskId
);
if
(
pTask
->
inputQueue
)
streamQueueClose
(
pTask
->
inputQueue
);
if
(
pTask
->
outputQueue
)
streamQueueClose
(
pTask
->
outputQueue
);
if
(
pTask
->
exec
.
qmsg
)
taosMemoryFree
(
pTask
->
exec
.
qmsg
);
if
(
pTask
->
exec
.
executor
)
qDestroyTask
(
pTask
->
exec
.
executor
);
taosArrayDestroy
(
pTask
->
childEpInfo
);
taosArrayDestroy
P
(
pTask
->
childEpInfo
,
taosMemoryFree
);
if
(
pTask
->
outputType
==
TASK_OUTPUT__TABLE
)
{
tDeleteSSchemaWrapper
(
pTask
->
tbSink
.
pSchemaWrapper
);
taosMemoryFree
(
pTask
->
tbSink
.
pTSchema
);
...
...
source/libs/transport/inc/transComm.h
浏览文件 @
972ad9e7
...
...
@@ -104,6 +104,12 @@ typedef void* queue[2];
#define TRANS_NOVALID_PACKET(src) ((src) != TRANS_MAGIC_NUM ? 1 : 0)
#define TRANS_PACKET_LIMIT 1024 * 1024 * 512
#define TRANS_MAGIC_NUM 0x5f375a86
#define TRANS_NOVALID_PACKET(src) ((src) != TRANS_MAGIC_NUM ? 1 : 0)
typedef
SRpcMsg
STransMsg
;
typedef
SRpcCtx
STransCtx
;
typedef
SRpcCtxVal
STransCtxVal
;
...
...
source/libs/transport/src/transCli.c
浏览文件 @
972ad9e7
...
...
@@ -318,10 +318,17 @@ void cliHandleResp(SCliConn* conn) {
}
STransMsgHead
*
pHead
=
NULL
;
transDumpFromBuffer
(
&
conn
->
readBuf
,
(
char
**
)
&
pHead
);
if
(
transDumpFromBuffer
(
&
conn
->
readBuf
,
(
char
**
)
&
pHead
)
<=
0
)
{
tDebug
(
"%s conn %p recv invalid packet "
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
return
;
}
pHead
->
code
=
htonl
(
pHead
->
code
);
pHead
->
msgLen
=
htonl
(
pHead
->
msgLen
);
if
(
cliRecvReleaseReq
(
conn
,
pHead
))
{
return
;
}
STransMsg
transMsg
=
{
0
};
transMsg
.
contLen
=
transContLenFromMsg
(
pHead
->
msgLen
);
transMsg
.
pCont
=
transContFromHead
((
char
*
)
pHead
);
...
...
@@ -333,10 +340,6 @@ void cliHandleResp(SCliConn* conn) {
SCliMsg
*
pMsg
=
NULL
;
STransConnCtx
*
pCtx
=
NULL
;
if
(
cliRecvReleaseReq
(
conn
,
pHead
))
{
return
;
}
if
(
CONN_NO_PERSIST_BY_APP
(
conn
))
{
pMsg
=
transQueuePop
(
&
conn
->
cliMsgs
);
...
...
@@ -598,7 +601,12 @@ static void cliRecvCb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
pBuf
->
len
+=
nread
;
while
(
transReadComplete
(
pBuf
))
{
tTrace
(
"%s conn %p read complete"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
cliHandleResp
(
conn
);
if
(
pBuf
->
invalid
)
{
cliHandleExcept
(
conn
);
break
;
}
else
{
cliHandleResp
(
conn
);
}
}
return
;
}
...
...
source/libs/transport/src/transComm.c
浏览文件 @
972ad9e7
...
...
@@ -188,7 +188,6 @@ bool transReadComplete(SConnBuffer* connBuf) {
p
->
left
=
0
;
}
}
return
(
p
->
left
==
0
||
p
->
invalid
)
?
true
:
false
;
}
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
972ad9e7
...
...
@@ -198,15 +198,16 @@ static bool uvHandleReq(SSvrConn* pConn) {
pHead
->
msgLen
=
htonl
(
pHead
->
msgLen
);
memcpy
(
pConn
->
user
,
pHead
->
user
,
strlen
(
pHead
->
user
));
if
(
uvRecvReleaseReq
(
pConn
,
pHead
))
{
return
true
;
}
// TODO(dengyihao): time-consuming task throwed into BG Thread
// uv_work_t* wreq = taosMemoryMalloc(sizeof(uv_work_t));
// wreq->data = pConn;
// uv_read_stop((uv_stream_t*)pConn->pTcp);
// transRefSrvHandle(pConn);
// uv_queue_work(((SWorkThrd*)pConn->hostThrd)->loop, wreq, uvWorkDoTask, uvWorkAfterTask);
if
(
uvRecvReleaseReq
(
pConn
,
pHead
))
{
return
true
;
}
STransMsg
transMsg
;
memset
(
&
transMsg
,
0
,
sizeof
(
transMsg
));
...
...
@@ -274,14 +275,16 @@ void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) {
if
(
pBuf
->
len
<=
TRANS_PACKET_LIMIT
)
{
while
(
transReadComplete
(
pBuf
))
{
tTrace
(
"%s conn %p alread read complete packet"
,
transLabel
(
pTransInst
),
conn
);
if
(
uvHandleReq
(
conn
)
==
false
)
{
if
(
pBuf
->
invalid
)
{
tTrace
(
"%s conn %p alread read invalid packet"
,
transLabel
(
pTransInst
),
conn
);
destroyConn
(
conn
,
true
);
return
;
}
else
{
if
(
false
==
uvHandleReq
(
conn
))
break
;
}
}
return
;
}
else
{
tError
(
"%s conn %p read unexpected packet, exceed limit"
,
transLabel
(
pTransInst
),
conn
);
destroyConn
(
conn
,
true
);
return
;
}
...
...
@@ -872,6 +875,7 @@ static int reallocConnRef(SSvrConn* conn) {
}
static
void
uvDestroyConn
(
uv_handle_t
*
handle
)
{
SSvrConn
*
conn
=
handle
->
data
;
if
(
conn
==
NULL
)
{
return
;
}
...
...
@@ -887,9 +891,8 @@ static void uvDestroyConn(uv_handle_t* handle) {
SSvrMsg
*
msg
=
transQueueGet
(
&
conn
->
srvMsgs
,
i
);
destroySmsg
(
msg
);
}
transReqQueueClear
(
&
conn
->
wreqQueue
);
transQueueDestroy
(
&
conn
->
srvMsgs
);
transReqQueueClear
(
&
conn
->
wreqQueue
);
QUEUE_REMOVE
(
&
conn
->
queue
);
taosMemoryFree
(
conn
->
pTcp
);
...
...
tests/script/tsim/stream/basic0.sim
浏览文件 @
972ad9e7
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/
exec.sh -n dnode1 -s start
s
leep 50
system sh/
cfg.sh -n dnode1 -c debugflag -v 131
s
ystem sh/exec.sh -n dnode1 -s start -v
sql connect
print =============== create database
...
...
@@ -137,4 +137,17 @@ if $data13 != 789 then
return -1
endi
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
print =============== check
$null=
system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
if $system_content > 0 then
return -1
endi
if $system_content == $null then
return -1
endi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录