Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
9fbe6e47
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看板
提交
9fbe6e47
编写于
1月 16, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1207
上级
3998f089
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
345 addition
and
51 deletion
+345
-51
deps/zlib-1.2.11/src/gzlib.c
deps/zlib-1.2.11/src/gzlib.c
+2
-2
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+1
-1
src/client/src/tscSub.c
src/client/src/tscSub.c
+2
-2
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+3
-3
src/os/src/detail/osDir.c
src/os/src/detail/osDir.c
+4
-1
src/os/src/windows/wSignal.c
src/os/src/windows/wSignal.c
+2
-0
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+2
-2
src/sync/src/syncRestore.c
src/sync/src/syncRestore.c
+1
-1
src/sync/src/syncRetrieve.c
src/sync/src/syncRetrieve.c
+3
-3
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+2
-2
src/tsdb/src/tsdbFile.c
src/tsdb/src/tsdbFile.c
+2
-2
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+2
-2
src/util/src/tfile.c
src/util/src/tfile.c
+2
-2
src/util/src/tkvstore.c
src/util/src/tkvstore.c
+6
-6
tests/script/sh/deploy.bat
tests/script/sh/deploy.bat
+155
-0
tests/script/sh/exec.bat
tests/script/sh/exec.bat
+115
-0
tests/script/sh/stop_dnodes.bat
tests/script/sh/stop_dnodes.bat
+24
-0
tests/script/wtest.bat
tests/script/wtest.bat
+17
-22
未找到文件。
deps/zlib-1.2.11/src/gzlib.c
浏览文件 @
9fbe6e47
...
...
@@ -240,9 +240,9 @@ local gzFile gz_open(path, fd, mode)
/* open the file with the appropriate flags (or just use fd) */
state
->
fd
=
fd
>
-
1
?
fd
:
(
#ifdef WIDECHAR
fd
==
-
2
?
_wopen
(
path
,
oflag
,
0666
)
:
fd
==
-
2
?
_wopen
(
path
,
oflag
|
O_BINARY
,
0666
)
:
#endif
open
((
const
char
*
)
path
,
oflag
,
0666
));
open
((
const
char
*
)
path
,
oflag
|
O_BINARY
,
0666
));
if
(
state
->
fd
==
-
1
)
{
free
(
state
->
path
);
free
(
state
);
...
...
src/client/src/tscParseInsert.c
浏览文件 @
9fbe6e47
...
...
@@ -1545,7 +1545,7 @@ void tscProcessMultiVnodesImportFromFile(SSqlObj *pSql) {
SSqlObj
*
pNew
=
createSubqueryObj
(
pSql
,
0
,
parseFileSendDataBlock
,
pSupporter
,
TSDB_SQL_INSERT
,
NULL
);
pCmd
->
count
=
1
;
FILE
*
fp
=
fopen
(
pCmd
->
payload
,
"r"
);
FILE
*
fp
=
fopen
(
pCmd
->
payload
,
"r
b
"
);
if
(
fp
==
NULL
)
{
pSql
->
res
.
code
=
TAOS_SYSTEM_ERROR
(
errno
);
tscError
(
"%p failed to open file %s to load data from file, code:%s"
,
pSql
,
pCmd
->
payload
,
tstrerror
(
pSql
->
res
.
code
));
...
...
src/client/src/tscSub.c
浏览文件 @
9fbe6e47
...
...
@@ -313,7 +313,7 @@ static int tscLoadSubscriptionProgress(SSub* pSub) {
char
buf
[
TSDB_MAX_SQL_LEN
];
sprintf
(
buf
,
"%s/subscribe/%s"
,
tsDataDir
,
pSub
->
topic
);
FILE
*
fp
=
fopen
(
buf
,
"r"
);
FILE
*
fp
=
fopen
(
buf
,
"r
b
"
);
if
(
fp
==
NULL
)
{
tscDebug
(
"subscription progress file does not exist: %s"
,
pSub
->
topic
);
return
1
;
...
...
@@ -368,7 +368,7 @@ void tscSaveSubscriptionProgress(void* sub) {
}
sprintf
(
path
,
"%s/subscribe/%s"
,
tsDataDir
,
pSub
->
topic
);
FILE
*
fp
=
fopen
(
path
,
"w+"
);
FILE
*
fp
=
fopen
(
path
,
"w
b
+"
);
if
(
fp
==
NULL
)
{
tscError
(
"failed to create progress file for subscription: %s"
,
pSub
->
topic
);
return
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
9fbe6e47
...
...
@@ -930,7 +930,7 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
if
(
numOfRows
>
0
)
{
// write the compressed timestamp to disk file
if
(
pSupporter
->
f
==
NULL
)
{
pSupporter
->
f
=
fopen
(
pSupporter
->
path
,
"w"
);
pSupporter
->
f
=
fopen
(
pSupporter
->
path
,
"w
b
"
);
if
(
pSupporter
->
f
==
NULL
)
{
tscError
(
"%p failed to create tmp file:%s, reason:%s"
,
pSql
,
pSupporter
->
path
,
strerror
(
errno
));
...
...
@@ -974,7 +974,7 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
// continue to retrieve ts-comp data from vnode
if
(
!
pRes
->
completed
)
{
taosGetTmpfilePath
(
"ts-join"
,
pSupporter
->
path
);
pSupporter
->
f
=
fopen
(
pSupporter
->
path
,
"w"
);
pSupporter
->
f
=
fopen
(
pSupporter
->
path
,
"w
b
"
);
pRes
->
row
=
pRes
->
numOfRows
;
taos_fetch_rows_a
(
tres
,
tsCompRetrieveCallback
,
param
);
...
...
@@ -1000,7 +1000,7 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
taosGetTmpfilePath
(
"ts-join"
,
pSupporter
->
path
);
// TODO check for failure
pSupporter
->
f
=
fopen
(
pSupporter
->
path
,
"w"
);
pSupporter
->
f
=
fopen
(
pSupporter
->
path
,
"w
b
"
);
pRes
->
row
=
pRes
->
numOfRows
;
// set the callback function
...
...
src/os/src/detail/osDir.c
浏览文件 @
9fbe6e47
...
...
@@ -54,6 +54,9 @@ int taosMkDir(const char *path, mode_t mode) {
void
taosRename
(
char
*
oldName
,
char
*
newName
)
{
// if newName in not empty, rename return fail.
// the newName must be empty or does not exist
#ifdef WINDOWS
remove
(
newName
);
#endif
if
(
rename
(
oldName
,
newName
))
{
uError
(
"failed to rename file %s to %s, reason:%s"
,
oldName
,
newName
,
strerror
(
errno
));
}
else
{
...
...
@@ -117,7 +120,7 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) {
goto
cmp_end
;
}
int32_t
fd
=
open
(
destFileName
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
);
int32_t
fd
=
open
(
destFileName
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
|
O_BINARY
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
);
if
(
fd
<
0
)
{
ret
=
-
2
;
goto
cmp_end
;
...
...
src/os/src/windows/wSignal.c
浏览文件 @
9fbe6e47
...
...
@@ -23,9 +23,11 @@ void taosSetSignal(int32_t signum, FSignalHandler sigfp) {
}
void
taosIgnSignal
(
int32_t
signum
)
{
if
(
signum
==
SIGUSR1
)
return
;
signal
(
signum
,
SIG_IGN
);
}
void
taosDflSignal
(
int32_t
signum
)
{
if
(
signum
==
SIGUSR1
)
return
;
signal
(
signum
,
SIG_DFL
);
}
src/query/src/qTsbuf.c
浏览文件 @
9fbe6e47
...
...
@@ -23,7 +23,7 @@ STSBuf* tsBufCreate(bool autoDelete, int32_t order) {
pTSBuf
->
autoDelete
=
autoDelete
;
taosGetTmpfilePath
(
"join"
,
pTSBuf
->
path
);
pTSBuf
->
f
=
fopen
(
pTSBuf
->
path
,
"w+"
);
pTSBuf
->
f
=
fopen
(
pTSBuf
->
path
,
"w
b
+"
);
if
(
pTSBuf
->
f
==
NULL
)
{
free
(
pTSBuf
);
return
NULL
;
...
...
@@ -59,7 +59,7 @@ STSBuf* tsBufCreateFromFile(const char* path, bool autoDelete) {
tstrncpy
(
pTSBuf
->
path
,
path
,
sizeof
(
pTSBuf
->
path
));
pTSBuf
->
f
=
fopen
(
pTSBuf
->
path
,
"r+"
);
pTSBuf
->
f
=
fopen
(
pTSBuf
->
path
,
"r
b
+"
);
if
(
pTSBuf
->
f
==
NULL
)
{
free
(
pTSBuf
);
return
NULL
;
...
...
src/sync/src/syncRestore.c
浏览文件 @
9fbe6e47
...
...
@@ -128,7 +128,7 @@ static int32_t syncRestoreFile(SSyncPeer *pPeer, uint64_t *fversion) {
minfo
.
name
[
sizeof
(
minfo
.
name
)
-
1
]
=
0
;
snprintf
(
name
,
sizeof
(
name
),
"%s/%s"
,
pNode
->
path
,
minfo
.
name
);
int32_t
dfd
=
open
(
name
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
);
int32_t
dfd
=
open
(
name
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
|
O_BINARY
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
);
if
(
dfd
<
0
)
{
sError
(
"%s, failed to open file:%s while restore file since %s"
,
pPeer
->
id
,
minfo
.
name
,
strerror
(
errno
));
break
;
...
...
src/sync/src/syncRetrieve.c
浏览文件 @
9fbe6e47
...
...
@@ -152,7 +152,7 @@ static int32_t syncRetrieveFile(SSyncPeer *pPeer) {
snprintf
(
name
,
sizeof
(
name
),
"%s/%s"
,
pNode
->
path
,
fileInfo
.
name
);
// send the file to peer
int32_t
sfd
=
open
(
name
,
O_RDONLY
);
int32_t
sfd
=
open
(
name
,
O_RDONLY
|
O_BINARY
);
if
(
sfd
<
0
)
{
code
=
-
1
;
sError
(
"%s, failed to open file:%s while retrieve file since %s"
,
pPeer
->
id
,
fileInfo
.
name
,
strerror
(
errno
));
...
...
@@ -221,7 +221,7 @@ static int32_t syncReadOneWalRecord(int32_t sfd, SWalHead *pHead) {
}
static
int32_t
syncRetrieveLastWal
(
SSyncPeer
*
pPeer
,
char
*
name
,
uint64_t
fversion
,
int64_t
offset
)
{
int32_t
sfd
=
open
(
name
,
O_RDONLY
);
int32_t
sfd
=
open
(
name
,
O_RDONLY
|
O_BINARY
);
if
(
sfd
<
0
)
{
sError
(
"%s, failed to open wal:%s for retrieve since:%s"
,
pPeer
->
id
,
name
,
tstrerror
(
errno
));
return
-
1
;
...
...
@@ -376,7 +376,7 @@ static int32_t syncRetrieveWal(SSyncPeer *pPeer) {
size
=
fstat
.
st_size
;
sDebug
(
"%s, retrieve wal:%s size:%d"
,
pPeer
->
id
,
fname
,
size
);
int32_t
sfd
=
open
(
fname
,
O_RDONLY
);
int32_t
sfd
=
open
(
fname
,
O_RDONLY
|
O_BINARY
);
if
(
sfd
<
0
)
{
code
=
-
1
;
sError
(
"%s, failed to open wal:%s for retrieve since %s, code:0x%x"
,
pPeer
->
id
,
fname
,
strerror
(
errno
),
code
);
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
9fbe6e47
...
...
@@ -269,11 +269,11 @@ static int tsdbCommitToFile(STsdbRepo *pRepo, int fid, SCommitIter *iters, SRWHe
pthread_rwlock_wrlock
(
&
(
pFileH
->
fhlock
));
(
void
)
r
ename
(
helperNewHeadF
(
pHelper
)
->
fname
,
helperHeadF
(
pHelper
)
->
fname
);
(
void
)
taosR
ename
(
helperNewHeadF
(
pHelper
)
->
fname
,
helperHeadF
(
pHelper
)
->
fname
);
pGroup
->
files
[
TSDB_FILE_TYPE_HEAD
].
info
=
helperNewHeadF
(
pHelper
)
->
info
;
if
(
newLast
)
{
(
void
)
r
ename
(
helperNewLastF
(
pHelper
)
->
fname
,
helperLastF
(
pHelper
)
->
fname
);
(
void
)
taosR
ename
(
helperNewLastF
(
pHelper
)
->
fname
,
helperLastF
(
pHelper
)
->
fname
);
pGroup
->
files
[
TSDB_FILE_TYPE_LAST
].
info
=
helperNewLastF
(
pHelper
)
->
info
;
}
else
{
pGroup
->
files
[
TSDB_FILE_TYPE_LAST
].
info
=
helperLastF
(
pHelper
)
->
info
;
...
...
src/tsdb/src/tsdbFile.c
浏览文件 @
9fbe6e47
...
...
@@ -175,7 +175,7 @@ int tsdbOpenFileH(STsdbRepo *pRepo) {
}
sprintf
(
fname2
,
"%s/%s_back_%"
PRId64
,
tDataDir
,
dp
->
d_name
,
taosGetTimestamp
(
TSDB_TIME_PRECISION_MILLI
));
(
void
)
r
ename
(
fname1
,
fname2
);
(
void
)
taosR
ename
(
fname1
,
fname2
);
tsdbDebug
(
"vgId:%d file %s exists, backup it as %s"
,
REPO_ID
(
pRepo
),
fname1
,
fname2
);
...
...
@@ -339,7 +339,7 @@ SFileGroup *tsdbGetFileGroupNext(SFileGroupIter *pIter) {
int
tsdbOpenFile
(
SFile
*
pFile
,
int
oflag
)
{
ASSERT
(
!
TSDB_IS_FILE_OPENED
(
pFile
));
pFile
->
fd
=
open
(
pFile
->
fname
,
oflag
,
0755
);
pFile
->
fd
=
open
(
pFile
->
fname
,
oflag
|
O_BINARY
,
0755
);
if
(
pFile
->
fd
<
0
)
{
tsdbError
(
"failed to open file %s since %s"
,
pFile
->
fname
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
9fbe6e47
...
...
@@ -537,7 +537,7 @@ static int32_t tsdbSaveConfig(char *rootDir, STsdbCfg *pCfg) {
goto
_err
;
}
fd
=
open
(
fname
,
O_WRONLY
|
O_CREAT
,
0755
);
fd
=
open
(
fname
,
O_WRONLY
|
O_CREAT
|
O_BINARY
,
0755
);
if
(
fd
<
0
)
{
tsdbError
(
"vgId:%d failed to open file %s since %s"
,
pCfg
->
tsdbId
,
fname
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
...
...
@@ -583,7 +583,7 @@ static int tsdbLoadConfig(char *rootDir, STsdbCfg *pCfg) {
goto
_err
;
}
fd
=
open
(
fname
,
O_RDONLY
);
fd
=
open
(
fname
,
O_RDONLY
|
O_BINARY
);
if
(
fd
<
0
)
{
tsdbError
(
"failed to open file %s since %s"
,
fname
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
...
...
src/util/src/tfile.c
浏览文件 @
9fbe6e47
...
...
@@ -54,12 +54,12 @@ static int64_t tfOpenImp(int32_t fd) {
}
int64_t
tfOpen
(
const
char
*
pathname
,
int32_t
flags
)
{
int32_t
fd
=
open
(
pathname
,
flags
);
int32_t
fd
=
open
(
pathname
,
flags
|
O_BINARY
);
return
tfOpenImp
(
fd
);
}
int64_t
tfOpenM
(
const
char
*
pathname
,
int32_t
flags
,
mode_t
mode
)
{
int32_t
fd
=
open
(
pathname
,
flags
,
mode
);
int32_t
fd
=
open
(
pathname
,
flags
|
O_BINARY
,
mode
);
return
tfOpenImp
(
fd
);
}
...
...
src/util/src/tkvstore.c
浏览文件 @
9fbe6e47
...
...
@@ -50,7 +50,7 @@ static void * tdDecodeKVRecord(void *buf, SKVRecord *pRecord);
static
int
tdRestoreKVStore
(
SKVStore
*
pStore
);
int
tdCreateKVStore
(
char
*
fname
)
{
int
fd
=
open
(
fname
,
O_RDWR
|
O_CREAT
,
0755
);
int
fd
=
open
(
fname
,
O_RDWR
|
O_CREAT
|
O_BINARY
,
0755
);
if
(
fd
<
0
)
{
uError
(
"failed to open file %s since %s"
,
fname
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
...
...
@@ -96,14 +96,14 @@ SKVStore *tdOpenKVStore(char *fname, iterFunc iFunc, afterFunc aFunc, void *appH
SKVStore
*
pStore
=
tdNewKVStore
(
fname
,
iFunc
,
aFunc
,
appH
);
if
(
pStore
==
NULL
)
return
NULL
;
pStore
->
fd
=
open
(
pStore
->
fname
,
O_RDWR
);
pStore
->
fd
=
open
(
pStore
->
fname
,
O_RDWR
|
O_BINARY
);
if
(
pStore
->
fd
<
0
)
{
uError
(
"failed to open file %s since %s"
,
pStore
->
fname
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
goto
_err
;
}
pStore
->
sfd
=
open
(
pStore
->
fsnap
,
O_RDONLY
);
pStore
->
sfd
=
open
(
pStore
->
fsnap
,
O_RDONLY
|
O_BINARY
);
if
(
pStore
->
sfd
<
0
)
{
if
(
errno
!=
ENOENT
)
{
uError
(
"failed to open file %s since %s"
,
pStore
->
fsnap
,
strerror
(
errno
));
...
...
@@ -172,14 +172,14 @@ void tdCloseKVStore(SKVStore *pStore) { tdFreeKVStore(pStore); }
int
tdKVStoreStartCommit
(
SKVStore
*
pStore
)
{
ASSERT
(
pStore
->
fd
<
0
);
pStore
->
fd
=
open
(
pStore
->
fname
,
O_RDWR
);
pStore
->
fd
=
open
(
pStore
->
fname
,
O_RDWR
|
O_BINARY
);
if
(
pStore
->
fd
<
0
)
{
uError
(
"failed to open file %s since %s"
,
pStore
->
fname
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
goto
_err
;
}
pStore
->
sfd
=
open
(
pStore
->
fsnap
,
O_WRONLY
|
O_CREAT
,
0755
);
pStore
->
sfd
=
open
(
pStore
->
fsnap
,
O_WRONLY
|
O_CREAT
|
O_BINARY
,
0755
);
if
(
pStore
->
sfd
<
0
)
{
uError
(
"failed to open file %s since %s"
,
pStore
->
fsnap
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
...
...
@@ -336,7 +336,7 @@ void tsdbGetStoreInfo(char *fname, uint32_t *magic, int64_t *size) {
char
buf
[
TD_KVSTORE_HEADER_SIZE
]
=
"
\0
"
;
SStoreInfo
info
=
{
0
};
int
fd
=
open
(
fname
,
O_RDONLY
);
int
fd
=
open
(
fname
,
O_RDONLY
|
O_BINARY
);
if
(
fd
<
0
)
goto
_err
;
if
(
taosRead
(
fd
,
buf
,
TD_KVSTORE_HEADER_SIZE
)
<
TD_KVSTORE_HEADER_SIZE
)
goto
_err
;
...
...
tests/script/sh/deploy.bat
0 → 100644
浏览文件 @
9fbe6e47
#
!
/bin/bash
echo
"Executing deploy.sh"
if
[
$#
!
=
4
];
then
echo
"argument list need input : "
echo
" -n nodeName"
echo
" -i nodePort"
exit
1
fi
NODE_NAME
=
NODE
=
while
getopts
"n:i:"
arg
do
case
$arg
in
n
)
NODE_NAME
=
$OPTARG
;;
i
)
NODE
=
$OPTARG
;;
?)
echo
"unkonw argument"
;;
esac
done
SCRIPT_DIR
=
`dirname $0`
cd
$SCRIPT_DIR/../
SCRIPT_DIR
=
`pwd`
echo
"SCRIPT_DIR: $SCRIPT_DIR"
IN_TDINTERNAL
=
"community"
if
[[
"$SCRIPT_DIR"
==
*
"$IN_TDINTERNAL"
*
]];
then
cd
../../..
else
cd
../../
fi
TAOS_DIR
=
`pwd`
TAOSD_DIR
=
`find . -name "taosd"|grep bin|head -n1`
if
[[
"$TAOSD_DIR"
==
*
"$IN_TDINTERNAL"
*
]];
then
BIN_DIR
=
`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3`
else
BIN_DIR
=
`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2`
fi
BUILD_DIR
=
$TAOS_DIR/$BIN_DIR/build
SIM_DIR
=
$TAOS_DIR/sim
NODE_DIR
=
$SIM_DIR/$NODE_NAME
EXE_DIR
=
$BUILD_DIR/bin
CFG_DIR
=
$NODE_DIR/cfg
LOG_DIR
=
$NODE_DIR/log
DATA_DIR
=
$NODE_DIR/data
rm
-rf
$NODE_DIR
mkdir
-p
$SIM_DIR
mkdir
-p
$NODE_DIR
mkdir
-p
$LOG_DIR
mkdir
-p
$DATA_DIR
#cp
-rf
$TAOS_DIR/cfg $NODE_DIR/
mkdir
-p
$CFG_DIR
#allow
normal
user
to
read
/write
log
chmod
-R
777
$NODE_DIR
TAOS_CFG
=
$NODE_DIR/cfg/taos.cfg
touch
-f
$TAOS_CFG
TAOS_FLAG
=
$SIM_DIR/tsim/flag
if
[
-f
"$TAOS_FLAG"
]
;
then
TAOS_CFG
=
/etc/taos/taos
.cfg
DATA_DIR
=
/var/lib/taos
LOG_DIR
=
/var/log/taos
sudo
rm
-f /etc/taos
/
*
.cfg
sudo
cp
-rf
$TAOS_DIR/cfg/
*
.cfg
/etc/taos
sudo
rm
-rf
$DATA_DIR
sudo
rm
-rf
$LOG_DIR
fi
HOSTNAME
=
`hostname -f`
if
[
$NODE
-eq
1
];
then
NODE
=
7100
elif
[
$NODE
-eq
2
];
then
NODE
=
7200
elif
[
$NODE
-eq
3
];
then
NODE
=
7300
elif
[
$NODE
-eq
4
];
then
NODE
=
7400
elif
[
$NODE
-eq
5
];
then
NODE
=
7500
elif
[
$NODE
-eq
6
];
then
NODE
=
7600
elif
[
$NODE
-eq
7
];
then
NODE
=
7700
elif
[
$NODE
-eq
8
];
then
NODE
=
7800
fi
echo
" "
>>
$TAOS_CFG
echo
"firstEp ${HOSTNAME}:7100"
>>
$TAOS_CFG
echo
"secondEp ${HOSTNAME}:7200"
>>
$TAOS_CFG
echo
"serverPort ${NODE}"
>>
$TAOS_CFG
echo
"dataDir $DATA_DIR"
>>
$TAOS_CFG
echo
"logDir $LOG_DIR"
>>
$TAOS_CFG
echo
"debugFlag 0"
>>
$TAOS_CFG
echo
"mDebugFlag 143"
>>
$TAOS_CFG
echo
"sdbDebugFlag 143"
>>
$TAOS_CFG
echo
"dDebugFlag 143"
>>
$TAOS_CFG
echo
"vDebugFlag 143"
>>
$TAOS_CFG
echo
"tsdbDebugFlag 143"
>>
$TAOS_CFG
echo
"cDebugFlag 143"
>>
$TAOS_CFG
echo
"jnidebugFlag 143"
>>
$TAOS_CFG
echo
"odbcdebugFlag 143"
>>
$TAOS_CFG
echo
"httpDebugFlag 143"
>>
$TAOS_CFG
echo
"monDebugFlag 143"
>>
$TAOS_CFG
echo
"mqttDebugFlag 143"
>>
$TAOS_CFG
echo
"qdebugFlag 143"
>>
$TAOS_CFG
echo
"rpcDebugFlag 143"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"udebugFlag 143"
>>
$TAOS_CFG
echo
"sdebugFlag 143"
>>
$TAOS_CFG
echo
"wdebugFlag 143"
>>
$TAOS_CFG
echo
"cqdebugFlag 143"
>>
$TAOS_CFG
echo
"monitor 0"
>>
$TAOS_CFG
echo
"monitorInterval 1"
>>
$TAOS_CFG
echo
"http 0"
>>
$TAOS_CFG
echo
"slaveQuery 0"
>>
$TAOS_CFG
echo
"numOfThreadsPerCore 2.0"
>>
$TAOS_CFG
echo
"defaultPass taosdata"
>>
$TAOS_CFG
echo
"numOfLogLines 20000000"
>>
$TAOS_CFG
echo
"mnodeEqualVnodeNum 0"
>>
$TAOS_CFG
echo
"balanceInterval 1"
>>
$TAOS_CFG
echo
"clog 2"
>>
$TAOS_CFG
#echo
"cache 1"
>>
$TAOS_CFG
echo
"days 10"
>>
$TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"maxVgroupsPerDb 4"
>>
$TAOS_CFG
echo
"minTablesPerVnode 4"
>>
$TAOS_CFG
echo
"maxTablesPerVnode 1000"
>>
$TAOS_CFG
echo
"tableIncStepPerVnode 10000"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
echo
"numOfMnodes 1"
>>
$TAOS_CFG
echo
"locale en_US.UTF-8"
>>
$TAOS_CFG
echo
"fsync 0"
>>
$TAOS_CFG
echo
"telemetryReporting 0"
>>
$TAOS_CFG
echo
" "
>>
$TAOS_CFG
tests/script/sh/exec.bat
0 → 100644
浏览文件 @
9fbe6e47
#
!
/bin/bash
#
if
[
$#
!
=
4
||
$#
!
=
5
];
then
#
echo
"argument list need input : "
#
echo
" -n nodeName"
#
echo
" -s start/stop"
#
echo
" -c clear"
#
exit
1
#
fi
NODE_NAME
=
EXEC_OPTON
=
CLEAR_OPTION
=
"false"
while
getopts
"n:s:u:x:ct"
arg
do
case
$arg
in
n
)
NODE_NAME
=
$OPTARG
;;
s
)
EXEC_OPTON
=
$OPTARG
;;
c
)
CLEAR_OPTION
=
"clear"
;;
t
)
SHELL_OPTION
=
"true"
;;
u
)
USERS
=
$OPTARG
;;
x
)
SIGNAL
=
$OPTARG
;;
?)
echo
"unkown argument"
;;
esac
done
SCRIPT_DIR
=
`dirname $0`
cd
$SCRIPT_DIR/../
SCRIPT_DIR
=
`pwd`
IN_TDINTERNAL
=
"community"
if
[[
"$SCRIPT_DIR"
==
*
"$IN_TDINTERNAL"
*
]];
then
cd
../../..
else
cd
../../
fi
TAOS_DIR
=
`pwd`
TAOSD_DIR
=
`find . -name "taosd"|grep bin|head -n1`
if
[[
"$TAOSD_DIR"
==
*
"$IN_TDINTERNAL"
*
]];
then
BIN_DIR
=
`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3`
else
BIN_DIR
=
`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2`
fi
BUILD_DIR
=
$TAOS_DIR/$BIN_DIR/build
SIM_DIR
=
$TAOS_DIR/sim
NODE_DIR
=
$SIM_DIR/$NODE_NAME
EXE_DIR
=
$BUILD_DIR/bin
CFG_DIR
=
$NODE_DIR/cfg
LOG_DIR
=
$NODE_DIR/log
DATA_DIR
=
$NODE_DIR/data
MGMT_DIR
=
$NODE_DIR/data/mgmt
TSDB_DIR
=
$NODE_DIR/data/tsdb
TAOS_CFG
=
$NODE_DIR/cfg/taos.cfg
echo
------------
$EXEC_OPTON $NODE_NAME
TAOS_FLAG
=
$SIM_DIR/tsim/flag
if
[
-f
"$TAOS_FLAG"
];
then
EXE_DIR
=
/usr/local/bin/taos
fi
if
[
"$CLEAR_OPTION"
=
"clear"
];
then
echo
rm
-rf
$MGMT_DIR $TSDB_DIR
rm
-rf
$TSDB_DIR
rm
-rf
$MGMT_DIR
fi
if
[
"$EXEC_OPTON"
=
"start"
];
then
echo
"ExcuteCmd:"
$EXE_DIR/taosd
-c
$CFG_DIR
if
[
"$SHELL_OPTION"
=
"true"
];
then
TT
=
`date +
%s
`
mkdir
$
{
LOG_DIR
}
/$
{
TT
}
nohup
valgrind
--log-file
=
$
{
LOG_DIR
}
/$
{
TT
}
/valgrind
.log
--tool
=
memcheck
--leak-check
=
full
--show-reachable
=
no
--track-origins
=
yes
--show-leak-kinds
=
all
-v --workaround-gcc
296
-bugs
=
yes
$EXE_DIR/taosd
-c
$CFG_DIR
>
/dev/null
2
>&
1
&
else
nohup
$EXE_DIR/taosd
-c
$CFG_DIR
>
/dev/null
2
>&
1
&
fi
else
#relative
path
RCFG_DIR
=
sim
/$NODE_NAME/cfg
PID
=
`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'`
while
[
-n
"$PID"
]
do
if
[
"$SIGNAL"
=
"SIGKILL"
];
then
echo
try
to
kill
by
signal
SIGKILL
kill
-
9
$PID
else
echo
try
to
kill
by
signal
SIGINT
kill
-SIGINT
$PID
fi
sleep
1
PID
=
`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'`
done
fi
tests/script/sh/stop_dnodes.bat
0 → 100644
浏览文件 @
9fbe6e47
#
!
/bin/sh
PID
=
`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'`
if
[
-n
"$PID"
];
then
echo
systemctl
stop
taosd
systemctl
stop
taosd
fi
PID
=
`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
while
[
-n
"$PID"
];
do
echo
kill
-
9
$PID
pkill
-
9
taosd
fuser
-k -n
tcp
6030
PID
=
`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
done
PID
=
`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
while
[
-n
"$PID"
];
do
echo
kill
-
9
$PID
pkill
-
9
tarbitrator
fuser
-k -n
tcp
6040
PID
=
`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
done
tests/script/wtest.bat
浏览文件 @
9fbe6e47
...
...
@@ -6,8 +6,8 @@ echo Start TDengine Testing Case ...
set
"SCRIPT_DIR=
%~dp0
"
echo
SCRIPT_DIR
:
%SCRIPT_DIR%
set
"BUILD_DIR=
%~dp0
..\..\debug\
32\
build\bin"
set
"TSIM=
%~dp0
..\..\debug\
32\
build\bin\tsim"
set
"BUILD_DIR=
%~dp0
..\..\debug\build\bin"
set
"TSIM=
%~dp0
..\..\debug\build\bin\tsim"
echo
BUILD_DIR
:
%BUILD_DIR%
set
"SIM_DIR=
%~dp0
..\..\sim"
...
...
@@ -32,29 +32,24 @@ if exist %LOG_DIR% rmdir /s/q %LOG_DIR%
if
not
exist
%CFG_DIR%
mkdir
%CFG_DIR%
if
not
exist
%LOG_DIR%
mkdir
%LOG_DIR%
echo
firstEp
%FIRSTEP%
>
%TAOS_CFG%
echo
serverPort
6030
>>
%TAOS_CFG%
echo
wal
2
>>
%TAOS_CFG%
echo
asyncLog
0
>>
%TAOS_CFG%
echo
locale
en_US
.UTF
-
8
>>
%TAOS_CFG%
echo
logDir
%LOG_DIR%
>>
%TAOS_CFG%
echo
scriptDir
%SCRIPT_DIR%
>>
%TAOS_CFG%
echo
numOfLogLines
100000000
>>
%TAOS_CFG%
echo
tmrDebugFlag
131
>>
%TAOS_CFG%
echo
rpcDebugFlag
143
>>
%TAOS_CFG%
echo
cDebugFlag
143
>>
%TAOS_CFG%
echo
qdebugFlag
143
>>
%TAOS_CFG%
echo
udebugFlag
143
>>
%TAOS_CFG%
set
"FILE_NAME=windows\testSuite.sim"
set
"FIRSTEP=192.168.1.182"
echo
firstEp
localhost
>
%TAOS_CFG%
echo
serverPort
7100
>>
%TAOS_CFG%
echo
logDir
%LOG_DIR%
>>
%TAOS_CFG%
echo
scriptDir
%SCRIPT_DIR%
>>
%TAOS_CFG%
echo
numOfLogLines
100000000
>>
%TAOS_CFG%
echo
rpcDebugFlag
143
>>
%TAOS_CFG%
echo
tmrDebugFlag
131
>>
%TAOS_CFG%
echo
cDebugFlag
143
>>
%TAOS_CFG%
echo
udebugFlag
143
>>
%TAOS_CFG%
echo
wal
0
>>
%TAOS_CFG%
echo
asyncLog
0
>>
%TAOS_CFG%
echo
locale
en_US
.UTF
-
8
>>
%TAOS_CFG%
echo
enableCoreFile
1
>>
%TAOS_CFG%
set
"FILE_NAME=testSuite.sim"
if
"
%
1"
==
"-f"
set
"FILE_NAME=
%
2"
if
"
%
1"
==
"-h"
set
"FIRSTEP=
%
2"
if
"
%
3"
==
"-f"
set
"FILE_NAME=
%
4"
if
"
%
3"
==
"-h"
set
"FIRSTEP=
%
4"
echo
FILE_NAME
:
%FILE_NAME%
echo
FIRSTEP
:
%FIRSTEP%
echo
ExcuteCmd
:
%tsim%
-c
%CFG_DIR%
-f
%FILE_NAME%
%tsim%
-c
%CFG_DIR%
-f
%FILE_NAME%
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录