Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ed5b2832
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看板
提交
ed5b2832
编写于
3月 23, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/scheduler
上级
f6b5bfae
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
48 addition
and
40 deletion
+48
-40
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+7
-7
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+4
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+2
-0
source/libs/scheduler/inc/schedulerInt.h
source/libs/scheduler/inc/schedulerInt.h
+1
-0
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+21
-15
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+6
-6
source/libs/transport/test/transportTests.cc
source/libs/transport/test/transportTests.cc
+6
-12
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+1
-0
未找到文件。
include/libs/transport/trpc.h
浏览文件 @
ed5b2832
...
...
@@ -81,16 +81,16 @@ typedef struct SRpcInit {
}
SRpcInit
;
typedef
struct
{
void
*
val
;
int32_t
len
;
void
(
*
free
)(
void
*
arg
);
void
*
val
;
int32_t
(
*
clone
)(
void
*
src
,
void
**
dst
)
;
void
(
*
free
)(
void
*
arg
);
}
SRpcCtxVal
;
typedef
struct
{
int32_t
msgType
;
void
*
val
;
int32_t
len
;
void
(
*
free
)(
void
*
arg
);
int32_t
msgType
;
void
*
val
;
int32_t
(
*
clone
)(
void
*
src
,
void
**
dst
)
;
void
(
*
free
)(
void
*
arg
);
}
SRpcBrokenlinkVal
;
typedef
struct
{
...
...
source/client/src/clientEnv.c
浏览文件 @
ed5b2832
...
...
@@ -185,6 +185,10 @@ static void doDestroyRequest(void *p) {
doFreeReqResultInfo
(
&
pRequest
->
body
.
resInfo
);
qDestroyQueryPlan
(
pRequest
->
body
.
pDag
);
if
(
pRequest
->
body
.
queryJob
!=
0
)
{
schedulerFreeJob
(
pRequest
->
body
.
queryJob
);
}
if
(
pRequest
->
body
.
showInfo
.
pArray
!=
NULL
)
{
taosArrayDestroy
(
pRequest
->
body
.
showInfo
.
pArray
);
}
...
...
source/client/src/clientImpl.c
浏览文件 @
ed5b2832
...
...
@@ -330,6 +330,8 @@ SRequestObj* execQuery(STscObj* pTscObj, const char* sql, int sqlLen) {
pRequest
->
code
=
code
;
break
;
}
destroyRequest
(
pRequest
);
}
return
pRequest
;
...
...
source/libs/scheduler/inc/schedulerInt.h
浏览文件 @
ed5b2832
...
...
@@ -241,6 +241,7 @@ int32_t schLaunchTaskImpl(SSchJob *pJob, SSchTask *pTask);
int32_t
schFetchFromRemote
(
SSchJob
*
pJob
);
int32_t
schProcessOnTaskFailure
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
int32_t
errCode
);
int32_t
schBuildAndSendHbMsg
(
SQueryNodeEpId
*
nodeEpId
);
int32_t
schCloneSMsgSendInfo
(
void
*
src
,
void
**
dst
);
#ifdef __cplusplus
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
ed5b2832
...
...
@@ -1172,6 +1172,8 @@ int32_t schHandleHbCallback(void *param, const SDataBuf *pMsg, int32_t code) {
}
// TODO
SCH_JOB_DLOG
(
"TID:0x%"
PRIx64
" task status in server: %s"
,
taskStatus
->
taskId
,
jobTaskStatusStr
(
taskStatus
->
status
));
schReleaseJob
(
taskStatus
->
refId
);
}
...
...
@@ -1309,7 +1311,7 @@ int32_t schMakeBrokenLinkVal(SSchJob *pJob, SSchTask *pTask, SRpcBrokenlinkVal *
brokenVal
->
msgType
=
msgType
;
brokenVal
->
val
=
pMsgSendInfo
;
brokenVal
->
len
=
sizeof
(
SMsgSendInfo
)
;
brokenVal
->
clone
=
schCloneSMsgSendInfo
;
brokenVal
->
free
=
schFreeRpcCtxVal
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1357,7 +1359,7 @@ int32_t schMakeQueryRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx) {
pMsgSendInfo
->
param
=
param
;
pMsgSendInfo
->
fp
=
fp
;
SRpcCtxVal
ctxVal
=
{.
val
=
pMsgSendInfo
,
.
len
=
sizeof
(
SMsgSendInfo
)
,
.
free
=
schFreeRpcCtxVal
};
SRpcCtxVal
ctxVal
=
{.
val
=
pMsgSendInfo
,
.
clone
=
schCloneSMsgSendInfo
,
.
free
=
schFreeRpcCtxVal
};
if
(
taosHashPut
(
pCtx
->
args
,
&
msgType
,
sizeof
(
msgType
),
&
ctxVal
,
sizeof
(
ctxVal
)))
{
SCH_TASK_ELOG
(
"taosHashPut msg %d to rpcCtx failed"
,
msgType
);
SCH_ERR_JRET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
...
...
@@ -1414,7 +1416,7 @@ int32_t schMakeHbRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx) {
pMsgSendInfo
->
param
=
param
;
pMsgSendInfo
->
fp
=
fp
;
SRpcCtxVal
ctxVal
=
{.
val
=
pMsgSendInfo
,
.
len
=
sizeof
(
SMsgSendInfo
)
,
.
free
=
schFreeRpcCtxVal
};
SRpcCtxVal
ctxVal
=
{.
val
=
pMsgSendInfo
,
.
clone
=
schCloneSMsgSendInfo
,
.
free
=
schFreeRpcCtxVal
};
if
(
taosHashPut
(
pCtx
->
args
,
&
msgType
,
sizeof
(
msgType
),
&
ctxVal
,
sizeof
(
ctxVal
)))
{
SCH_TASK_ELOG
(
"taosHashPut msg %d to rpcCtx failed"
,
msgType
);
SCH_ERR_JRET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
...
...
@@ -1486,26 +1488,27 @@ int32_t schCloneCallbackParam(SSchCallbackParamHeader *pSrc, SSchCallbackParamHe
return
TSDB_CODE_SUCCESS
;
}
int32_t
schCloneSMsgSendInfo
(
SMsgSendInfo
*
pSrc
,
SMsgSendInfo
**
pDst
)
{
int32_t
schCloneSMsgSendInfo
(
void
*
src
,
void
**
dst
)
{
SMsgSendInfo
*
pSrc
=
src
;
int32_t
code
=
0
;
SMsgSendInfo
*
d
st
=
malloc
(
sizeof
(
*
pSrc
));
if
(
NULL
==
d
st
)
{
SMsgSendInfo
*
pD
st
=
malloc
(
sizeof
(
*
pSrc
));
if
(
NULL
==
pD
st
)
{
qError
(
"malloc SMsgSendInfo for rpcCtx failed, len:%d"
,
(
int32_t
)
sizeof
(
*
pSrc
));
SCH_ERR_RET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
}
memcpy
(
d
st
,
pSrc
,
sizeof
(
*
pSrc
));
d
st
->
param
=
NULL
;
memcpy
(
pD
st
,
pSrc
,
sizeof
(
*
pSrc
));
pD
st
->
param
=
NULL
;
SCH_ERR_JRET
(
schCloneCallbackParam
(
pSrc
->
param
,
(
SSchCallbackParamHeader
**
)
&
d
st
->
param
));
SCH_ERR_JRET
(
schCloneCallbackParam
(
pSrc
->
param
,
(
SSchCallbackParamHeader
**
)
&
pD
st
->
param
));
*
pDst
=
d
st
;
*
dst
=
pD
st
;
return
TSDB_CODE_SUCCESS
;
_return:
tfree
(
d
st
);
tfree
(
pD
st
);
SCH_RET
(
code
);
}
...
...
@@ -1514,7 +1517,7 @@ int32_t schCloneHbRpcCtx(SRpcCtx *pSrc, SRpcCtx *pDst) {
memcpy
(
&
pDst
->
brokenVal
,
&
pSrc
->
brokenVal
,
sizeof
(
pSrc
->
brokenVal
));
pDst
->
brokenVal
.
val
=
NULL
;
SCH_ERR_RET
(
schCloneSMsgSendInfo
(
pSrc
->
brokenVal
.
val
,
(
SMsgSendInfo
**
)
&
pDst
->
brokenVal
.
val
));
SCH_ERR_RET
(
schCloneSMsgSendInfo
(
pSrc
->
brokenVal
.
val
,
&
pDst
->
brokenVal
.
val
));
pDst
->
args
=
taosHashInit
(
1
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
false
,
HASH_ENTRY_LOCK
);
if
(
NULL
==
pDst
->
args
)
{
...
...
@@ -1528,9 +1531,12 @@ int32_t schCloneHbRpcCtx(SRpcCtx *pSrc, SRpcCtx *pDst) {
SRpcCtxVal
*
pVal
=
(
SRpcCtxVal
*
)
pIter
;
int32_t
*
msgType
=
taosHashGetKey
(
pIter
,
NULL
);
SCH_ERR_JRET
(
schCloneSMsgSendInfo
(
pVal
->
val
,
(
SMsgSendInfo
**
)
&
dst
.
val
));
dst
=
*
pVal
;
dst
.
val
=
NULL
;
SCH_ERR_JRET
(
schCloneSMsgSendInfo
(
pVal
->
val
,
&
dst
.
val
));
if
(
taosHashPut
(
pDst
->
args
,
msgType
,
sizeof
(
*
msgType
),
pVal
,
sizeof
(
*
pVal
)))
{
if
(
taosHashPut
(
pDst
->
args
,
msgType
,
sizeof
(
*
msgType
),
&
dst
,
sizeof
(
dst
)))
{
qError
(
"taosHashPut msg %d to rpcCtx failed"
,
*
msgType
);
(
*
dst
.
free
)(
dst
.
val
);
SCH_ERR_JRET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
...
...
@@ -2047,7 +2053,7 @@ void schFreeJobImpl(void *job) {
taosArrayDestroy
(
pJob
->
nodeList
);
tfree
(
pJob
->
resData
);
t
free
(
pJob
);
free
(
pJob
);
qDebug
(
"QID:0x%"
PRIx64
" job freed, refId:%"
PRIx64
", pointer:%p"
,
queryId
,
refId
,
pJob
);
}
...
...
source/libs/transport/src/transComm.c
浏览文件 @
ed5b2832
...
...
@@ -273,17 +273,17 @@ void* transCtxDumpVal(STransCtx* ctx, int32_t key) {
if
(
cVal
==
NULL
)
{
return
NULL
;
}
char
*
ret
=
calloc
(
1
,
cVal
->
len
)
;
memcpy
(
ret
,
(
char
*
)
cVal
->
val
,
cVal
->
len
);
return
(
void
*
)
ret
;
void
*
ret
=
NULL
;
(
*
cVal
->
clone
)(
cVal
->
val
,
&
ret
);
return
ret
;
}
void
*
transCtxDumpBrokenlinkVal
(
STransCtx
*
ctx
,
int32_t
*
msgType
)
{
char
*
ret
=
calloc
(
1
,
ctx
->
brokenVal
.
len
);
void
*
ret
=
NULL
;
(
*
ctx
->
brokenVal
.
clone
)(
ctx
->
brokenVal
.
val
,
&
ret
);
memcpy
(
ret
,
(
char
*
)(
ctx
->
brokenVal
.
val
),
ctx
->
brokenVal
.
len
);
*
msgType
=
ctx
->
brokenVal
.
msgType
;
return
(
void
*
)
ret
;
return
ret
;
}
void
transQueueInit
(
STransQueue
*
queue
,
void
(
*
free
)(
void
*
arg
))
{
...
...
source/libs/transport/test/transportTests.cc
浏览文件 @
ed5b2832
...
...
@@ -156,17 +156,15 @@ TEST_F(TransCtxEnv, mergeTest) {
STransCtx
*
src
=
(
STransCtx
*
)
calloc
(
1
,
sizeof
(
STransCtx
));
transCtxInit
(
src
);
{
STransCtxVal
val1
=
{.
val
=
NULL
,
.
len
=
0
,
.
free
=
free
};
STransCtxVal
val1
=
{.
val
=
NULL
,
.
free
=
free
};
val1
.
val
=
malloc
(
12
);
val1
.
len
=
12
;
taosHashPut
(
src
->
args
,
&
key
,
sizeof
(
key
),
&
val1
,
sizeof
(
val1
));
key
++
;
}
{
STransCtxVal
val1
=
{.
val
=
NULL
,
.
len
=
0
,
.
free
=
free
};
STransCtxVal
val1
=
{.
val
=
NULL
,
.
free
=
free
};
val1
.
val
=
malloc
(
12
);
val1
.
len
=
12
;
taosHashPut
(
src
->
args
,
&
key
,
sizeof
(
key
),
&
val1
,
sizeof
(
val1
));
key
++
;
}
...
...
@@ -178,17 +176,15 @@ TEST_F(TransCtxEnv, mergeTest) {
STransCtx
*
src
=
(
STransCtx
*
)
calloc
(
1
,
sizeof
(
STransCtx
));
transCtxInit
(
src
);
{
STransCtxVal
val1
=
{.
val
=
NULL
,
.
len
=
0
,
.
free
=
free
};
STransCtxVal
val1
=
{.
val
=
NULL
,
.
free
=
free
};
val1
.
val
=
malloc
(
12
);
val1
.
len
=
12
;
taosHashPut
(
src
->
args
,
&
key
,
sizeof
(
key
),
&
val1
,
sizeof
(
val1
));
key
++
;
}
{
STransCtxVal
val1
=
{.
val
=
NULL
,
.
len
=
0
,
.
free
=
free
};
STransCtxVal
val1
=
{.
val
=
NULL
,
.
free
=
free
};
val1
.
val
=
malloc
(
12
);
val1
.
len
=
12
;
taosHashPut
(
src
->
args
,
&
key
,
sizeof
(
key
),
&
val1
,
sizeof
(
val1
));
key
++
;
}
...
...
@@ -202,19 +198,17 @@ TEST_F(TransCtxEnv, mergeTest) {
STransCtx
*
src
=
(
STransCtx
*
)
calloc
(
1
,
sizeof
(
STransCtx
));
transCtxInit
(
src
);
{
STransCtxVal
val1
=
{.
val
=
NULL
,
.
len
=
0
,
.
free
=
free
};
STransCtxVal
val1
=
{.
val
=
NULL
,
.
free
=
free
};
val1
.
val
=
calloc
(
1
,
11
);
memcpy
(
val1
.
val
,
val
.
c_str
(),
val
.
size
());
val1
.
len
=
11
;
taosHashPut
(
src
->
args
,
&
key
,
sizeof
(
key
),
&
val1
,
sizeof
(
val1
));
key
++
;
}
{
STransCtxVal
val1
=
{.
val
=
NULL
,
.
len
=
0
,
.
free
=
free
};
STransCtxVal
val1
=
{.
val
=
NULL
,
.
free
=
free
};
val1
.
val
=
calloc
(
1
,
11
);
memcpy
(
val1
.
val
,
val
.
c_str
(),
val
.
size
());
val1
.
len
=
11
;
taosHashPut
(
src
->
args
,
&
key
,
sizeof
(
key
),
&
val1
,
sizeof
(
val1
));
key
++
;
}
...
...
tools/shell/src/shellEngine.c
浏览文件 @
ed5b2832
...
...
@@ -358,6 +358,7 @@ void shellRunCommandOnServer(TAOS *con, char command[]) {
}
else
{
printf
(
"Query interrupted (%s), %d row(s) in set (%.6fs)
\n
"
,
taos_errstr
(
pSql
),
numOfRows
,
(
et
-
st
)
/
1E6
);
}
taos_free_result
(
pSql
);
}
else
{
int
num_rows_affacted
=
taos_affected_rows
(
pSql
);
taos_free_result
(
pSql
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录