Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c67fa0c1
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
c67fa0c1
编写于
7月 15, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: add taosd query exit processing
上级
41ba2979
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
16 deletion
+27
-16
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+1
-1
source/client/src/clientHb.c
source/client/src/clientHb.c
+3
-1
source/libs/qworker/inc/qwInt.h
source/libs/qworker/inc/qwInt.h
+2
-2
source/libs/qworker/src/qwUtil.c
source/libs/qworker/src/qwUtil.c
+17
-9
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+2
-2
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+1
-0
source/libs/transport/src/trans.c
source/libs/transport/src/trans.c
+1
-1
未找到文件。
include/libs/transport/trpc.h
浏览文件 @
c67fa0c1
...
...
@@ -135,7 +135,7 @@ void rpcSendRequestWithCtx(void *thandle, const SEpSet *pEpSet, SRpcMsg *pMsg
int32_t
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
void
rpcSendRecv
(
void
*
shandle
,
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
);
void
rpcSetDefaultAddr
(
void
*
thandle
,
const
char
*
ip
,
const
char
*
fqdn
);
int64_t
rpcAllocHandle
();
void
*
rpcAllocHandle
();
#ifdef __cplusplus
}
...
...
source/client/src/clientHb.c
浏览文件 @
c67fa0c1
...
...
@@ -171,6 +171,7 @@ static int32_t hbQueryHbRspHandle(SAppHbMgr *pAppHbMgr, SClientHbRsp *pRsp) {
pTscObj
->
pAppInfo
->
totalDnodes
=
pRsp
->
query
->
totalDnodes
;
pTscObj
->
pAppInfo
->
onlineDnodes
=
pRsp
->
query
->
onlineDnodes
;
pTscObj
->
connId
=
pRsp
->
query
->
connId
;
tscTrace
(
"conn %p hb rsp, dnodes %d/%d"
,
pTscObj
->
connId
,
pTscObj
->
pAppInfo
->
onlineDnodes
,
pTscObj
->
pAppInfo
->
totalDnodes
);
if
(
pRsp
->
query
->
killRid
)
{
tscDebug
(
"request rid %"
PRIx64
" need to be killed now"
,
pRsp
->
query
->
killRid
);
...
...
@@ -286,7 +287,8 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
taosMemoryFreeClear
(
param
);
if
(
code
!=
0
)
{
(
*
pInst
)
->
onlineDnodes
=
0
;
(
*
pInst
)
->
onlineDnodes
=
((
*
pInst
)
->
totalDnodes
?
0
:
-
1
);
tscDebug
(
"hb rsp error %s, update server status %d/%d"
,
tstrerror
(
code
),
(
*
pInst
)
->
onlineDnodes
,
(
*
pInst
)
->
totalDnodes
);
}
if
(
rspNum
)
{
...
...
source/libs/qworker/inc/qwInt.h
浏览文件 @
c67fa0c1
...
...
@@ -362,7 +362,7 @@ int32_t qwAcquireTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx **ctx);
int32_t
qwGetTaskCtx
(
QW_FPARAMS_DEF
,
SQWTaskCtx
**
ctx
);
int32_t
qwAddAcquireTaskCtx
(
QW_FPARAMS_DEF
,
SQWTaskCtx
**
ctx
);
void
qwReleaseTaskCtx
(
SQWorker
*
mgmt
,
void
*
ctx
);
int32_t
qwKillTaskHandle
(
QW_FPARAMS_DEF
,
SQWTaskCtx
*
ctx
);
int32_t
qwKillTaskHandle
(
SQWTaskCtx
*
ctx
);
int32_t
qwUpdateTaskStatus
(
QW_FPARAMS_DEF
,
int8_t
status
);
int32_t
qwDropTask
(
QW_FPARAMS_DEF
);
void
qwSaveTbVersionInfo
(
qTaskInfo_t
pTaskInfo
,
SQWTaskCtx
*
ctx
);
...
...
@@ -372,7 +372,7 @@ int32_t qwUpdateTimeInQueue(SQWorker *mgmt, int64_t ts, EQueueType type);
int64_t
qwGetTimeInQueue
(
SQWorker
*
mgmt
,
EQueueType
type
);
void
qwClearExpiredSch
(
SQWorker
*
mgmt
,
SArray
*
pExpiredSch
);
int32_t
qwAcquireScheduler
(
SQWorker
*
mgmt
,
uint64_t
sId
,
int32_t
rwType
,
SQWSchStatus
**
sch
);
void
qwFreeTaskCtx
(
QW_FPARAMS_DEF
,
SQWTaskCtx
*
ctx
);
void
qwFreeTaskCtx
(
SQWTaskCtx
*
ctx
);
void
qwDbgDumpMgmtInfo
(
SQWorker
*
mgmt
);
int32_t
qwDbgValidateStatus
(
QW_FPARAMS_DEF
,
int8_t
oriStatus
,
int8_t
newStatus
,
bool
*
ignore
);
...
...
source/libs/qworker/src/qwUtil.c
浏览文件 @
c67fa0c1
...
...
@@ -270,7 +270,7 @@ int32_t qwAddAcquireTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx **ctx) { return qwAddTask
void
qwReleaseTaskCtx
(
SQWorker
*
mgmt
,
void
*
ctx
)
{
taosHashRelease
(
mgmt
->
ctxHash
,
ctx
);
}
void
qwFreeTaskHandle
(
QW_FPARAMS_DEF
,
qTaskInfo_t
*
taskHandle
)
{
void
qwFreeTaskHandle
(
qTaskInfo_t
*
taskHandle
)
{
// Note: free/kill may in RC
qTaskInfo_t
otaskHandle
=
atomic_load_ptr
(
taskHandle
);
if
(
otaskHandle
&&
atomic_val_compare_exchange_ptr
(
taskHandle
,
otaskHandle
,
NULL
))
{
...
...
@@ -278,7 +278,7 @@ void qwFreeTaskHandle(QW_FPARAMS_DEF, qTaskInfo_t *taskHandle) {
}
}
int32_t
qwKillTaskHandle
(
QW_FPARAMS_DEF
,
SQWTaskCtx
*
ctx
)
{
int32_t
qwKillTaskHandle
(
SQWTaskCtx
*
ctx
)
{
int32_t
code
=
0
;
// Note: free/kill may in RC
qTaskInfo_t
taskHandle
=
atomic_load_ptr
(
&
ctx
->
taskHandle
);
...
...
@@ -290,7 +290,7 @@ int32_t qwKillTaskHandle(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
QW_RET
(
code
);
}
void
qwFreeTaskCtx
(
QW_FPARAMS_DEF
,
SQWTaskCtx
*
ctx
)
{
void
qwFreeTaskCtx
(
SQWTaskCtx
*
ctx
)
{
if
(
ctx
->
ctrlConnInfo
.
handle
)
{
tmsgReleaseHandle
(
&
ctx
->
ctrlConnInfo
,
TAOS_CONN_SERVER
);
}
...
...
@@ -300,7 +300,7 @@ void qwFreeTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
// NO need to release dataConnInfo
qwFreeTaskHandle
(
QW_FPARAMS
(),
&
ctx
->
taskHandle
);
qwFreeTaskHandle
(
&
ctx
->
taskHandle
);
if
(
ctx
->
sinkHandle
)
{
dsDestroyDataSinker
(
ctx
->
sinkHandle
);
...
...
@@ -336,7 +336,7 @@ int32_t qwDropTaskCtx(QW_FPARAMS_DEF) {
QW_ERR_RET
(
TSDB_CODE_QRY_TASK_CTX_NOT_EXIST
);
}
qwFreeTaskCtx
(
QW_FPARAMS
(),
&
octx
);
qwFreeTaskCtx
(
&
octx
);
QW_TASK_DLOG_E
(
"task ctx dropped"
);
...
...
@@ -463,13 +463,21 @@ void qwDestroyImpl(void *pMgmt) {
mgmt
->
hbTimer
=
NULL
;
taosTmrCleanUp
(
mgmt
->
timer
);
// TODO STOP ALL QUERY
// TODO FREE ALL
uint64_t
qId
,
tId
;
int32_t
eId
;
void
*
pIter
=
taosHashIterate
(
mgmt
->
ctxHash
,
NULL
);
while
(
pIter
)
{
SQWTaskCtx
*
ctx
=
(
SQWTaskCtx
*
)
pIter
;
void
*
key
=
taosHashGetKey
(
pIter
,
NULL
);
QW_GET_QTID
(
key
,
qId
,
tId
,
eId
);
qwFreeTaskCtx
(
ctx
);
QW_TASK_DLOG
(
"task ctx freed"
);
pIter
=
taosHashIterate
(
mgmt
->
ctxHash
,
pIter
);
}
taosHashCleanup
(
mgmt
->
ctxHash
);
void
*
pIter
=
taosHashIterate
(
mgmt
->
schHash
,
NULL
);
pIter
=
taosHashIterate
(
mgmt
->
schHash
,
NULL
);
while
(
pIter
)
{
SQWSchStatus
*
sch
=
(
SQWSchStatus
*
)
pIter
;
qwDestroySchStatus
(
sch
);
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
c67fa0c1
...
...
@@ -726,7 +726,7 @@ int32_t qwProcessDrop(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
}
if
(
QW_QUERY_RUNNING
(
ctx
))
{
QW_ERR_JRET
(
qwKillTaskHandle
(
QW_FPARAMS
(),
ctx
));
QW_ERR_JRET
(
qwKillTaskHandle
(
ctx
));
qwUpdateTaskStatus
(
QW_FPARAMS
(),
JOB_TASK_STATUS_DROP
);
}
else
if
(
QW_GET_PHASE
(
ctx
)
>
0
)
{
QW_ERR_JRET
(
qwDropTask
(
QW_FPARAMS
()));
...
...
@@ -940,7 +940,7 @@ int32_t qwProcessDelete(QW_FPARAMS_DEF, SQWMsg *qwMsg, SDeleteRes *pRes) {
_return:
qwFreeTaskCtx
(
QW_FPARAMS
(),
&
ctx
);
qwFreeTaskCtx
(
&
ctx
);
QW_RET
(
TSDB_CODE_SUCCESS
);
}
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
c67fa0c1
...
...
@@ -1010,6 +1010,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr,
memcpy
(
pMsg
->
msg
+
len
,
pTask
->
msg
,
pTask
->
msgLen
);
persistHandle
=
true
;
SCH_SET_TASK_HANDLE
(
pTask
,
rpcAllocHandle
());
break
;
}
case
TDMT_SCH_FETCH
:
...
...
source/libs/transport/src/trans.c
浏览文件 @
c67fa0c1
...
...
@@ -170,7 +170,7 @@ void rpcSetDefaultAddr(void* thandle, const char* ip, const char* fqdn) {
transSetDefaultAddr
(
thandle
,
ip
,
fqdn
);
}
int64_t
rpcAllocHandle
()
{
return
transAllocHandle
();
}
void
*
rpcAllocHandle
()
{
return
(
void
*
)
transAllocHandle
();
}
int32_t
rpcInit
()
{
transInit
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录