Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f2e26de8
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看板
提交
f2e26de8
编写于
9月 15, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into refact/new_data_format
上级
9a42dca4
d0df914d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
51 addition
and
33 deletion
+51
-33
include/libs/tfs/tfs.h
include/libs/tfs/tfs.h
+8
-0
source/dnode/vnode/src/tsdb/tsdbFS.c
source/dnode/vnode/src/tsdb/tsdbFS.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbRetention.c
source/dnode/vnode/src/tsdb/tsdbRetention.c
+13
-2
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+3
-3
source/libs/tfs/src/tfs.c
source/libs/tfs/src/tfs.c
+2
-0
source/os/src/osSemaphore.c
source/os/src/osSemaphore.c
+4
-7
source/os/src/osSysinfo.c
source/os/src/osSysinfo.c
+16
-19
tests/system-test/0-others/taosShellNetChk.py
tests/system-test/0-others/taosShellNetChk.py
+1
-1
tests/system-test/1-insert/mutil_stage.py
tests/system-test/1-insert/mutil_stage.py
+3
-0
未找到文件。
include/libs/tfs/tfs.h
浏览文件 @
f2e26de8
...
...
@@ -69,6 +69,14 @@ void tfsUpdateSize(STfs *pTfs);
*/
SDiskSize
tfsGetSize
(
STfs
*
pTfs
);
/**
* @brief Get level of multi-tier storage.
*
* @param pTfs
* @return int32_t
*/
int32_t
tfsGetLevel
(
STfs
*
pTfs
);
/**
* @brief Allocate an existing available tier level from fs.
*
...
...
source/dnode/vnode/src/tsdb/tsdbFS.c
浏览文件 @
f2e26de8
...
...
@@ -58,7 +58,7 @@ static int32_t tsdbGnrtCurrent(STsdb *pTsdb, STsdbFS *pFS, char *fname) {
taosCalcChecksumAppend
(
0
,
pData
,
size
);
// create and write
pFD
=
taosOpenFile
(
fname
,
TD_FILE_WRITE
|
TD_FILE_CREATE
);
pFD
=
taosOpenFile
(
fname
,
TD_FILE_WRITE
|
TD_FILE_CREATE
|
TD_FILE_TRUNC
);
if
(
pFD
==
NULL
)
{
code
=
TAOS_SYSTEM_ERROR
(
errno
);
goto
_err
;
...
...
source/dnode/vnode/src/tsdb/tsdbRetention.c
浏览文件 @
f2e26de8
...
...
@@ -16,9 +16,19 @@
#include "tsdb.h"
static
bool
tsdbShouldDoRetention
(
STsdb
*
pTsdb
,
int64_t
now
)
{
STsdbKeepCfg
*
keepCfg
=
&
pTsdb
->
keepCfg
;
if
((
keepCfg
->
keep0
==
keepCfg
->
keep1
)
&&
(
keepCfg
->
keep1
==
keepCfg
->
keep2
))
{
return
false
;
}
if
(
tfsGetLevel
(
pTsdb
->
pVnode
->
pTfs
)
<=
1
)
{
return
false
;
}
for
(
int32_t
iSet
=
0
;
iSet
<
taosArrayGetSize
(
pTsdb
->
fs
.
aDFileSet
);
iSet
++
)
{
SDFileSet
*
pSet
=
(
SDFileSet
*
)
taosArrayGet
(
pTsdb
->
fs
.
aDFileSet
,
iSet
);
int32_t
expLevel
=
tsdbFidLevel
(
pSet
->
fid
,
&
pTsdb
->
keepCfg
,
now
);
int32_t
expLevel
=
tsdbFidLevel
(
pSet
->
fid
,
keepCfg
,
now
);
SDiskID
did
;
if
(
expLevel
==
pSet
->
diskId
.
level
)
continue
;
...
...
@@ -53,7 +63,7 @@ int32_t tsdbDoRetention(STsdb *pTsdb, int64_t now) {
if
(
code
)
goto
_err
;
for
(
int32_t
iSet
=
0
;
iSet
<
taosArrayGetSize
(
fs
.
aDFileSet
);
iSet
++
)
{
SDFileSet
*
pSet
=
(
SDFileSet
*
)
taosArrayGet
(
pTsdb
->
fs
.
aDFileSet
,
iSet
);
SDFileSet
*
pSet
=
(
SDFileSet
*
)
taosArrayGet
(
fs
.
aDFileSet
,
iSet
);
int32_t
expLevel
=
tsdbFidLevel
(
pSet
->
fid
,
&
pTsdb
->
keepCfg
,
now
);
SDiskID
did
;
...
...
@@ -65,6 +75,7 @@ int32_t tsdbDoRetention(STsdb *pTsdb, int64_t now) {
taosArrayRemove
(
fs
.
aDFileSet
,
iSet
);
iSet
--
;
}
else
{
if
(
expLevel
==
0
)
continue
;
if
(
tfsAllocDisk
(
pTsdb
->
pVnode
->
pTfs
,
expLevel
,
&
did
)
<
0
)
{
code
=
terrno
;
goto
_exit
;
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
f2e26de8
...
...
@@ -4780,7 +4780,7 @@ int32_t stateDurationFunction(SqlFunctionCtx* pCtx) {
colDataAppendNULL
(
pOutput
,
i
);
// handle selectivity
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
appendSelectivityValue
(
pCtx
,
i
,
i
);
appendSelectivityValue
(
pCtx
,
i
,
pCtx
->
offset
+
numOfElems
-
1
);
}
continue
;
}
...
...
@@ -4797,11 +4797,11 @@ int32_t stateDurationFunction(SqlFunctionCtx* pCtx) {
}
else
{
pInfo
->
durationStart
=
0
;
}
colDataAppend
(
pOutput
,
i
,
(
char
*
)
&
output
,
false
);
colDataAppend
(
pOutput
,
pCtx
->
offset
+
numOfElems
-
1
,
(
char
*
)
&
output
,
false
);
// handle selectivity
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
appendSelectivityValue
(
pCtx
,
i
,
i
);
appendSelectivityValue
(
pCtx
,
i
,
pCtx
->
offset
+
numOfElems
-
1
);
}
}
...
...
source/libs/tfs/src/tfs.c
浏览文件 @
f2e26de8
...
...
@@ -113,6 +113,8 @@ SDiskSize tfsGetSize(STfs *pTfs) {
return
size
;
}
int32_t
tfsGetLevel
(
STfs
*
pTfs
)
{
return
pTfs
->
nlevel
;
}
int32_t
tfsAllocDisk
(
STfs
*
pTfs
,
int32_t
expLevel
,
SDiskID
*
pDiskId
)
{
pDiskId
->
level
=
expLevel
;
pDiskId
->
id
=
-
1
;
...
...
source/os/src/osSemaphore.c
浏览文件 @
f2e26de8
...
...
@@ -400,6 +400,9 @@ int tsem_init(tsem_t *psem, int flags, unsigned int count) {
}
int
tsem_destroy
(
tsem_t
*
psem
)
{
if
(
psem
==
NULL
||
*
psem
==
NULL
)
return
-
1
;
dispatch_release
(
*
psem
);
*
psem
=
NULL
;
return
0
;
}
...
...
@@ -421,13 +424,7 @@ int tsem_timewait(tsem_t *psem, int64_t nanosecs) {
return
0
;
}
bool
taosCheckPthreadValid
(
TdThread
thread
)
{
int32_t
ret
=
taosThreadKill
(
thread
,
0
);
if
(
ret
==
ESRCH
)
return
false
;
if
(
ret
==
EINVAL
)
return
false
;
// alive
return
true
;
}
bool
taosCheckPthreadValid
(
TdThread
thread
)
{
return
thread
!=
0
;
}
int64_t
taosGetSelfPthreadId
()
{
TdThread
thread
=
taosThreadSelf
();
...
...
source/os/src/osSysinfo.c
浏览文件 @
f2e26de8
...
...
@@ -344,30 +344,27 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) {
*
numOfCores
=
si
.
dwNumberOfProcessors
;
return
0
;
#elif defined(_TD_DARWIN_64)
char
*
line
=
NULL
;
size_t
size
=
0
;
char
buf
[
16
];
int32_t
done
=
0
;
int32_t
code
=
-
1
;
TdFilePtr
pFile
=
taosOpenFile
(
"/proc/cpuinfo"
,
TD_FILE_READ
|
TD_FILE_STREAM
);
if
(
pFile
==
NULL
)
return
false
;
while
(
done
!=
3
&&
(
size
=
taosGetLineFile
(
pFile
,
&
line
))
!=
-
1
)
{
line
[
size
-
1
]
=
'\0'
;
if
(((
done
&
1
)
==
0
)
&&
strncmp
(
line
,
"model name"
,
10
)
==
0
)
{
const
char
*
v
=
strchr
(
line
,
':'
)
+
2
;
tstrncpy
(
cpuModel
,
v
,
maxLen
);
code
=
0
;
done
|=
1
;
}
else
if
(((
done
&
2
)
==
0
)
&&
strncmp
(
line
,
"cpu cores"
,
9
)
==
0
)
{
const
char
*
v
=
strchr
(
line
,
':'
)
+
2
;
*
numOfCores
=
atof
(
v
);
done
|=
2
;
}
TdCmdPtr
pCmd
=
taosOpenCmd
(
"sysctl -n machdep.cpu.brand_string"
);
if
(
pCmd
==
NULL
)
return
code
;
if
(
taosGetsCmd
(
pCmd
,
maxLen
,
cpuModel
)
>
0
)
{
code
=
0
;
done
|=
1
;
}
taosCloseCmd
(
&
pCmd
);
if
(
line
!=
NULL
)
taosMemoryFree
(
line
);
taosCloseFile
(
&
pFile
);
pCmd
=
taosOpenCmd
(
"sysctl -n machdep.cpu.core_count"
);
if
(
pCmd
==
NULL
)
return
code
;
memset
(
buf
,
0
,
sizeof
(
buf
));
if
(
taosGetsCmd
(
pCmd
,
maxLen
,
cpuModel
)
>
0
)
{
code
=
0
;
done
|=
2
;
*
numOfCores
=
atof
(
buf
);
}
taosCloseCmd
(
&
pCmd
);
return
code
;
#else
...
...
tests/system-test/0-others/taosShellNetChk.py
浏览文件 @
f2e26de8
...
...
@@ -231,7 +231,7 @@ class TDTestCase:
if
platform
.
system
().
lower
()
==
'windows'
:
os
.
system
(
'ps -a | grep taos | awk
\'
{print $2}
\'
| xargs kill -9'
)
else
:
os
.
system
(
'pkill taos'
)
os
.
system
(
'pkill
-9
taos'
)
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/system-test/1-insert/mutil_stage.py
浏览文件 @
f2e26de8
from
datetime
import
datetime
from
platform
import
platform
import
time
from
typing
import
List
,
Any
,
Tuple
...
...
@@ -83,6 +84,8 @@ class TDTestCase:
def
del_old_datadir
(
self
,
filename
):
cmd
=
f
"sed -i '/^dataDir/d'
{
filename
}
"
if
platform
.
system
().
lower
()
==
'darwin'
:
cmd
=
f
"sed -i '' '/^dataDir/d'
{
filename
}
"
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录