Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
23920e10
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看板
提交
23920e10
编写于
4月 12, 2023
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: optimize log perf
上级
ff0697fa
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
14 deletion
+18
-14
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+2
-2
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+2
-2
source/libs/qworker/src/qwMsg.c
source/libs/qworker/src/qwMsg.c
+4
-4
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+1
-1
source/util/src/tlog.c
source/util/src/tlog.c
+9
-5
未找到文件。
source/libs/executor/src/executil.c
浏览文件 @
23920e10
...
...
@@ -2040,7 +2040,7 @@ int32_t createScanTableListInfo(SScanPhysiNode* pScanNode, SNodeList* pGroupTags
int64_t
st1
=
taosGetTimestampUs
();
pTaskInfo
->
cost
.
extractListTime
=
(
st1
-
st
)
/
1000
.
0
;
q
Debug
(
"extract queried table list completed, %d tables, elapsed time:%.2f ms %s"
,
numOfTables
,
q
Error
(
"extract queried table list completed, %d tables, elapsed time:%.2f ms %s"
,
numOfTables
,
pTaskInfo
->
cost
.
extractListTime
,
idStr
);
if
(
numOfTables
==
0
)
{
...
...
@@ -2054,7 +2054,7 @@ int32_t createScanTableListInfo(SScanPhysiNode* pScanNode, SNodeList* pGroupTags
}
pTaskInfo
->
cost
.
groupIdMapTime
=
(
taosGetTimestampUs
()
-
st1
)
/
1000
.
0
;
q
Debug
(
"generate group id map completed, elapsed time:%.2f ms %s"
,
pTaskInfo
->
cost
.
groupIdMapTime
,
idStr
);
q
Error
(
"generate group id map completed, elapsed time:%.2f ms %s"
,
pTaskInfo
->
cost
.
groupIdMapTime
,
idStr
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
23920e10
...
...
@@ -486,7 +486,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
SExecTaskInfo
**
pTask
=
(
SExecTaskInfo
**
)
pTaskInfo
;
taosThreadOnce
(
&
initPoolOnce
,
initRefPool
);
q
Debug
(
"start to create task, TID:0x%"
PRIx64
" QID:0x%"
PRIx64
", vgId:%d"
,
taskId
,
pSubplan
->
id
.
queryId
,
vgId
);
q
Error
(
"start to create task, TID:0x%"
PRIx64
" QID:0x%"
PRIx64
", vgId:%d"
,
taskId
,
pSubplan
->
id
.
queryId
,
vgId
);
int32_t
code
=
createExecTaskInfo
(
pSubplan
,
pTask
,
readHandle
,
taskId
,
vgId
,
sql
,
model
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -515,7 +515,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
}
}
q
Debug
(
"subplan task create completed, TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
taskId
,
pSubplan
->
id
.
queryId
);
q
Error
(
"subplan task create completed, TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
taskId
,
pSubplan
->
id
.
queryId
);
_error:
// if failed to add ref for all tables in this query, abort current query
...
...
source/libs/qworker/src/qwMsg.c
浏览文件 @
23920e10
...
...
@@ -381,9 +381,9 @@ int32_t qWorkerPreprocessQueryMsg(void *qWorkerMgmt, SRpcMsg *pMsg, bool chkGran
SQWMsg
qwMsg
=
{
.
msgType
=
pMsg
->
msgType
,
.
msg
=
msg
.
msg
,
.
msgLen
=
msg
.
msgLen
,
.
connInfo
=
pMsg
->
info
};
QW_SCH_TASK_
D
LOG
(
"prerocessQuery start, handle:%p, SQL:%s"
,
pMsg
->
info
.
handle
,
msg
.
sql
);
QW_SCH_TASK_
E
LOG
(
"prerocessQuery start, handle:%p, SQL:%s"
,
pMsg
->
info
.
handle
,
msg
.
sql
);
code
=
qwPreprocessQuery
(
QW_FPARAMS
(),
&
qwMsg
);
QW_SCH_TASK_
D
LOG
(
"prerocessQuery end, handle:%p, code:%x"
,
pMsg
->
info
.
handle
,
code
);
QW_SCH_TASK_
E
LOG
(
"prerocessQuery end, handle:%p, code:%x"
,
pMsg
->
info
.
handle
,
code
);
tFreeSSubQueryMsg
(
&
msg
);
...
...
@@ -449,11 +449,11 @@ int32_t qWorkerProcessQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int
qwMsg
.
msgInfo
.
taskType
=
msg
.
taskType
;
qwMsg
.
msgInfo
.
needFetch
=
msg
.
needFetch
;
QW_SCH_TASK_
D
LOG
(
"processQuery start, node:%p, type:%s, handle:%p, SQL:%s"
,
node
,
TMSG_INFO
(
pMsg
->
msgType
),
QW_SCH_TASK_
E
LOG
(
"processQuery start, node:%p, type:%s, handle:%p, SQL:%s"
,
node
,
TMSG_INFO
(
pMsg
->
msgType
),
pMsg
->
info
.
handle
,
msg
.
sql
);
code
=
qwProcessQuery
(
QW_FPARAMS
(),
&
qwMsg
,
msg
.
sql
);
msg
.
sql
=
NULL
;
QW_SCH_TASK_
D
LOG
(
"processQuery end, node:%p, code:%x"
,
node
,
code
);
QW_SCH_TASK_
E
LOG
(
"processQuery end, node:%p, code:%x"
,
node
,
code
);
tFreeSSubQueryMsg
(
&
msg
);
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
23920e10
...
...
@@ -138,7 +138,7 @@ int32_t qwSendQueryRsp(QW_FPARAMS_DEF, int32_t msgType, SQWTaskCtx *ctx, int32_t
if
((
!
quickRsp
)
||
QUERY_RSP_POLICY_QUICK
==
tsQueryRspPolicy
)
{
if
(
!
ctx
->
localExec
)
{
qwBuildAndSendQueryRsp
(
msgType
,
&
ctx
->
ctrlConnInfo
,
rspCode
,
ctx
);
QW_TASK_
D
LOG
(
"query msg rsped, handle:%p, code:%x - %s"
,
ctx
->
ctrlConnInfo
.
handle
,
rspCode
,
tstrerror
(
rspCode
));
QW_TASK_
E
LOG
(
"query msg rsped, handle:%p, code:%x - %s"
,
ctx
->
ctrlConnInfo
.
handle
,
rspCode
,
tstrerror
(
rspCode
));
}
ctx
->
queryRsped
=
true
;
...
...
source/util/src/tlog.c
浏览文件 @
23920e10
...
...
@@ -51,6 +51,7 @@ typedef struct {
int32_t
stop
;
TdThread
asyncThread
;
TdThreadMutex
buffMutex
;
SRWLatch
buffLock
;
}
SLogBuff
;
typedef
struct
{
...
...
@@ -569,7 +570,7 @@ static SLogBuff *taosLogBuffNew(int32_t bufSize) {
pLogBuf
->
minBuffSize
=
bufSize
/
10
;
pLogBuf
->
stop
=
0
;
if
(
taosThreadMutexInit
(
&
LOG_BUF_MUTEX
(
pLogBuf
),
NULL
)
<
0
)
goto
_err
;
//
if (taosThreadMutexInit(&LOG_BUF_MUTEX(pLogBuf), NULL) < 0) goto _err;
// tsem_init(&(pLogBuf->buffNotEmpty), 0, 0);
return
pLogBuf
;
...
...
@@ -599,12 +600,13 @@ static int32_t taosPushLogBuffer(SLogBuff *pLogBuf, const char *msg, int32_t msg
int32_t
end
=
0
;
int32_t
remainSize
=
0
;
static
int64_t
lostLine
=
0
;
char
tmpBuf
[
128
]
=
{
0
}
;
char
tmpBuf
[
128
];
int32_t
tmpBufLen
=
0
;
if
(
pLogBuf
==
NULL
||
pLogBuf
->
stop
)
return
-
1
;
taosThreadMutexLock
(
&
LOG_BUF_MUTEX
(
pLogBuf
));
//taosThreadMutexLock(&LOG_BUF_MUTEX(pLogBuf));
taosWLockLatch
(
&
pLogBuf
->
buffLock
);
start
=
LOG_BUF_START
(
pLogBuf
);
end
=
LOG_BUF_END
(
pLogBuf
);
...
...
@@ -618,7 +620,8 @@ static int32_t taosPushLogBuffer(SLogBuff *pLogBuf, const char *msg, int32_t msg
if
(
remainSize
<=
msgLen
||
((
lostLine
>
0
)
&&
(
remainSize
<=
(
msgLen
+
tmpBufLen
))))
{
lostLine
++
;
tsAsyncLogLostLines
++
;
taosThreadMutexUnlock
(
&
LOG_BUF_MUTEX
(
pLogBuf
));
//taosThreadMutexUnlock(&LOG_BUF_MUTEX(pLogBuf));
taosWUnLockLatch
(
&
pLogBuf
->
buffLock
);
return
-
1
;
}
...
...
@@ -639,7 +642,8 @@ static int32_t taosPushLogBuffer(SLogBuff *pLogBuf, const char *msg, int32_t msg
}
*/
taosThreadMutexUnlock
(
&
LOG_BUF_MUTEX
(
pLogBuf
));
//taosThreadMutexUnlock(&LOG_BUF_MUTEX(pLogBuf));
taosWUnLockLatch
(
&
pLogBuf
->
buffLock
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录