Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
794ee736
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
未验证
提交
794ee736
编写于
11月 21, 2022
作者:
D
dapan1121
提交者:
GitHub
11月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18289 from taosdata/szhou/fixbugs26
feature: add memory rss threshold for creating new query
上级
faced852
d8cd39d0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
26 addition
and
1 deletion
+26
-1
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+1
-0
src/common/src/tglobal.c
src/common/src/tglobal.c
+13
-0
src/inc/taoserror.h
src/inc/taoserror.h
+1
-0
src/query/src/queryMain.c
src/query/src/queryMain.c
+9
-0
src/util/inc/tconfig.h
src/util/inc/tconfig.h
+1
-1
src/util/src/terror.c
src/util/src/terror.c
+1
-0
未找到文件。
src/common/inc/tglobal.h
浏览文件 @
794ee736
...
...
@@ -69,6 +69,7 @@ extern char tsTempDir[];
extern
int32_t
tsShortcutFlag
;
extern
int32_t
tsMaxSqlGroups
;
extern
int8_t
tsSortWhenGroupBy
;
extern
int32_t
tsQueryRssThreshold
;
// query buffer management
extern
int32_t
tsQueryBufferSize
;
// maximum allowed usage buffer size in MB for each data node during query processing
...
...
src/common/src/tglobal.c
浏览文件 @
794ee736
...
...
@@ -124,6 +124,9 @@ int32_t tsMaxSqlGroups = 1000000;
// order by first group by column when group by
int8_t
tsSortWhenGroupBy
=
1
;
// memory rss thresold for creating new query in MB. 0 means no threshold limitation
int32_t
tsQueryRssThreshold
=
0
;
int32_t
tsProjectExecInterval
=
10000
;
// every 10sec, the projection will be executed once
int64_t
tsMaxRetentWindow
=
24
*
3600L
;
// maximum time window tolerance
...
...
@@ -1828,6 +1831,16 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"queryRssThreshold"
;
cfg
.
ptr
=
&
tsQueryRssThreshold
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
2048
*
1024
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
#ifdef TD_TSZ
// lossy compress
cfg
.
option
=
"lossyColumns"
;
...
...
src/inc/taoserror.h
浏览文件 @
794ee736
...
...
@@ -298,6 +298,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_QRY_INVALID_TIME_CONDITION TAOS_DEF_ERROR_CODE(0, 0x070E) //"invalid time condition")
#define TSDB_CODE_QRY_INVALID_SCHEMA_VERSION TAOS_DEF_ERROR_CODE(0, 0x0710) //"invalid schema version")
#define TSDB_CODE_QRY_RESULT_TOO_LARGE TAOS_DEF_ERROR_CODE(0, 0x0711) //"result num is too large")
#define TSDB_CODE_QRY_RSS_THRESHOLD TAOS_DEF_ERROR_CODE(0, 0x0712) //"query memory rss threshold")
// grant
#define TSDB_CODE_GRANT_EXPIRED TAOS_DEF_ERROR_CODE(0, 0x0800) //"License expired"
...
...
src/query/src/queryMain.c
浏览文件 @
794ee736
...
...
@@ -77,6 +77,15 @@ int32_t qCreateQueryInfo(void* tsdb, int32_t vgId, SQueryTableMsg* pQueryMsg, qi
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_over
;
}
float
procMemory
=
0
;
if
(
taosGetProcMemory
(
&
procMemory
))
{
if
(
tsQueryRssThreshold
>
0
&&
procMemory
>=
tsQueryRssThreshold
)
{
qError
(
"Exceeds query memory RSS threshold. RSS: %f, threshold: %d"
,
procMemory
,
tsQueryRssThreshold
);
code
=
TSDB_CODE_QRY_RSS_THRESHOLD
;
goto
_over
;
}
}
if
(
pQueryMsg
->
numOfTables
<=
0
)
{
qError
(
"Invalid number of tables to query, numOfTables:%d"
,
pQueryMsg
->
numOfTables
);
...
...
src/util/inc/tconfig.h
浏览文件 @
794ee736
...
...
@@ -20,7 +20,7 @@
extern
"C"
{
#endif
#define TSDB_CFG_MAX_NUM 14
1
#define TSDB_CFG_MAX_NUM 14
2
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
...
...
src/util/src/terror.c
浏览文件 @
794ee736
...
...
@@ -304,6 +304,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_QRY_INCONSISTAN, "File inconsistance in
TAOS_DEFINE_ERROR
(
TSDB_CODE_QRY_INVALID_TIME_CONDITION
,
"One valid time range condition expected"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_QRY_SYS_ERROR
,
"System error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_QRY_RESULT_TOO_LARGE
,
"result num is too large"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_QRY_RSS_THRESHOLD
,
"Exceed Memory RSS thresold when creating query"
)
// grant
TAOS_DEFINE_ERROR
(
TSDB_CODE_GRANT_EXPIRED
,
"License expired"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录