Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
89b72283
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
89b72283
编写于
8月 24, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the issue #404
上级
20c9577e
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
74 addition
and
26 deletion
+74
-26
src/client/src/tscServer.c
src/client/src/tscServer.c
+13
-0
src/inc/tglobalcfg.h
src/inc/tglobalcfg.h
+9
-4
src/modules/monitor/src/monitorSystem.c
src/modules/monitor/src/monitorSystem.c
+1
-1
src/system/src/mgmtSystem.c
src/system/src/mgmtSystem.c
+1
-1
src/system/src/vnodeQueryImpl.c
src/system/src/vnodeQueryImpl.c
+1
-1
src/system/src/vnodeShell.c
src/system/src/vnodeShell.c
+2
-2
src/util/src/tglobalcfg.c
src/util/src/tglobalcfg.c
+16
-4
src/util/src/tlog.c
src/util/src/tlog.c
+10
-6
src/util/src/tsystem.c
src/util/src/tsystem.c
+21
-7
未找到文件。
src/client/src/tscServer.c
浏览文件 @
89b72283
...
@@ -777,6 +777,13 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) {
...
@@ -777,6 +777,13 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) {
tscGetSrcColumnInfo
(
colInfo
,
&
pPObj
->
cmd
);
tscGetSrcColumnInfo
(
colInfo
,
&
pPObj
->
cmd
);
tColModelDisplayEx
(
pDesc
->
pSchema
,
pRes
->
data
,
pRes
->
numOfRows
,
pRes
->
numOfRows
,
colInfo
);
tColModelDisplayEx
(
pDesc
->
pSchema
,
pRes
->
data
,
pRes
->
numOfRows
,
pRes
->
numOfRows
,
colInfo
);
#endif
#endif
if
(
tsAvailTmpDirGB
<
tsMinimalTmpDirGB
)
{
tscError
(
"%p sub:%p client disk space remain %.3f GB, need at least %.3f GB, stop query"
,
pPObj
,
pSql
,
tsAvailTmpDirGB
,
tsMinimalTmpDirGB
);
tscAbortFurtherRetryRetrieval
(
trsupport
,
tres
,
TSDB_CODE_CLI_NO_DISKSPACE
);
return
;
}
int32_t
ret
=
saveToBuffer
(
trsupport
->
pExtMemBuffer
[
idx
-
1
],
pDesc
,
trsupport
->
localBuffer
,
pRes
->
data
,
int32_t
ret
=
saveToBuffer
(
trsupport
->
pExtMemBuffer
[
idx
-
1
],
pDesc
,
trsupport
->
localBuffer
,
pRes
->
data
,
pRes
->
numOfRows
,
pCmd
->
groupbyExpr
.
orderType
);
pRes
->
numOfRows
,
pCmd
->
groupbyExpr
.
orderType
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
@@ -802,6 +809,12 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) {
...
@@ -802,6 +809,12 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) {
tColModelDisplayEx
(
pDesc
->
pSchema
,
trsupport
->
localBuffer
->
data
,
trsupport
->
localBuffer
->
numOfElems
,
tColModelDisplayEx
(
pDesc
->
pSchema
,
trsupport
->
localBuffer
->
data
,
trsupport
->
localBuffer
->
numOfElems
,
trsupport
->
localBuffer
->
numOfElems
,
colInfo
);
trsupport
->
localBuffer
->
numOfElems
,
colInfo
);
#endif
#endif
if
(
tsAvailTmpDirGB
<
tsMinimalTmpDirGB
)
{
tscError
(
"%p sub:%p client disk space remain %.3f GB, need at least %.3f GB, stop query"
,
pPObj
,
pSql
,
tsAvailTmpDirGB
,
tsMinimalTmpDirGB
);
tscAbortFurtherRetryRetrieval
(
trsupport
,
tres
,
TSDB_CODE_CLI_NO_DISKSPACE
);
return
;
}
// each result for a vnode is ordered as an independant list,
// each result for a vnode is ordered as an independant list,
// then used as an input of loser tree for disk-based merge routine
// then used as an input of loser tree for disk-based merge routine
...
...
src/inc/tglobalcfg.h
浏览文件 @
89b72283
...
@@ -29,10 +29,15 @@ extern int64_t tsPageSize;
...
@@ -29,10 +29,15 @@ 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
tsTotalDiskGB
;
extern
float
tsTotalLogDirGB
;
extern
float
tsDiskAvailGB
;
extern
float
tsTotalTmpDirGB
;
extern
float
tsDiskUsedGB
;
extern
float
tsTotalDataDirGB
;
extern
float
tsDiskMinimalGB
;
extern
float
tsAvailLogDirGB
;
extern
float
tsAvailTmpDirGB
;
extern
float
tsAvailDataDirGB
;
extern
float
tsMinimalLogDirGB
;
extern
float
tsMinimalTmpDirGB
;
extern
float
tsMinimalDataDirGB
;
extern
int32_t
tsTotalMemoryMB
;
extern
int32_t
tsTotalMemoryMB
;
extern
int32_t
tsVersion
;
extern
int32_t
tsVersion
;
...
...
src/modules/monitor/src/monitorSystem.c
浏览文件 @
89b72283
...
@@ -273,7 +273,7 @@ int monitorBuildCpuSql(char *sql) {
...
@@ -273,7 +273,7 @@ int monitorBuildCpuSql(char *sql) {
// unit is GB
// unit is GB
int
monitorBuildDiskSql
(
char
*
sql
)
{
int
monitorBuildDiskSql
(
char
*
sql
)
{
return
sprintf
(
sql
,
", %f, %d"
,
tsDiskUsedGB
,
tsTotalDisk
GB
);
return
sprintf
(
sql
,
", %f, %d"
,
(
tsTotalDataDirGB
-
tsAvailDataDirGB
),
(
int32_t
)
tsTotalDataDir
GB
);
}
}
// unit is Kb
// unit is Kb
...
...
src/system/src/mgmtSystem.c
浏览文件 @
89b72283
...
@@ -64,7 +64,7 @@ void mgmtProcessDnodeStatus(void *handle, void *tmrId) {
...
@@ -64,7 +64,7 @@ void mgmtProcessDnodeStatus(void *handle, void *tmrId) {
float
memoryUsedMB
=
0
;
float
memoryUsedMB
=
0
;
taosGetSysMemory
(
&
memoryUsedMB
);
taosGetSysMemory
(
&
memoryUsedMB
);
pObj
->
memoryAvailable
=
tsTotalMemoryMB
-
memoryUsedMB
;
pObj
->
memoryAvailable
=
tsTotalMemoryMB
-
memoryUsedMB
;
pObj
->
diskAvailable
=
ts
DiskAvail
GB
;
pObj
->
diskAvailable
=
ts
AvailDataDir
GB
;
for
(
int
vnode
=
0
;
vnode
<
pObj
->
numOfVnodes
;
++
vnode
)
{
for
(
int
vnode
=
0
;
vnode
<
pObj
->
numOfVnodes
;
++
vnode
)
{
SVnodeLoad
*
pVload
=
&
(
pObj
->
vload
[
vnode
]);
SVnodeLoad
*
pVload
=
&
(
pObj
->
vload
[
vnode
]);
...
...
src/system/src/vnodeQueryImpl.c
浏览文件 @
89b72283
...
@@ -2656,7 +2656,7 @@ static void vnodeOpenAllFiles(SQInfo *pQInfo, int32_t vnodeId) {
...
@@ -2656,7 +2656,7 @@ static void vnodeOpenAllFiles(SQInfo *pQInfo, int32_t vnodeId) {
int32_t
firstFid
=
pVnode
->
fileId
-
pVnode
->
numOfFiles
+
1
;
int32_t
firstFid
=
pVnode
->
fileId
-
pVnode
->
numOfFiles
+
1
;
if
(
fid
>
pVnode
->
fileId
||
fid
<
firstFid
)
{
if
(
fid
>
pVnode
->
fileId
||
fid
<
firstFid
)
{
dError
(
"QInfo:%p error data file:%s in vid:%d, fid:%d, fid range:%d-%d"
,
pQInfo
,
pEntry
->
d_name
,
vnodeId
,
dError
(
"QInfo:%p error data file:%s in vid:%d, fid:%d, fid range:%d-%d"
,
pQInfo
,
pEntry
->
d_name
,
vnodeId
,
fid
,
firstFid
,
pVnode
->
fileId
);
firstFid
,
pVnode
->
fileId
);
continue
;
continue
;
}
}
...
...
src/system/src/vnodeShell.c
浏览文件 @
89b72283
...
@@ -471,8 +471,8 @@ int vnodeProcessShellSubmitRequest(char *pMsg, int msgLen, SShellObj *pObj) {
...
@@ -471,8 +471,8 @@ int vnodeProcessShellSubmitRequest(char *pMsg, int msgLen, SShellObj *pObj) {
goto
_submit_over
;
goto
_submit_over
;
}
}
if
(
ts
DiskAvailGB
<
tsDiskMinimal
GB
)
{
if
(
ts
AvailDataDirGB
<
tsMinimalDataDir
GB
)
{
dError
(
"server disk space remain %.3f GB, need at least %.
2f GB, stop writing"
,
tsDiskAvailGB
,
tsDiskMinimal
GB
);
dError
(
"server disk space remain %.3f GB, need at least %.
3f GB, stop writing"
,
tsAvailDataDirGB
,
tsMinimalDataDir
GB
);
code
=
TSDB_CODE_SERVER_NO_SPACE
;
code
=
TSDB_CODE_SERVER_NO_SPACE
;
goto
_submit_over
;
goto
_submit_over
;
}
}
...
...
src/util/src/tglobalcfg.c
浏览文件 @
89b72283
...
@@ -34,10 +34,15 @@ int64_t tsPageSize;
...
@@ -34,10 +34,15 @@ int64_t tsPageSize;
int64_t
tsOpenMax
;
int64_t
tsOpenMax
;
int64_t
tsStreamMax
;
int64_t
tsStreamMax
;
int32_t
tsNumOfCores
=
1
;
int32_t
tsNumOfCores
=
1
;
int32_t
tsTotalDiskGB
=
0
;
float
tsTotalLogDirGB
=
0
;
float
tsDiskAvailGB
=
0
;
float
tsTotalTmpDirGB
=
0
;
float
tsDiskUsedGB
=
0
;
float
tsTotalDataDirGB
=
0
;
float
tsDiskMinimalGB
=
0
.
5
;
float
tsAvailLogDirGB
=
0
;
float
tsAvailTmpDirGB
=
0
;
float
tsAvailDataDirGB
=
0
;
float
tsMinimalLogDirGB
=
0
.
1
;
float
tsMinimalTmpDirGB
=
0
.
1
;
float
tsMinimalDataDirGB
=
0
.
5
;
int32_t
tsTotalMemoryMB
=
0
;
int32_t
tsTotalMemoryMB
=
0
;
int32_t
tsVersion
=
0
;
int32_t
tsVersion
=
0
;
...
@@ -507,6 +512,13 @@ void tsInitGlobalConfig() {
...
@@ -507,6 +512,13 @@ void tsInitGlobalConfig() {
tsInitConfigOption
(
cfg
++
,
"maxVnodeConnections"
,
&
tsMaxVnodeConnections
,
TSDB_CFG_VTYPE_INT
,
tsInitConfigOption
(
cfg
++
,
"maxVnodeConnections"
,
&
tsMaxVnodeConnections
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
,
10
,
50000000
,
0
,
TSDB_CFG_UTYPE_NONE
);
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
,
10
,
50000000
,
0
,
TSDB_CFG_UTYPE_NONE
);
tsInitConfigOption
(
cfg
++
,
"minimalLogDirGB"
,
&
tsMinimalLogDirGB
,
TSDB_CFG_VTYPE_FLOAT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
,
0
.
001
,
10000000
,
0
,
TSDB_CFG_UTYPE_GB
);
tsInitConfigOption
(
cfg
++
,
"minimalTmpDirGB"
,
&
tsMinimalTmpDirGB
,
TSDB_CFG_VTYPE_FLOAT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
,
0
.
001
,
10000000
,
0
,
TSDB_CFG_UTYPE_GB
);
tsInitConfigOption
(
cfg
++
,
"minimalDataDirGB"
,
&
tsMinimalDataDirGB
,
TSDB_CFG_VTYPE_FLOAT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
,
0
.
001
,
10000000
,
0
,
TSDB_CFG_UTYPE_GB
);
// module configs
// module configs
tsInitConfigOption
(
cfg
++
,
"enableHttp"
,
&
tsEnableHttpModule
,
TSDB_CFG_VTYPE_INT
,
tsInitConfigOption
(
cfg
++
,
"enableHttp"
,
&
tsEnableHttpModule
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
,
0
,
1
,
1
,
TSDB_CFG_UTYPE_NONE
);
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
,
0
,
1
,
1
,
TSDB_CFG_UTYPE_NONE
);
...
...
src/util/src/tlog.c
浏览文件 @
89b72283
...
@@ -323,8 +323,10 @@ char *tprefix(char *prefix) {
...
@@ -323,8 +323,10 @@ char *tprefix(char *prefix) {
}
}
void
tprintf
(
const
char
*
const
flags
,
int
dflag
,
const
char
*
const
format
,
...)
{
void
tprintf
(
const
char
*
const
flags
,
int
dflag
,
const
char
*
const
format
,
...)
{
if
(
tsTotalDiskGB
!=
0
&&
tsDiskAvailGB
<
(
tsDiskMinimalGB
/
2
))
{
if
(
tsTotalLogDirGB
!=
0
&&
tsAvailLogDirGB
<
(
tsMinimalLogDirGB
/
2
))
{
printf
(
"server disk space remain %.3f GB, stop write log
\n
"
,
tsDiskAvailGB
);
printf
(
"server disk space remain %.3f GB, stop write log
\n
"
,
tsAvailLogDirGB
);
fflush
(
stdout
);
return
;
}
}
va_list
argpointer
;
va_list
argpointer
;
...
@@ -373,8 +375,9 @@ void tprintf(const char *const flags, int dflag, const char *const format, ...)
...
@@ -373,8 +375,9 @@ void tprintf(const char *const flags, int dflag, const char *const format, ...)
}
}
void
taosDumpData
(
unsigned
char
*
msg
,
int
len
)
{
void
taosDumpData
(
unsigned
char
*
msg
,
int
len
)
{
if
(
tsTotalDiskGB
!=
0
&&
tsDiskAvailGB
<
(
tsDiskMinimalGB
/
2
))
{
if
(
tsTotalLogDirGB
!=
0
&&
tsAvailLogDirGB
<
(
tsMinimalLogDirGB
/
2
))
{
printf
(
"server disk space remain %.3f GB, stop write log
\n
"
,
tsDiskAvailGB
);
printf
(
"server disk space remain %.3f GB, stop write log
\n
"
,
tsAvailLogDirGB
);
fflush
(
stdout
);
return
;
return
;
}
}
...
@@ -401,8 +404,9 @@ void taosDumpData(unsigned char *msg, int len) {
...
@@ -401,8 +404,9 @@ void taosDumpData(unsigned char *msg, int len) {
}
}
void
taosPrintLongString
(
const
char
*
const
flags
,
int
dflag
,
const
char
*
const
format
,
...)
{
void
taosPrintLongString
(
const
char
*
const
flags
,
int
dflag
,
const
char
*
const
format
,
...)
{
if
(
tsTotalDiskGB
!=
0
&&
tsDiskAvailGB
<
(
tsDiskMinimalGB
/
2
))
{
if
(
tsTotalLogDirGB
!=
0
&&
tsAvailLogDirGB
<
(
tsMinimalLogDirGB
/
2
))
{
printf
(
"server disk space remain %.3f GB, stop write log
\n
"
,
tsDiskAvailGB
);
printf
(
"server disk space remain %.3f GB, stop write log
\n
"
,
tsAvailLogDirGB
);
fflush
(
stdout
);
return
;
return
;
}
}
...
...
src/util/src/tsystem.c
浏览文件 @
89b72283
...
@@ -326,15 +326,29 @@ bool taosGetDisk() {
...
@@ -326,15 +326,29 @@ bool taosGetDisk() {
struct
statvfs
info
;
struct
statvfs
info
;
const
double
unit
=
1024
*
1024
*
1024
;
const
double
unit
=
1024
*
1024
*
1024
;
if
(
statvfs
(
tsDirectory
,
&
info
))
{
if
(
statvfs
(
dataDir
,
&
info
))
{
ts
DiskUsed
GB
=
0
;
ts
TotalDataDir
GB
=
0
;
ts
TotalDisk
GB
=
0
;
ts
AvailDataDir
GB
=
0
;
return
false
;
return
false
;
}
else
{
tsTotalDataDirGB
=
(
float
)((
double
)
info
.
f_blocks
*
(
double
)
info
.
f_frsize
/
unit
);
tsAvailDataDirGB
=
(
float
)((
double
)
info
.
f_bavail
*
(
double
)
info
.
f_frsize
/
unit
);
}
if
(
statvfs
(
logDir
,
&
info
))
{
tsAvailLogDirGB
=
0
;
return
false
;
}
else
{
tsTotalLogDirGB
=
(
float
)((
double
)
info
.
f_blocks
*
(
double
)
info
.
f_frsize
/
unit
);
tsAvailLogDirGB
=
(
float
)((
double
)
info
.
f_bavail
*
(
double
)
info
.
f_frsize
/
unit
);
}
}
tsDiskAvailGB
=
(
float
)((
double
)
info
.
f_bavail
*
(
double
)
info
.
f_frsize
/
unit
);
if
(
statvfs
(
"/tmp"
,
&
info
))
{
tsTotalDiskGB
=
(
int32_t
)((
double
)
info
.
f_blocks
*
(
double
)
info
.
f_frsize
/
unit
);
tsAvailTmpDirGB
=
0
;
tsDiskUsedGB
=
(
float
)
tsTotalDiskGB
-
tsDiskAvailGB
;
return
false
;
}
else
{
tsTotalTmpDirGB
=
(
float
)((
double
)
info
.
f_blocks
*
(
double
)
info
.
f_frsize
/
unit
);
tsAvailTmpDirGB
=
(
float
)((
double
)
info
.
f_bavail
*
(
double
)
info
.
f_frsize
/
unit
);
}
return
true
;
return
true
;
}
}
...
@@ -563,7 +577,7 @@ void tsPrintOsInfo() {
...
@@ -563,7 +577,7 @@ void tsPrintOsInfo() {
pPrint
(
" os openMax: %ld"
,
tsOpenMax
);
pPrint
(
" os openMax: %ld"
,
tsOpenMax
);
pPrint
(
" os streamMax: %ld"
,
tsStreamMax
);
pPrint
(
" os streamMax: %ld"
,
tsStreamMax
);
pPrint
(
" os numOfCores: %d"
,
tsNumOfCores
);
pPrint
(
" os numOfCores: %d"
,
tsNumOfCores
);
pPrint
(
" os totalDisk: %
d(GB)"
,
tsTotalDisk
GB
);
pPrint
(
" os totalDisk: %
f(GB)"
,
tsTotalDataDir
GB
);
pPrint
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
pPrint
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
struct
utsname
buf
;
struct
utsname
buf
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录