Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e363c01d
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看板
提交
e363c01d
编写于
8月 29, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into feature/os
上级
544562af
70ff6014
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
84 addition
and
43 deletion
+84
-43
README.md
README.md
+1
-1
src/inc/taoserror.h
src/inc/taoserror.h
+1
-0
src/mnode/src/mnodeMain.c
src/mnode/src/mnodeMain.c
+16
-5
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+5
-0
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-0
tests/script/jenkins/unique.txt
tests/script/jenkins/unique.txt
+8
-32
tests/script/tmp/prepare.sim
tests/script/tmp/prepare.sim
+1
-0
tests/script/unique/account/usage.sim
tests/script/unique/account/usage.sim
+6
-5
tests/script/unique/mnode/mgmt21.sim
tests/script/unique/mnode/mgmt21.sim
+44
-0
tests/script/unique/mnode/testSuite.sim
tests/script/unique/mnode/testSuite.sim
+1
-0
未找到文件。
README.md
浏览文件 @
e363c01d
...
...
@@ -2,7 +2,7 @@
[
![Build status
](
https://ci.appveyor.com/api/projects/status/kf3pwh2or5afsgl9/branch/master?svg=true
)
](https://ci.appveyor.com/project/sangshuduo/tdengine-2n8ge/branch/master)
[
![Coverage Status
](
https://coveralls.io/repos/github/taosdata/TDengine/badge.svg?branch=develop
)
](https://coveralls.io/github/taosdata/TDengine?branch=develop)
[
![CII Best Practices
](
https://bestpractices.coreinfrastructure.org/projects/4201/badge
)
](https://bestpractices.coreinfrastructure.org/projects/4201)
![
Docker Pulls
](
https://img.shields.io/docker/pulls
/tdengine/tdengine
)
[
![Docker Pulls
](
https://img.shields.io/docker/pulls/tdengine/tdengine
)
](https://hub.docker.com/repository/docker
/tdengine/tdengine)
[
![TDengine
](
TDenginelogo.png
)
](https://www.taosdata.com)
...
...
src/inc/taoserror.h
浏览文件 @
e363c01d
...
...
@@ -140,6 +140,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_NOT_READY, 0, 0x033C, "Cluster no
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACCT_ALREADY_EXIST
,
0
,
0x0340
,
"Account already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_ACCT
,
0
,
0x0341
,
"Invalid account"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_ACCT_OPTION
,
0
,
0x0342
,
"Invalid account options"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACCT_EXPIRED
,
0
,
0x0343
,
"Account authorization has expired"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_USER_ALREADY_EXIST
,
0
,
0x0350
,
"User already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_USER
,
0
,
0x0351
,
"Invalid user"
)
...
...
src/mnode/src/mnodeMain.c
浏览文件 @
e363c01d
...
...
@@ -21,6 +21,7 @@
#include "tgrant.h"
#include "ttimer.h"
#include "tglobal.h"
#include "mnode.h"
#include "dnode.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
...
...
@@ -107,13 +108,18 @@ int32_t mnodeStartSystem() {
tsMgmtIsRunning
=
true
;
mInfo
(
"mnode is initialized successfully"
);
sdbUpdateSync
();
return
0
;
}
int32_t
mnodeInitSystem
()
{
mnodeInitTimer
();
if
(
!
mnodeNeedStart
())
return
0
;
if
(
mnodeNeedStart
())
{
return
mnodeStartSystem
();
}
return
0
;
}
void
mnodeCleanupSystem
()
{
...
...
@@ -159,14 +165,19 @@ static void mnodeCleanupTimer() {
static
bool
mnodeNeedStart
()
{
struct
stat
dirstat
;
bool
fileExist
=
(
stat
(
tsMnodeDir
,
&
dirstat
)
==
0
);
char
mnodeFileName
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
sprintf
(
mnodeFileName
,
"%s/wal/wal0"
,
tsMnodeDir
);
bool
fileExist
=
(
stat
(
mnodeFileName
,
&
dirstat
)
==
0
);
bool
asMaster
=
(
strcmp
(
tsFirst
,
tsLocalEp
)
==
0
);
if
(
asMaster
||
fileExist
)
{
mDebug
(
"mnode module start, asMaster:%d fileExist:%d"
,
asMaster
,
fileExist
);
return
true
;
}
}
else
{
mDebug
(
"mnode module won't start, asMaster:%d fileExist:%d"
,
asMaster
,
fileExist
);
return
false
;
}
}
bool
mnodeIsRunning
()
{
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
e363c01d
...
...
@@ -291,6 +291,11 @@ static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
}
void
sdbUpdateSync
()
{
if
(
!
mnodeIsRunning
())
{
mDebug
(
"mnode not start yet, update sync info later"
);
return
;
}
SSyncCfg
syncCfg
=
{
0
};
int32_t
index
=
0
;
...
...
tests/script/jenkins/basic.txt
浏览文件 @
e363c01d
...
...
@@ -293,6 +293,7 @@ cd ../../../debug; make
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
...
...
tests/script/jenkins/unique.txt
浏览文件 @
e363c01d
cd ../../../debug; cmake ..
cd ../../../debug; make
./test.sh -f unique/account/account_create.sim
./test.sh -f unique/account/account_delete.sim
./test.sh -f unique/account/account_len.sim
./test.sh -f unique/account/authority.sim
./test.sh -f unique/account/basic.sim
./test.sh -f unique/account/paras.sim
./test.sh -f unique/account/pass_alter.sim
./test.sh -f unique/account/pass_len.sim
./test.sh -f unique/account/usage.sim
./test.sh -f unique/account/user_create.sim
./test.sh -f unique/account/user_len.sim
./test.sh -f unique/big/balance.sim
./test.sh -f unique/big/maxvnodes.sim
./test.sh -f unique/big/tcp.sim
./test.sh -f unique/cluster/alter.sim
./test.sh -f unique/cluster/balance1.sim
./test.sh -f unique/cluster/balance2.sim
./test.sh -f unique/cluster/balance3.sim
...
...
@@ -61,6 +50,7 @@ cd ../../../debug; make
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
...
...
@@ -77,31 +67,16 @@ cd ../../../debug; make
./test.sh -f unique/vnode/replica3_repeat.sim
./test.sh -f unique/vnode/replica3_vgroup.sim
./test.sh -f general/stream/metrics_1.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_n.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
#./test.sh -f general/stream/new_stream.sim
./test.sh -f general/stream/restart_stream.sim
./test.sh -f general/stream/stream_1.sim
./test.sh -f general/stream/stream_2.sim
./test.sh -f general/stream/stream_3.sim
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_1.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_n.sim
./test.sh -f general/stream/table_replica1_vnoden.sim
./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
#
./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim
./test.sh -f unique/arbitrator/dn3_mn1_multiCreateDropTable.sim
./test.sh -f unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim
./test.sh -f unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
#
./test.sh -f unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim
#
./test.sh -f unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
./test.sh -f unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
./test.sh -f unique/arbitrator/dn3_mn1_replica_change.sim
./test.sh -f unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
#./test.sh -f unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
# lower the priority while file corruption
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_change.sim
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
...
...
@@ -126,6 +101,7 @@ cd ../../../debug; make
./test.sh -f unique/arbitrator/replica_changeWithArbitrator.sim
./test.sh -f unique/arbitrator/sync_replica2_alterTable_add.sim
./test.sh -f unique/arbitrator/sync_replica2_alterTable_drop.sim
./test.sh -f unique/arbitrator/sync_replica2_dropDb.sim
./test.sh -f unique/arbitrator/sync_replica2_dropTable.sim
./test.sh -f unique/arbitrator/sync_replica3_alterTable_add.sim
...
...
tests/script/tmp/prepare.sim
浏览文件 @
e363c01d
...
...
@@ -32,6 +32,7 @@ system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode3 -c http -v 1
system sh/cfg.sh -n dnode4 -c http -v 1
return
# for crash_gen
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/cfg.sh -n dnode1 -c rpcMaxTime -v 101
...
...
tests/script/unique/account/usage.sim
浏览文件 @
e363c01d
...
...
@@ -112,22 +112,23 @@ print =============== step4
sql insert into d1.t1 values(now + 1s, 1)
sql insert into d1.t1 values(now + 2s, 2)
# no write auth
sleep 3000
sleep 10000
print no write auth
sql_error insert into d1.t1 values(now + 3s, 2)
sql_error insert into d1.t1 values(now + 4s, 2)
sql alter account root pass "taosdata" tseries 10 storage 36 streams 10 dbs 5 users 5
sleep 3000
sleep 10000
print has write auth
sql insert into d1.t1 values(now + 5s, 1)
sql insert into d1.t1 values(now + 6s, 2)
# no write auth
sleep 3000
sleep 10000
print no write auth
sql_error insert into d1.t1 values(now + 7s, 2)
sql_error insert into d1.t1 values(now + 8s, 2)
print =============== check grant
sql_error create database d6
...
...
tests/script/unique/mnode/mgmt21.sim
0 → 100644
浏览文件 @
e363c01d
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
print ============== step1
system sh/exec.sh -n dnode2 -s start
sleep 10000
system sh/exec.sh -n dnode1 -s start
sql connect
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
if $data2_1 != master then
return -1
endi
print ============== step2
sql create dnode $hostname2
$x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
if $data2_1 != master then
goto show2
endi
if $data2_2 != slave then
goto show2
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/mnode/testSuite.sim
浏览文件 @
e363c01d
run unique/mnode/mgmt21.sim
run unique/mnode/mgmt22.sim
run unique/mnode/mgmt23.sim
run unique/mnode/mgmt24.sim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录