Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e8f413fc
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
e8f413fc
编写于
2月 23, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
2月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10375 from taosdata/feature/config
config
上级
842eb5e5
10a21ba8
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
133 addition
and
229 deletion
+133
-229
include/common/tglobal.h
include/common/tglobal.h
+1
-33
include/os/osEnv.h
include/os/osEnv.h
+15
-0
include/os/osSysinfo.h
include/os/osSysinfo.h
+15
-8
include/util/tlog.h
include/util/tlog.h
+0
-1
include/util/ttimer.h
include/util/ttimer.h
+0
-1
include/util/version.h
include/util/version.h
+33
-0
source/client/src/clientCfg.c
source/client/src/clientCfg.c
+2
-1
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+2
-2
source/client/src/clientMain.c
source/client/src/clientMain.c
+1
-0
source/common/src/tglobal.c
source/common/src/tglobal.c
+6
-136
source/dnode/mgmt/daemon/inc/dmnInt.h
source/dnode/mgmt/daemon/inc/dmnInt.h
+1
-0
source/dnode/mgmt/daemon/src/dmnCfg.c
source/dnode/mgmt/daemon/src/dmnCfg.c
+8
-8
source/dnode/mgmt/daemon/src/dmnLog.c
source/dnode/mgmt/daemon/src/dmnLog.c
+2
-0
source/dnode/mgmt/impl/src/dndEnv.c
source/dnode/mgmt/impl/src/dndEnv.c
+0
-12
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+1
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+6
-3
source/libs/qcom/src/queryUtil.c
source/libs/qcom/src/queryUtil.c
+4
-2
source/libs/transport/src/rpcMain.c
source/libs/transport/src/rpcMain.c
+6
-0
source/libs/transport/test/rsclient.c
source/libs/transport/test/rsclient.c
+1
-1
source/os/src/osEnv.c
source/os/src/osEnv.c
+24
-0
source/util/src/tlog.c
source/util/src/tlog.c
+4
-21
tools/shell/src/shellLinux.c
tools/shell/src/shellLinux.c
+1
-0
未找到文件。
include/common/tglobal.h
浏览文件 @
e8f413fc
...
@@ -21,26 +21,9 @@ extern "C" {
...
@@ -21,26 +21,9 @@ extern "C" {
#endif
#endif
#include "tdef.h"
#include "tdef.h"
#include "tcfg.h"
// cluster
extern
int32_t
tsStatusInterval
;
extern
int8_t
tsEnableTelemetryReporting
;
extern
int32_t
tsNumOfSupportVnodes
;
// common
// common
extern
int
tsRpcTimer
;
extern
int
tsRpcMaxTime
;
extern
int
tsRpcForceTcp
;
// all commands go to tcp protocol if this is enabled
extern
int32_t
tsMaxConnections
;
extern
int32_t
tsMaxShellConns
;
extern
int32_t
tsShellActivityTimer
;
extern
uint32_t
tsMaxTmrCtrl
;
extern
float
tsNumOfThreadsPerCore
;
extern
int32_t
tsNumOfCommitThreads
;
extern
float
tsRatioOfQueryCores
;
extern
int8_t
tsDaylight
;
extern
int8_t
tsDaylight
;
extern
int8_t
tsEnableCoreFile
;
extern
int32_t
tsCompressMsgSize
;
extern
int32_t
tsCompressMsgSize
;
extern
int32_t
tsCompressColData
;
extern
int32_t
tsCompressColData
;
extern
int32_t
tsMaxNumOfDistinctResults
;
extern
int32_t
tsMaxNumOfDistinctResults
;
...
@@ -73,24 +56,9 @@ extern int32_t tsProjectExecInterval;
...
@@ -73,24 +56,9 @@ extern int32_t tsProjectExecInterval;
extern
int64_t
tsMaxRetentWindow
;
extern
int64_t
tsMaxRetentWindow
;
// system info
// system info
extern
float
tsTotalLogDirGB
;
extern
float
tsTotalTmpDirGB
;
extern
float
tsTotalDataDirGB
;
extern
float
tsAvailLogDirGB
;
extern
float
tsAvailTmpDirectorySpace
;
extern
float
tsAvailDataDirGB
;
extern
float
tsUsedDataDirGB
;
extern
float
tsMinimalLogDirGB
;
extern
float
tsReservedTmpDirectorySpace
;
extern
float
tsMinimalDataDirGB
;
extern
uint32_t
tsVersion
;
extern
uint32_t
tsVersion
;
// build info
extern
char
version
[];
extern
char
compatible_version
[];
extern
char
gitinfo
[];
extern
char
gitinfoOfInternal
[];
extern
char
buildinfo
[];
// lossy
// lossy
extern
char
tsLossyColumns
[];
extern
char
tsLossyColumns
[];
...
...
include/os/osEnv.h
浏览文件 @
e8f413fc
...
@@ -21,9 +21,24 @@ extern "C" {
...
@@ -21,9 +21,24 @@ extern "C" {
#endif
#endif
extern
char
tsOsName
[];
extern
char
tsOsName
[];
extern
char
tsDataDir
[];
extern
char
tsDataDir
[];
extern
char
tsLogDir
[];
extern
char
tsTempDir
[];
extern
char
configDir
[];
extern
char
configDir
[];
extern
struct
SDiskSpace
tsLogSpace
;
extern
struct
SDiskSpace
tsTempSpace
;
extern
struct
SDiskSpace
tsDataSpace
;
void
taosUpdateLogSpace
();
void
taosUpdateTempSpace
();
void
taosUpdateDataSpace
();
bool
taosLogSpaceAvailable
();
bool
taosTmpSpaceAvailable
();
bool
taosDataSpaceAvailable
();
void
taosUpdateAllSpace
();
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
include/os/osSysinfo.h
浏览文件 @
e8f413fc
...
@@ -25,20 +25,27 @@ extern "C" {
...
@@ -25,20 +25,27 @@ extern "C" {
#define TSDB_LOCALE_LEN 64
#define TSDB_LOCALE_LEN 64
#define TSDB_TIMEZONE_LEN 96
#define TSDB_TIMEZONE_LEN 96
typedef
struct
{
int64_t
total
;
int64_t
used
;
int64_t
avail
;
}
SDiskSize
;
typedef
struct
SDiskSpace
{
int64_t
reserved
;
SDiskSize
size
;
}
SDiskSpace
;
extern
int64_t
tsPageSize
;
extern
int64_t
tsPageSize
;
extern
int64_t
tsOpenMax
;
extern
int64_t
tsOpenMax
;
extern
int64_t
tsStreamMax
;
extern
int64_t
tsStreamMax
;
extern
int32_t
tsNumOfCores
;
extern
int32_t
tsNumOfCores
;
extern
int32_t
tsTotalMemoryMB
;
extern
int32_t
tsTotalMemoryMB
;
extern
char
tsTimezone
[];
extern
char
tsTimezone
[];
extern
char
tsLocale
[];
extern
char
tsLocale
[];
extern
char
tsCharset
[];
// default encode string
extern
char
tsCharset
[];
// default encode string
typedef
struct
{
int64_t
total
;
int64_t
used
;
int64_t
avail
;
}
SDiskSize
;
int32_t
taosGetDiskSize
(
char
*
dataDir
,
SDiskSize
*
diskSize
);
int32_t
taosGetDiskSize
(
char
*
dataDir
,
SDiskSize
*
diskSize
);
int32_t
taosGetCpuCores
();
int32_t
taosGetCpuCores
();
...
...
include/util/tlog.h
浏览文件 @
e8f413fc
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
extern
char
tsLogDir
[];
extern
bool
tsLogInited
;
extern
bool
tsLogInited
;
extern
bool
tsAsyncLog
;
extern
bool
tsAsyncLog
;
extern
int32_t
tsNumOfLogLines
;
extern
int32_t
tsNumOfLogLines
;
...
...
include/util/ttimer.h
浏览文件 @
e8f413fc
...
@@ -26,7 +26,6 @@ typedef void *tmr_h;
...
@@ -26,7 +26,6 @@ typedef void *tmr_h;
typedef
void
(
*
TAOS_TMR_CALLBACK
)(
void
*
,
void
*
);
typedef
void
(
*
TAOS_TMR_CALLBACK
)(
void
*
,
void
*
);
extern
int
taosTmrThreads
;
extern
int
taosTmrThreads
;
extern
uint32_t
tsMaxTmrCtrl
;
#define MSECONDS_PER_TICK 5
#define MSECONDS_PER_TICK 5
...
...
include/util/version.h
0 → 100644
浏览文件 @
e8f413fc
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_VERSION_H
#define _TD_UTIL_VERSION_H
#ifdef __cplusplus
extern
"C"
{
#endif
extern
char
version
[];
extern
char
compatible_version
[];
extern
char
gitinfo
[];
extern
char
gitinfoOfInternal
[];
extern
char
buildinfo
[];
#ifdef __cplusplus
}
#endif
#endif
/*_TD_UTIL_VERSION_H*/
source/client/src/clientCfg.c
浏览文件 @
e8f413fc
...
@@ -159,8 +159,9 @@ static int32_t tscAddCfg(SConfig *pCfg) {
...
@@ -159,8 +159,9 @@ static int32_t tscAddCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"statusInterval"
,
1
,
1
,
30
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"statusInterval"
,
1
,
1
,
30
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"numOfThreadsPerCore"
,
1
,
0
,
10
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"numOfThreadsPerCore"
,
1
,
0
,
10
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"ratioOfQueryCores"
,
1
,
0
,
5
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"ratioOfQueryCores"
,
1
,
0
,
5
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxShellConns"
,
50000
,
10
,
50000000
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"shellActivityTimer"
,
3
,
1
,
120
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"shellActivityTimer"
,
3
,
1
,
120
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxConnections"
,
50000
,
1
,
100000
)
!=
0
)
return
-
1
;
return
0
;
return
0
;
}
}
...
...
source/client/src/clientEnv.c
浏览文件 @
e8f413fc
...
@@ -90,10 +90,10 @@ void* openTransporter(const char *user, const char *auth, int32_t numOfThread) {
...
@@ -90,10 +90,10 @@ void* openTransporter(const char *user, const char *auth, int32_t numOfThread) {
rpcInit
.
label
=
"TSC"
;
rpcInit
.
label
=
"TSC"
;
rpcInit
.
numOfThreads
=
numOfThread
;
rpcInit
.
numOfThreads
=
numOfThread
;
rpcInit
.
cfp
=
processMsgFromServer
;
rpcInit
.
cfp
=
processMsgFromServer
;
rpcInit
.
sessions
=
tsMaxConnections
;
rpcInit
.
sessions
=
cfgGetItem
(
tscCfg
,
"maxConnections"
)
->
i32
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
user
=
(
char
*
)
user
;
rpcInit
.
user
=
(
char
*
)
user
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1000
;
rpcInit
.
idleTime
=
cfgGetItem
(
tscCfg
,
"shellActivityTimer"
)
->
i32
*
1000
;
rpcInit
.
ckey
=
"key"
;
rpcInit
.
ckey
=
"key"
;
rpcInit
.
spi
=
1
;
rpcInit
.
spi
=
1
;
rpcInit
.
secret
=
(
char
*
)
auth
;
rpcInit
.
secret
=
(
char
*
)
auth
;
...
...
source/client/src/clientMain.c
浏览文件 @
e8f413fc
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include "tmsg.h"
#include "tmsg.h"
#include "tglobal.h"
#include "tglobal.h"
#include "catalog.h"
#include "catalog.h"
#include "version.h"
#define TSC_VAR_NOT_RELEASE 1
#define TSC_VAR_NOT_RELEASE 1
#define TSC_VAR_RELEASED 0
#define TSC_VAR_RELEASED 0
...
...
source/common/src/tglobal.c
浏览文件 @
e8f413fc
...
@@ -27,24 +27,9 @@
...
@@ -27,24 +27,9 @@
#include "tutil.h"
#include "tutil.h"
#include "ulog.h"
#include "ulog.h"
// cluster
int32_t
tsStatusInterval
=
1
;
// second
int8_t
tsEnableTelemetryReporting
=
0
;
char
tsEmail
[
TSDB_FQDN_LEN
]
=
{
0
};
int32_t
tsNumOfSupportVnodes
=
128
;
// common
// common
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
int32_t
tsRpcForceTcp
=
1
;
// disable this, means query, show command use udp protocol as default
int32_t
tsMaxShellConns
=
50000
;
int32_t
tsMaxConnections
=
50000
;
int32_t
tsShellActivityTimer
=
3
;
// second
float
tsNumOfThreadsPerCore
=
1
.
0
f
;
int32_t
tsNumOfCommitThreads
=
4
;
float
tsRatioOfQueryCores
=
1
.
0
f
;
int8_t
tsDaylight
=
0
;
int8_t
tsDaylight
=
0
;
int8_t
tsEnableCoreFile
=
0
;
int32_t
tsMaxBinaryDisplayWidth
=
30
;
int32_t
tsMaxBinaryDisplayWidth
=
30
;
int8_t
tsEnableSlaveQuery
=
1
;
int8_t
tsEnableSlaveQuery
=
1
;
int8_t
tsEnableAdjustMaster
=
1
;
int8_t
tsEnableAdjustMaster
=
1
;
...
@@ -125,12 +110,6 @@ int8_t tsDeadLockKillQuery = 0;
...
@@ -125,12 +110,6 @@ int8_t tsDeadLockKillQuery = 0;
// For backward compatibility
// For backward compatibility
bool
tsdbForceKeepFile
=
false
;
bool
tsdbForceKeepFile
=
false
;
#ifndef _STORAGE
SDiskCfg
tsDiskCfg
[
1
];
#else
SDiskCfg
tsDiskCfg
[
TFS_MAX_DISKS
];
#endif
/*
/*
* minimum scale for whole system, millisecond by default
* minimum scale for whole system, millisecond by default
* for TSDB_TIME_PRECISION_MILLI: 86400000L
* for TSDB_TIME_PRECISION_MILLI: 86400000L
...
@@ -140,13 +119,6 @@ SDiskCfg tsDiskCfg[TFS_MAX_DISKS];
...
@@ -140,13 +119,6 @@ SDiskCfg tsDiskCfg[TFS_MAX_DISKS];
int64_t
tsTickPerDay
[]
=
{
86400000L
,
86400000000L
,
86400000000000L
};
int64_t
tsTickPerDay
[]
=
{
86400000L
,
86400000000L
,
86400000000000L
};
// system info
// system info
float
tsTotalTmpDirGB
=
0
;
float
tsTotalDataDirGB
=
0
;
float
tsAvailTmpDirectorySpace
=
0
;
float
tsAvailDataDirGB
=
0
;
float
tsUsedDataDirGB
=
0
;
float
tsReservedTmpDirectorySpace
=
1
.
0
f
;
float
tsMinimalDataDirGB
=
2
.
0
f
;
int32_t
tsTotalMemoryMB
=
0
;
int32_t
tsTotalMemoryMB
=
0
;
uint32_t
tsVersion
=
0
;
uint32_t
tsVersion
=
0
;
...
@@ -247,12 +219,12 @@ int32_t taosCfgDynamicOptions(char *msg) {
...
@@ -247,12 +219,12 @@ int32_t taosCfgDynamicOptions(char *msg) {
return
false
;
return
false
;
}
}
void
taosAddDataDir
(
int
index
,
char
*
v1
,
int
level
,
int
primary
)
{
//
void taosAddDataDir(int index, char *v1, int level, int primary) {
tstrncpy
(
tsDiskCfg
[
index
].
dir
,
v1
,
TSDB_FILENAME_LEN
);
//
tstrncpy(tsDiskCfg[index].dir, v1, TSDB_FILENAME_LEN);
tsDiskCfg
[
index
].
level
=
level
;
//
tsDiskCfg[index].level = level;
tsDiskCfg
[
index
].
primary
=
primary
;
//
tsDiskCfg[index].primary = primary;
uTrace
(
"dataDir:%s, level:%d primary:%d is configured"
,
v1
,
level
,
primary
);
//
uTrace("dataDir:%s, level:%d primary:%d is configured", v1, level, primary);
}
//
}
#ifndef _STORAGE
#ifndef _STORAGE
// void taosReadDataDirCfg(char *v1, char *v2, char *v3) {
// void taosReadDataDirCfg(char *v1, char *v2, char *v3) {
...
@@ -302,58 +274,6 @@ static void doInitGlobalConfig(void) {
...
@@ -302,58 +274,6 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_NONE;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosAddConfigOption(cfg);
taosAddConfigOption(cfg);
cfg.option = "telemetryReporting";
cfg.ptr = &tsEnableTelemetryReporting;
cfg.valType = TAOS_CFG_VTYPE_INT8;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 0;
cfg.maxValue = 1;
cfg.ptrLength = 1;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosAddConfigOption(cfg);
// timer
cfg.option = "maxTmrCtrl";
cfg.ptr = &tsMaxTmrCtrl;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 8;
cfg.maxValue = 2048;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosAddConfigOption(cfg);
cfg.option = "rpcTimer";
cfg.ptr = &tsRpcTimer;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT;
cfg.minValue = 100;
cfg.maxValue = 3000;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_MS;
taosAddConfigOption(cfg);
cfg.option = "rpcForceTcp";
cfg.ptr = &tsRpcForceTcp;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT;
cfg.minValue = 0;
cfg.maxValue = 1;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosAddConfigOption(cfg);
cfg.option = "rpcMaxTime";
cfg.ptr = &tsRpcMaxTime;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT;
cfg.minValue = 100;
cfg.maxValue = 7200;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_SECOND;
taosAddConfigOption(cfg);
cfg.option = "minSlidingTime";
cfg.option = "minSlidingTime";
cfg.ptr = &tsMinSlidingTime;
cfg.ptr = &tsMinSlidingTime;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.valType = TAOS_CFG_VTYPE_INT32;
...
@@ -495,45 +415,6 @@ static void doInitGlobalConfig(void) {
...
@@ -495,45 +415,6 @@ static void doInitGlobalConfig(void) {
taosAddConfigOption(cfg);
taosAddConfigOption(cfg);
cfg.option = "maxConnections";
cfg.ptr = &tsMaxConnections;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 1;
cfg.maxValue = 100000;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosAddConfigOption(cfg);
cfg.option = "minimalLogDirGB";
cfg.ptr = &tsMinimalLogDirGB;
cfg.valType = TAOS_CFG_VTYPE_FLOAT;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 0.001f;
cfg.maxValue = 10000000;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_GB;
taosAddConfigOption(cfg);
cfg.option = "minimalTmpDirGB";
cfg.ptr = &tsReservedTmpDirectorySpace;
cfg.valType = TAOS_CFG_VTYPE_FLOAT;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 0.001f;
cfg.maxValue = 10000000;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_GB;
taosAddConfigOption(cfg);
cfg.option = "minimalDataDirGB";
cfg.ptr = &tsMinimalDataDirGB;
cfg.valType = TAOS_CFG_VTYPE_FLOAT;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 0.001f;
cfg.maxValue = 10000000;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_GB;
taosAddConfigOption(cfg);
cfg.option = "slaveQuery";
cfg.option = "slaveQuery";
cfg.ptr = &tsEnableSlaveQuery;
cfg.ptr = &tsEnableSlaveQuery;
...
@@ -557,17 +438,6 @@ static void doInitGlobalConfig(void) {
...
@@ -557,17 +438,6 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_NONE;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosAddConfigOption(cfg);
taosAddConfigOption(cfg);
cfg.option = "enableCoreFile";
cfg.ptr = &tsEnableCoreFile;
cfg.valType = TAOS_CFG_VTYPE_INT8;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG;
cfg.minValue = 0;
cfg.maxValue = 1;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosAddConfigOption(cfg);
cfg.option = "maxBinaryDisplayWidth";
cfg.option = "maxBinaryDisplayWidth";
cfg.ptr = &tsMaxBinaryDisplayWidth;
cfg.ptr = &tsMaxBinaryDisplayWidth;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.valType = TAOS_CFG_VTYPE_INT32;
...
...
source/dnode/mgmt/daemon/inc/dmnInt.h
浏览文件 @
e8f413fc
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "taoserror.h"
#include "taoserror.h"
#include "tglobal.h"
#include "tglobal.h"
#include "ulog.h"
#include "ulog.h"
#include "version.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
...
source/dnode/mgmt/daemon/src/dmnCfg.c
浏览文件 @
e8f413fc
...
@@ -41,17 +41,17 @@ static int32_t dmnAddEpCfg(SConfig *pCfg) {
...
@@ -41,17 +41,17 @@ static int32_t dmnAddEpCfg(SConfig *pCfg) {
static
int32_t
dmnAddDirCfg
(
SConfig
*
pCfg
)
{
static
int32_t
dmnAddDirCfg
(
SConfig
*
pCfg
)
{
if
(
cfgAddDir
(
pCfg
,
"dataDir"
,
tsDataDir
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"dataDir"
,
tsDataDir
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"tmpDir"
,
tsTempDir
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"tempDir"
,
tsTempDir
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"minimalDataDirGB"
,
2
.
0
f
,
0
.
001
f
,
10000000
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"minimalTempDirGB"
,
1
.
0
f
,
0
.
001
f
,
10000000
)
!=
0
)
return
-
1
;
return
0
;
return
0
;
}
}
static
int32_t
dmnCheckDirCfg
(
SConfig
*
pCfg
)
{
SConfigItem
*
pItem
=
NULL
;
pItem
=
cfgGetItem
(
pCfg
,
"tmpDir"
);
if
(
taosDirExist
(
pItem
->
str
)
!=
0
)
{
return
-
1
;
}
static
int32_t
dmnCheckDirCfg
(
SConfig
*
pCfg
)
{
tstrncpy
(
tsDataDir
,
cfgGetItem
(
pCfg
,
"dataDir"
)
->
str
,
PATH_MAX
);
tstrncpy
(
tsTempDir
,
cfgGetItem
(
pCfg
,
"tempDir"
)
->
str
,
PATH_MAX
);
tsDataSpace
.
reserved
=
cfgGetItem
(
pCfg
,
"minimalDataDirGB"
)
->
fval
;
tsTempSpace
.
reserved
=
cfgGetItem
(
pCfg
,
"minimalTempDirGB"
)
->
fval
;
return
0
;
return
0
;
}
}
...
...
source/dnode/mgmt/daemon/src/dmnLog.c
浏览文件 @
e8f413fc
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
int32_t
dmnAddLogCfg
(
SConfig
*
pCfg
)
{
int32_t
dmnAddLogCfg
(
SConfig
*
pCfg
)
{
if
(
cfgAddDir
(
pCfg
,
"logDir"
,
"/var/log/taos"
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"logDir"
,
"/var/log/taos"
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"minimalLogDirGB"
,
1
.
0
f
,
0
.
001
f
,
10000000
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"asyncLog"
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"asyncLog"
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"numOfLogLines"
,
10000000
,
1000
,
2000000000
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"numOfLogLines"
,
10000000
,
1000
,
2000000000
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"logKeepDays"
,
0
,
-
365000
,
365000
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"logKeepDays"
,
0
,
-
365000
,
365000
)
!=
0
)
return
-
1
;
...
@@ -41,6 +42,7 @@ int32_t dmnAddLogCfg(SConfig *pCfg) {
...
@@ -41,6 +42,7 @@ int32_t dmnAddLogCfg(SConfig *pCfg) {
int32_t
dmnSetLogCfg
(
SConfig
*
pCfg
)
{
int32_t
dmnSetLogCfg
(
SConfig
*
pCfg
)
{
tstrncpy
(
tsLogDir
,
cfgGetItem
(
pCfg
,
"logDir"
)
->
str
,
PATH_MAX
);
tstrncpy
(
tsLogDir
,
cfgGetItem
(
pCfg
,
"logDir"
)
->
str
,
PATH_MAX
);
tsLogSpace
.
reserved
=
cfgGetItem
(
pCfg
,
"minimalLogDirGB"
)
->
fval
;
tsAsyncLog
=
cfgGetItem
(
pCfg
,
"asyncLog"
)
->
bval
;
tsAsyncLog
=
cfgGetItem
(
pCfg
,
"asyncLog"
)
->
bval
;
tsNumOfLogLines
=
cfgGetItem
(
pCfg
,
"numOfLogLines"
)
->
i32
;
tsNumOfLogLines
=
cfgGetItem
(
pCfg
,
"numOfLogLines"
)
->
i32
;
tsLogKeepDays
=
cfgGetItem
(
pCfg
,
"logKeepDays"
)
->
i32
;
tsLogKeepDays
=
cfgGetItem
(
pCfg
,
"logKeepDays"
)
->
i32
;
...
...
source/dnode/mgmt/impl/src/dndEnv.c
浏览文件 @
e8f413fc
...
@@ -325,18 +325,6 @@ void taosGetDisk() {
...
@@ -325,18 +325,6 @@ void taosGetDisk() {
SDiskSize diskSize = tfsGetSize(pTfs);
SDiskSize diskSize = tfsGetSize(pTfs);
tfsUpdateSize(&fsMeta);
tfsUpdateSize(&fsMeta);
tsTotalDataDirGB = (float)(fsMeta.total / unit);
tsUsedDataDirGB = (float)(fsMeta.used / unit);
tsAvailDataDirGB = (float)(fsMeta.avail / unit);
if (taosGetDiskSize(tsLogDir, &diskSize) == 0) {
tsTotalLogDirGB = (float)(diskSize.total / unit);
tsAvailLogDirGB = (float)(diskSize.avail / unit);
}
if (taosGetDiskSize(tsTempDir, &diskSize) == 0) {
tsTotalTmpDirGB = (float)(diskSize.total / unit);
tsAvailTmpDirectorySpace = (float)(diskSize.avail / unit);
}
#endif
#endif
}
}
\ No newline at end of file
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
e8f413fc
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "mndStb.h"
#include "mndStb.h"
#include "mndUser.h"
#include "mndUser.h"
#include "tglobal.h"
#include "tglobal.h"
#include "version.h"
#define QUERY_ID_SIZE 20
#define QUERY_ID_SIZE 20
#define QUERY_OBJ_ID_SIZE 18
#define QUERY_OBJ_ID_SIZE 18
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
e8f413fc
...
@@ -132,7 +132,8 @@ do { \
...
@@ -132,7 +132,8 @@ do { \
} while (0)
} while (0)
int32_t
getMaximumIdleDurationSec
()
{
int32_t
getMaximumIdleDurationSec
()
{
return
tsShellActivityTimer
*
2
;
// todo
return
6
;
//tsShellActivityTimer * 2;
}
}
static
int32_t
getExprFunctionId
(
SExprInfo
*
pExprInfo
)
{
static
int32_t
getExprFunctionId
(
SExprInfo
*
pExprInfo
)
{
...
@@ -5301,10 +5302,12 @@ SOperatorInfo* createExchangeOperatorInfo(const SArray* pSources, const SArray*
...
@@ -5301,10 +5302,12 @@ SOperatorInfo* createExchangeOperatorInfo(const SArray* pSources, const SArray*
rpcInit
.
label
=
"EX"
;
rpcInit
.
label
=
"EX"
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
cfp
=
qProcessFetchRsp
;
rpcInit
.
cfp
=
qProcessFetchRsp
;
rpcInit
.
sessions
=
tsMaxConnections
;
// todo
rpcInit
.
sessions
=
50000
;
//tsMaxConnections;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
user
=
(
char
*
)
"root"
;
rpcInit
.
user
=
(
char
*
)
"root"
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1000
;
// todo
rpcInit
.
idleTime
=
6
;
//tsShellActivityTimer * 1000;
rpcInit
.
ckey
=
"key"
;
rpcInit
.
ckey
=
"key"
;
rpcInit
.
spi
=
1
;
rpcInit
.
spi
=
1
;
rpcInit
.
secret
=
(
char
*
)
"dcc5bed04851fec854c035b2e40263b6"
;
rpcInit
.
secret
=
(
char
*
)
"dcc5bed04851fec854c035b2e40263b6"
;
...
...
source/libs/qcom/src/queryUtil.c
浏览文件 @
e8f413fc
...
@@ -85,9 +85,11 @@ static void* pTaskQueue = NULL;
...
@@ -85,9 +85,11 @@ static void* pTaskQueue = NULL;
int32_t
initTaskQueue
()
{
int32_t
initTaskQueue
()
{
double
factor
=
4
.
0
;
double
factor
=
4
.
0
;
int32_t
numOfThreads
=
TMAX
((
int
)(
tsNumOfCores
*
tsNumOfThreadsPerCore
/
factor
),
2
);
// todo
// int32_t numOfThreads = TMAX((int)(tsNumOfCores * tsNumOfThreadsPerCore / factor), 2);
int32_t
numOfThreads
=
TMAX
((
int
)(
tsNumOfCores
*
1
.
0
f
/
factor
),
2
);
int32_t
queueSize
=
tsMaxConnections
*
2
;
int32_t
queueSize
=
25000
;
//
tsMaxConnections * 2;
pTaskQueue
=
taosInitScheduler
(
queueSize
,
numOfThreads
,
"tsc"
);
pTaskQueue
=
taosInitScheduler
(
queueSize
,
numOfThreads
,
"tsc"
);
if
(
NULL
==
pTaskQueue
)
{
if
(
NULL
==
pTaskQueue
)
{
qError
(
"failed to init task queue"
);
qError
(
"failed to init task queue"
);
...
...
source/libs/transport/src/rpcMain.c
浏览文件 @
e8f413fc
...
@@ -42,6 +42,8 @@ int tsRpcMaxRetry;
...
@@ -42,6 +42,8 @@ int tsRpcMaxRetry;
int
tsRpcHeadSize
;
int
tsRpcHeadSize
;
int
tsRpcOverhead
;
int
tsRpcOverhead
;
int32_t
tsRpcForceTcp
=
1
;
// disable this, means query, show command use udp protocol as default
SHashObj
*
tsFqdnHash
;
SHashObj
*
tsFqdnHash
;
#ifndef USE_UV
#ifndef USE_UV
...
@@ -143,6 +145,10 @@ typedef struct SRpcConn {
...
@@ -143,6 +145,10 @@ typedef struct SRpcConn {
static
int
tsRpcRefId
=
-
1
;
static
int
tsRpcRefId
=
-
1
;
static
int32_t
tsRpcNum
=
0
;
static
int32_t
tsRpcNum
=
0
;
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
// static pthread_once_t tsRpcInit = PTHREAD_ONCE_INIT;
// static pthread_once_t tsRpcInit = PTHREAD_ONCE_INIT;
// server:0 client:1 tcp:2 udp:0
// server:0 client:1 tcp:2 udp:0
...
...
source/libs/transport/test/rsclient.c
浏览文件 @
e8f413fc
...
@@ -97,7 +97,7 @@ int main(int argc, char *argv[]) {
...
@@ -97,7 +97,7 @@ int main(int argc, char *argv[]) {
rpcInit
.
label
=
"APP"
;
rpcInit
.
label
=
"APP"
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
sessions
=
100
;
rpcInit
.
sessions
=
100
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1000
;
rpcInit
.
idleTime
=
3000
;
//
tsShellActivityTimer*1000;
rpcInit
.
user
=
"michael"
;
rpcInit
.
user
=
"michael"
;
rpcInit
.
secret
=
secret
;
rpcInit
.
secret
=
secret
;
rpcInit
.
ckey
=
"key"
;
rpcInit
.
ckey
=
"key"
;
...
...
source/os/src/osEnv.c
浏览文件 @
e8f413fc
...
@@ -16,6 +16,30 @@
...
@@ -16,6 +16,30 @@
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include "os.h"
#include "os.h"
#include "osEnv.h"
#include "osSysinfo.h"
SDiskSpace
tsLogSpace
;
SDiskSpace
tsTempSpace
;
SDiskSpace
tsDataSpace
;
void
taosUpdateLogSpace
()
{
taosGetDiskSize
(
tsLogDir
,
&
tsLogSpace
.
size
);
}
void
taosUpdateTempSpace
()
{
taosGetDiskSize
(
tsTempDir
,
&
tsTempSpace
.
size
);
}
void
taosUpdateDataSpace
()
{
taosGetDiskSize
(
tsDataDir
,
&
tsDataSpace
.
size
);
}
bool
taosLogSpaceAvailable
()
{
return
tsLogSpace
.
reserved
<
tsLogSpace
.
size
.
avail
;
}
bool
taosTempSpaceAvailable
()
{
return
tsTempSpace
.
reserved
<
tsTempSpace
.
size
.
avail
;
}
bool
taosDataSpaceAvailable
()
{
return
tsDataSpace
.
reserved
<
tsDataSpace
.
size
.
avail
;
}
void
taosUpdateAllSpace
()
{
taosUpdateLogSpace
();
taosUpdateTempSpace
();
taosUpdateDataSpace
();
}
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
...
...
source/util/src/tlog.c
浏览文件 @
e8f413fc
...
@@ -72,9 +72,6 @@ int8_t tscEmbeddedInUtil = 0;
...
@@ -72,9 +72,6 @@ int8_t tscEmbeddedInUtil = 0;
int32_t
tsLogKeepDays
=
0
;
int32_t
tsLogKeepDays
=
0
;
bool
tsAsyncLog
=
true
;
bool
tsAsyncLog
=
true
;
bool
tsLogInited
=
false
;
bool
tsLogInited
=
false
;
float
tsTotalLogDirGB
=
0
;
float
tsAvailLogDirGB
=
0
;
float
tsMinimalLogDirGB
=
1
.
0
f
;
int64_t
asyncLogLostLines
=
0
;
int64_t
asyncLogLostLines
=
0
;
int32_t
writeInterval
=
DEFAULT_LOG_INTERVAL
;
int32_t
writeInterval
=
DEFAULT_LOG_INTERVAL
;
...
@@ -122,6 +119,7 @@ static int32_t taosStartLog() {
...
@@ -122,6 +119,7 @@ static int32_t taosStartLog() {
int32_t
taosInitLog
(
const
char
*
logName
,
int
maxFiles
)
{
int32_t
taosInitLog
(
const
char
*
logName
,
int
maxFiles
)
{
if
(
tsLogInited
)
return
0
;
if
(
tsLogInited
)
return
0
;
taosUpdateLogSpace
();
char
fullName
[
PATH_MAX
]
=
{
0
};
char
fullName
[
PATH_MAX
]
=
{
0
};
snprintf
(
fullName
,
PATH_MAX
,
"%s"
TD_DIRSEP
"%s"
,
tsLogDir
,
logName
);
snprintf
(
fullName
,
PATH_MAX
,
"%s"
TD_DIRSEP
"%s"
,
tsLogDir
,
logName
);
...
@@ -383,12 +381,7 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum) {
...
@@ -383,12 +381,7 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum) {
}
}
void
taosPrintLog
(
const
char
*
flags
,
int32_t
dflag
,
const
char
*
format
,
...)
{
void
taosPrintLog
(
const
char
*
flags
,
int32_t
dflag
,
const
char
*
format
,
...)
{
if
(
tsTotalLogDirGB
!=
0
&&
tsAvailLogDirGB
<
tsMinimalLogDirGB
)
{
if
(
!
taosLogSpaceAvailable
())
return
;
printf
(
"server disk:%s space remain %.3f GB, total %.1f GB, stop print log.
\n
"
,
tsLogDir
,
tsAvailLogDirGB
,
tsTotalLogDirGB
);
fflush
(
stdout
);
return
;
}
va_list
argpointer
;
va_list
argpointer
;
char
buffer
[
MAX_LOGLINE_BUFFER_SIZE
]
=
{
0
};
char
buffer
[
MAX_LOGLINE_BUFFER_SIZE
]
=
{
0
};
...
@@ -443,12 +436,7 @@ void taosPrintLog(const char *flags, int32_t dflag, const char *format, ...) {
...
@@ -443,12 +436,7 @@ void taosPrintLog(const char *flags, int32_t dflag, const char *format, ...) {
}
}
void
taosDumpData
(
unsigned
char
*
msg
,
int32_t
len
)
{
void
taosDumpData
(
unsigned
char
*
msg
,
int32_t
len
)
{
if
(
tsTotalLogDirGB
!=
0
&&
tsAvailLogDirGB
<
tsMinimalLogDirGB
)
{
if
(
!
taosLogSpaceAvailable
())
return
;
printf
(
"server disk:%s space remain %.3f GB, total %.1f GB, stop dump log.
\n
"
,
tsLogDir
,
tsAvailLogDirGB
,
tsTotalLogDirGB
);
fflush
(
stdout
);
return
;
}
char
temp
[
256
];
char
temp
[
256
];
int32_t
i
,
pos
=
0
,
c
=
0
;
int32_t
i
,
pos
=
0
,
c
=
0
;
...
@@ -471,12 +459,7 @@ void taosDumpData(unsigned char *msg, int32_t len) {
...
@@ -471,12 +459,7 @@ void taosDumpData(unsigned char *msg, int32_t len) {
}
}
void
taosPrintLongString
(
const
char
*
flags
,
int32_t
dflag
,
const
char
*
format
,
...)
{
void
taosPrintLongString
(
const
char
*
flags
,
int32_t
dflag
,
const
char
*
format
,
...)
{
if
(
tsTotalLogDirGB
!=
0
&&
tsAvailLogDirGB
<
tsMinimalLogDirGB
)
{
if
(
!
taosLogSpaceAvailable
())
return
;
printf
(
"server disk:%s space remain %.3f GB, total %.1f GB, stop write log.
\n
"
,
tsLogDir
,
tsAvailLogDirGB
,
tsTotalLogDirGB
);
fflush
(
stdout
);
return
;
}
va_list
argpointer
;
va_list
argpointer
;
char
buffer
[
MAX_LOGLINE_DUMP_BUFFER_SIZE
];
char
buffer
[
MAX_LOGLINE_DUMP_BUFFER_SIZE
];
...
...
tools/shell/src/shellLinux.c
浏览文件 @
e8f413fc
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "shellCommand.h"
#include "shellCommand.h"
#include "tkey.h"
#include "tkey.h"
#include "ulog.h"
#include "ulog.h"
#include "version.h"
#include <wordexp.h>
#include <wordexp.h>
#include <argp.h>
#include <argp.h>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录