Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b864da2a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
b864da2a
编写于
6月 17, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix app release issue
上级
f0c53fb9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
12 deletion
+13
-12
include/common/tmsg.h
include/common/tmsg.h
+1
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-2
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+9
-8
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
b864da2a
...
...
@@ -1322,7 +1322,7 @@ int32_t tSerializeSKillQueryReq(void* buf, int32_t bufLen, SKillQueryReq* pReq);
int32_t
tDeserializeSKillQueryReq
(
void
*
buf
,
int32_t
bufLen
,
SKillQueryReq
*
pReq
);
typedef
struct
{
int32_t
connId
;
u
int32_t
connId
;
}
SKillConnReq
;
int32_t
tSerializeSKillConnReq
(
void
*
buf
,
int32_t
bufLen
,
SKillConnReq
*
pReq
);
...
...
source/common/src/tmsg.c
浏览文件 @
b864da2a
...
...
@@ -3432,7 +3432,7 @@ int32_t tSerializeSKillConnReq(void *buf, int32_t bufLen, SKillConnReq *pReq) {
tEncoderInit
(
&
encoder
,
buf
,
bufLen
);
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncode
I
32
(
&
encoder
,
pReq
->
connId
)
<
0
)
return
-
1
;
if
(
tEncode
U
32
(
&
encoder
,
pReq
->
connId
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -3445,7 +3445,7 @@ int32_t tDeserializeSKillConnReq(void *buf, int32_t bufLen, SKillConnReq *pReq)
tDecoderInit
(
&
decoder
,
buf
,
bufLen
);
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecode
I
32
(
&
decoder
,
&
pReq
->
connId
)
<
0
)
return
-
1
;
if
(
tDecode
U
32
(
&
decoder
,
&
pReq
->
connId
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tDecoderClear
(
&
decoder
);
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
b864da2a
...
...
@@ -76,7 +76,7 @@ int32_t mndInitProfile(SMnode *pMnode) {
// in ms
int32_t
checkTime
=
tsShellActivityTimer
*
2
*
1000
;
pMgmt
->
connCache
=
taosCacheInit
(
TSDB_DATA_TYPE_INT
,
checkTime
,
true
,
(
__cache_free_fn_t
)
mndFreeConn
,
"conn"
);
pMgmt
->
connCache
=
taosCacheInit
(
TSDB_DATA_TYPE_
U
INT
,
checkTime
,
true
,
(
__cache_free_fn_t
)
mndFreeConn
,
"conn"
);
if
(
pMgmt
->
connCache
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
mError
(
"failed to alloc profile cache since %s"
,
terrstr
());
...
...
@@ -124,7 +124,7 @@ static SConnObj *mndCreateConn(SMnode *pMnode, const char *user, int8_t connType
char
connStr
[
255
]
=
{
0
};
int32_t
len
=
snprintf
(
connStr
,
sizeof
(
connStr
),
"%s%d%d%d%s"
,
user
,
ip
,
port
,
pid
,
app
);
int32_t
connId
=
mndGenerateUid
(
connStr
,
len
);
u
int32_t
connId
=
mndGenerateUid
(
connStr
,
len
);
if
(
startTime
==
0
)
startTime
=
taosGetTimestampMs
();
SConnObj
connObj
=
{.
id
=
connId
,
...
...
@@ -145,7 +145,7 @@ static SConnObj *mndCreateConn(SMnode *pMnode, const char *user, int8_t connType
tstrncpy
(
connObj
.
app
,
app
,
TSDB_APP_NAME_LEN
);
int32_t
keepTime
=
tsShellActivityTimer
*
3
;
SConnObj
*
pConn
=
taosCachePut
(
pMgmt
->
connCache
,
&
connId
,
sizeof
(
int32_t
),
&
connObj
,
sizeof
(
connObj
),
keepTime
*
1000
);
SConnObj
*
pConn
=
taosCachePut
(
pMgmt
->
connCache
,
&
connId
,
sizeof
(
u
int32_t
),
&
connObj
,
sizeof
(
connObj
),
keepTime
*
1000
);
if
(
pConn
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
mError
(
"conn:%d, failed to put into cache since %s, user:%s"
,
connId
,
user
,
terrstr
());
...
...
@@ -448,6 +448,7 @@ static int32_t mndUpdateAppInfo(SMnode *pMnode, SClientHbReq *pHbReq, SRpcConnIn
return
-
1
;
}
else
{
mDebug
(
"a new app %"
PRIx64
"created"
,
pReq
->
appId
);
mndReleaseApp
(
pMnode
,
pApp
);
return
TSDB_CODE_SUCCESS
;
}
}
...
...
@@ -463,7 +464,7 @@ static int32_t mndProcessQueryHeartBeat(SMnode *pMnode, SRpcMsg *pMsg, SClientHb
SClientHbBatchRsp
*
pBatchRsp
)
{
SProfileMgmt
*
pMgmt
=
&
pMnode
->
profileMgmt
;
SClientHbRsp
hbRsp
=
{.
connKey
=
pHbReq
->
connKey
,
.
status
=
0
,
.
info
=
NULL
,
.
query
=
NULL
};
SRpcConnInfo
connInfo
=
pMsg
->
conn
;
SRpcConnInfo
connInfo
=
pMsg
->
info
.
conn
;
mndUpdateAppInfo
(
pMnode
,
pHbReq
,
&
connInfo
);
...
...
@@ -654,7 +655,7 @@ static int32_t mndProcessKillQueryReq(SRpcMsg *pReq) {
terrno
=
TSDB_CODE_MND_INVALID_CONN_ID
;
return
-
1
;
}
else
{
mInfo
(
"connId:%x, queryId:%"
PRIx64
" is killed by user:%s"
,
connId
,
queryId
,
pReq
->
conn
.
user
);
mInfo
(
"connId:%x, queryId:%"
PRIx64
" is killed by user:%s"
,
connId
,
queryId
,
pReq
->
info
.
conn
.
user
);
pConn
->
killId
=
queryId
;
taosCacheRelease
(
pMgmt
->
connCache
,
(
void
**
)
&
pConn
,
false
);
return
0
;
...
...
@@ -680,13 +681,13 @@ static int32_t mndProcessKillConnReq(SRpcMsg *pReq) {
return
-
1
;
}
SConnObj
*
pConn
=
taosCacheAcquireByKey
(
pMgmt
->
connCache
,
&
killReq
.
connId
,
sizeof
(
int32_t
));
SConnObj
*
pConn
=
taosCacheAcquireByKey
(
pMgmt
->
connCache
,
&
killReq
.
connId
,
sizeof
(
u
int32_t
));
if
(
pConn
==
NULL
)
{
mError
(
"connId:%
d
, failed to kill connection, conn not exist"
,
killReq
.
connId
);
mError
(
"connId:%
u
, failed to kill connection, conn not exist"
,
killReq
.
connId
);
terrno
=
TSDB_CODE_MND_INVALID_CONN_ID
;
return
-
1
;
}
else
{
mInfo
(
"connId:%
d
, is killed by user:%s"
,
killReq
.
connId
,
pReq
->
info
.
conn
.
user
);
mInfo
(
"connId:%
u
, is killed by user:%s"
,
killReq
.
connId
,
pReq
->
info
.
conn
.
user
);
pConn
->
killed
=
1
;
taosCacheRelease
(
pMgmt
->
connCache
,
(
void
**
)
&
pConn
,
false
);
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
b864da2a
...
...
@@ -3890,7 +3890,7 @@ static int32_t translateDescribe(STranslateContext* pCxt, SDescribeStmt* pStmt)
static
int32_t
translateKillConnection
(
STranslateContext
*
pCxt
,
SKillStmt
*
pStmt
)
{
SKillConnReq
killReq
=
{
0
};
killReq
.
connId
=
pStmt
->
targetId
;
return
buildCmdMsg
(
pCxt
,
TDMT_MND_KILL_CONN
,
(
FSerializeFunc
)
tSerializeSKill
Query
Req
,
&
killReq
);
return
buildCmdMsg
(
pCxt
,
TDMT_MND_KILL_CONN
,
(
FSerializeFunc
)
tSerializeSKill
Conn
Req
,
&
killReq
);
}
static
int32_t
translateKillQuery
(
STranslateContext
*
pCxt
,
SKillQueryStmt
*
pStmt
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录