Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9c717d9c
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
9c717d9c
编写于
12月 30, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
85e0f135
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
20 addition
and
18 deletion
+20
-18
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+20
-18
未找到文件。
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
9c717d9c
...
...
@@ -68,11 +68,11 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SShowMsg *pMsg) {
SShowObj
*
pShow
=
taosCachePut
(
pMgmt
->
cache
,
&
showId
,
sizeof
(
int64_t
),
&
showObj
,
size
,
keepTime
);
if
(
pShow
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
mError
(
"show:0x%"
PRIx64
", failed to put into cache since %s"
,
showId
,
terrstr
());
mError
(
"show:0x%"
PRIx64
", failed to put into cache since %s"
,
showId
,
terrstr
());
return
NULL
;
}
mTrace
(
"show:0x%"
PRIx64
", is created, data:%p"
,
showId
,
pShow
);
mTrace
(
"show:0x%"
PRIx64
", is created, data:%p"
,
showId
,
pShow
);
return
pShow
;
}
...
...
@@ -87,7 +87,7 @@ static void mndFreeShowObj(SShowObj *pShow) {
}
}
mTrace
(
"show:0x%
d
, is destroyed, data:%p"
,
pShow
->
id
,
pShow
);
mTrace
(
"show:0x%
"
PRIx64
"
, is destroyed, data:%p"
,
pShow
->
id
,
pShow
);
}
static
SShowObj
*
mndAcquireShowObj
(
SMnode
*
pMnode
,
int64_t
showId
)
{
...
...
@@ -95,17 +95,17 @@ static SShowObj *mndAcquireShowObj(SMnode *pMnode, int64_t showId) {
SShowObj
*
pShow
=
taosCacheAcquireByKey
(
pMgmt
->
cache
,
&
showId
,
sizeof
(
showId
));
if
(
pShow
==
NULL
)
{
mError
(
"show:0x%"
PRIx64
", already destroyed"
,
showId
);
mError
(
"show:0x%"
PRIx64
", already destroyed"
,
showId
);
return
NULL
;
}
mTrace
(
"show:0x%"
PRIx64
", acquired from cache, data:%p"
,
pShow
->
id
,
pShow
);
mTrace
(
"show:0x%"
PRIx64
", acquired from cache, data:%p"
,
pShow
->
id
,
pShow
);
return
pShow
;
}
static
void
mndReleaseShowObj
(
SShowObj
*
pShow
,
bool
forceRemove
)
{
if
(
pShow
==
NULL
)
return
;
mTrace
(
"show:0x%"
PRIx64
", released from cache, data:%p force:%d"
,
pShow
->
id
,
pShow
,
forceRemove
);
mTrace
(
"show:0x%"
PRIx64
", released from cache, data:%p force:%d"
,
pShow
->
id
,
pShow
,
forceRemove
);
// A bug in tcache.c
forceRemove
=
0
;
...
...
@@ -146,12 +146,13 @@ static int32_t mndProcessShowMsg(SMnodeMsg *pMnodeMsg) {
if
(
pRsp
==
NULL
)
{
mndReleaseShowObj
(
pShow
,
true
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
mError
(
"show:0x%"
PRIx64
", failed to process show-meta msg:%s since malloc rsp error"
,
pShow
->
id
,
mndShowStr
(
type
));
mError
(
"show:0x%"
PRIx64
", failed to process show-meta msg:%s since malloc rsp error"
,
pShow
->
id
,
mndShowStr
(
type
));
return
-
1
;
}
int32_t
code
=
(
*
metaFp
)(
pMnodeMsg
,
pShow
,
&
pRsp
->
tableMeta
);
mDebug
(
"show:0x%"
PRIx64
", get meta finished, numOfRows:%d cols:%d type:%s result:%s"
,
pShow
->
id
,
pShow
->
numOfRows
,
mDebug
(
"show:0x%"
PRIx64
", get meta finished, numOfRows:%d cols:%d type:%s result:%s"
,
pShow
->
id
,
pShow
->
numOfRows
,
pShow
->
numOfColumns
,
mndShowStr
(
type
),
tstrerror
(
code
));
if
(
code
==
TSDB_CODE_SUCCESS
)
{
...
...
@@ -188,15 +189,16 @@ static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMnodeMsg) {
if
(
retrieveFp
==
NULL
)
{
mndReleaseShowObj
(
pShow
,
false
);
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
mError
(
"show:0x%"
PRIx64
", failed to retrieve data since %s"
,
pShow
->
id
,
terrstr
());
mError
(
"show:0x%"
PRIx64
", failed to retrieve data since %s"
,
pShow
->
id
,
terrstr
());
return
-
1
;
}
mDebug
(
"show:0x%"
PRIx64
", start retrieve data, numOfReads:%d numOfRows:%d type:%s"
,
pShow
->
id
,
pShow
->
numOfReads
,
mDebug
(
"show:0x%"
PRIx64
", start retrieve data, numOfReads:%d numOfRows:%d type:%s"
,
pShow
->
id
,
pShow
->
numOfReads
,
pShow
->
numOfRows
,
mndShowStr
(
pShow
->
type
));
if
(
mndCheckRetrieveFinished
(
pShow
))
{
mDebug
(
"show:0x%"
PRIx64
", read finished, numOfReads:%d numOfRows:%d"
,
pShow
->
id
,
pShow
->
numOfReads
,
pShow
->
numOfRows
);
mDebug
(
"show:0x%"
PRIx64
", read finished, numOfReads:%d numOfRows:%d"
,
pShow
->
id
,
pShow
->
numOfReads
,
pShow
->
numOfRows
);
pShow
->
numOfReads
=
pShow
->
numOfRows
;
}
...
...
@@ -219,7 +221,7 @@ static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMnodeMsg) {
if
(
pRsp
==
NULL
)
{
mndReleaseShowObj
(
pShow
,
false
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
mError
(
"show:0x%"
PRIx64
", failed to retrieve data since %s"
,
pShow
->
id
,
terrstr
());
mError
(
"show:0x%"
PRIx64
", failed to retrieve data since %s"
,
pShow
->
id
,
terrstr
());
return
-
1
;
}
...
...
@@ -228,7 +230,7 @@ static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMnodeMsg) {
rowsRead
=
(
*
retrieveFp
)(
pMnodeMsg
,
pShow
,
pRsp
->
data
,
rowsToRead
);
}
mDebug
(
"show:0x%"
PRIx64
", stop retrieve data, rowsRead:%d rowsToRead:%d"
,
pShow
->
id
,
rowsRead
,
rowsToRead
);
mDebug
(
"show:0x%"
PRIx64
", stop retrieve data, rowsRead:%d rowsToRead:%d"
,
pShow
->
id
,
rowsRead
,
rowsToRead
);
pRsp
->
numOfRows
=
htonl
(
rowsRead
);
pRsp
->
precision
=
TSDB_TIME_PRECISION_MILLI
;
// millisecond time precision
...
...
@@ -238,10 +240,10 @@ static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMnodeMsg) {
if
(
rowsRead
==
0
||
rowsToRead
==
0
||
(
rowsRead
==
rowsToRead
&&
pShow
->
numOfRows
==
pShow
->
numOfReads
))
{
pRsp
->
completed
=
1
;
mDebug
(
"show:0x%"
PRIx64
", retrieve completed"
,
pShow
->
id
);
mDebug
(
"show:0x%"
PRIx64
", retrieve completed"
,
pShow
->
id
);
mndReleaseShowObj
(
pShow
,
true
);
}
else
{
mDebug
(
"show:0x%"
PRIx64
", retrieve not completed yet"
,
pShow
->
id
);
mDebug
(
"show:0x%"
PRIx64
", retrieve not completed yet"
,
pShow
->
id
);
mndReleaseShowObj
(
pShow
,
false
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录