Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e5adfe51
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看板
未验证
提交
e5adfe51
编写于
9月 07, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
9月 07, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3417 from taosdata/feature/mqtt
Feature/mqtt
上级
0dbef3bc
93f00771
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
241 addition
and
27 deletion
+241
-27
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+3
-3
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+2
-0
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+5
-5
tests/script/general/db/alter_option.sim
tests/script/general/db/alter_option.sim
+231
-19
未找到文件。
src/dnode/src/dnodeShell.c
浏览文件 @
e5adfe51
...
...
@@ -154,15 +154,15 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char
rpcMsg
.
contLen
=
sizeof
(
SDMAuthMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_DM_AUTH
;
dDebug
(
"user:%s, send auth msg to mnode"
,
user
);
dDebug
(
"user:%s, send auth msg to mnode
s
"
,
user
);
SRpcMsg
rpcRsp
=
{
0
};
dnodeSendMsgToDnodeRecv
(
&
rpcMsg
,
&
rpcRsp
);
if
(
rpcRsp
.
code
!=
0
)
{
dError
(
"user:%s, auth msg received from mnode, error:%s"
,
user
,
tstrerror
(
rpcRsp
.
code
));
dError
(
"user:%s, auth msg received from mnode
s
, error:%s"
,
user
,
tstrerror
(
rpcRsp
.
code
));
}
else
{
SDMAuthRsp
*
pRsp
=
rpcRsp
.
pCont
;
dDebug
(
"user:%s, auth msg received from mnode"
,
user
);
dDebug
(
"user:%s, auth msg received from mnode
s
"
,
user
);
memcpy
(
secret
,
pRsp
->
secret
,
TSDB_KEY_LEN
);
memcpy
(
ckey
,
pRsp
->
ckey
,
TSDB_KEY_LEN
);
*
spi
=
pRsp
->
spi
;
...
...
src/mnode/src/mnodeDb.c
浏览文件 @
e5adfe51
...
...
@@ -242,6 +242,7 @@ static int32_t mnodeCheckDbCfg(SDbCfg *pCfg) {
return
TSDB_CODE_MND_INVALID_DB_OPTION
;
}
#if 0
if (pCfg->daysToKeep2 < TSDB_MIN_KEEP || pCfg->daysToKeep2 > pCfg->daysToKeep) {
mError("invalid db option daysToKeep2:%d valid range: [%d, %d]", pCfg->daysToKeep, TSDB_MIN_KEEP, pCfg->daysToKeep);
return TSDB_CODE_MND_INVALID_DB_OPTION;
...
...
@@ -251,6 +252,7 @@ static int32_t mnodeCheckDbCfg(SDbCfg *pCfg) {
mError("invalid db option daysToKeep1:%d valid range: [%d, %d]", pCfg->daysToKeep1, TSDB_MIN_KEEP, pCfg->daysToKeep2);
return TSDB_CODE_MND_INVALID_DB_OPTION;
}
#endif
if
(
pCfg
->
maxRowsPerFileBlock
<
TSDB_MIN_MAX_ROW_FBLOCK
||
pCfg
->
maxRowsPerFileBlock
>
TSDB_MAX_MAX_ROW_FBLOCK
)
{
mError
(
"invalid db option maxRowsPerFileBlock:%d valid range: [%d, %d]"
,
pCfg
->
maxRowsPerFileBlock
,
...
...
src/rpc/src/rpcMain.c
浏览文件 @
e5adfe51
...
...
@@ -709,21 +709,21 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) {
}
if
(
terrno
!=
0
)
{
taosFreeId
(
pRpc
->
idPool
,
sid
);
// sid shall be released
taosFreeId
(
pRpc
->
idPool
,
sid
);
// sid shall be released
pConn
=
NULL
;
}
}
}
}
if
(
pConn
)
{
if
(
pRecv
->
connType
==
RPC_CONN_UDPS
&&
pRpc
->
numOfThreads
>
1
)
{
// UDP server, assign to new connection
pRpc
->
index
=
(
pRpc
->
index
+
1
)
%
pRpc
->
numOfThreads
;
pRpc
->
index
=
(
pRpc
->
index
+
1
)
%
pRpc
->
numOfThreads
;
pConn
->
localPort
=
(
pRpc
->
localPort
+
pRpc
->
index
);
}
taosHashPut
(
pRpc
->
hash
,
hashstr
,
size
,
(
char
*
)
&
pConn
,
POINTER_BYTES
);
tDebug
(
"%s %p server connection is allocated, uid:0x%x
"
,
pRpc
->
label
,
pConn
,
pConn
->
linkUid
);
tDebug
(
"%s %p server connection is allocated, uid:0x%x
sid:%d key:%s"
,
pRpc
->
label
,
pConn
,
pConn
->
linkUid
,
sid
,
hashstr
);
}
return
pConn
;
...
...
tests/script/general/db/alter_option.sim
浏览文件 @
e5adfe51
...
...
@@ -7,11 +7,10 @@ system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
print ============= create database
sql create database db cache 2 blocks 4 days 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data00 != db then
return -1
endi
...
...
@@ -37,27 +36,240 @@ if $data09 != 4 then
return -1
endi
print =============== step2
system sh/exec.sh -n dnode1 -s stop -x SIGINT
return
sql_error alter database db cache 256
sql_error alter database db blocks 1
sql_error alter database db days 10
sql_error alter database db keep 10
sql_error alter database db minRows 350
sql_error alter database db minRows 550
sql_error alter database db ctime 5000
sql_error alter database db precision "us"
sql_error alter database db comp 3
sql_error alter database db wal 1
print ============== step name
sql_error alter database db name d1
sql_error alter database db name d2
print ============== step ntables
sql_error alter database db ntables -1
sql_error alter database db ntables 0
sql_error alter database db ntables 1
sql_error alter database db ntables 10
print ============== step vgroups
sql_error alter database db vgroups -1
sql_error alter database db vgroups 0
sql_error alter database db vgroups 1
sql_error alter database db vgroups 10
print ============== step replica
sql_error alter database db replica 2
sql_error alter database db replica 3
sql_error alter database db replica 0
sql alter database db replica 1
sql show databases
print replica $data4_db
if $data4_db != 1 then
return -1
endi
print ============== step3
sql alter database db comp 1
sql alter database db blocks 40
print ============== step quorum
sql show databases
print quorum $data5_db
if $data5_db != 1 then
return -1
endi
sql alter database db quorum 1
sql show databases
print quorum $data5_db
if $data5_db != 1 then
return -1
endi
sql alter database db quorum 2
sql show databases
print quorum $data5_db
if $data5_db != 2 then
return -1
endi
sql alter database db quorum 3
sql show databases
print quorum $data5_db
if $data5_db != 3 then
return -1
endi
sql alter database db quorum 3
sql alter database db quorum 2
sql alter database db quorum 1
sql_error alter database db quorum 0
sql_error alter database db quorum 4
sql_error alter database db quorum 5
sql_error alter database db quorum -1
print ============== step days
sql_error alter database db days 0
sql_error alter database db days 1
sql_error alter database db days 2
sql_error alter database db days 10
sql_error alter database db days 50
sql_error alter database db days 100
print ============== step keep
sql show databases
print keep $data7_db
if $data7_db != 20,20,20 then
return -1
endi
sql alter database db keep 10
sql show databases
print keep $data7_db
if $data7_db != 20,20,10 then
return -1
endi
sql alter database db keep 20
sql show databases
print keep $data7_db
if $data7_db != 20,20,20 then
return -1
endi
sql alter database db keep 30
sql show databases
print keep $data7_db
if $data7_db != 20,20,30 then
return -1
endi
sql alter database db keep 40
sql alter database db keep 30
sql alter database db keep 20
sql alter database db keep 10
sql_error alter database db keep 9
sql_error alter database db keep 1
sql alter database db keep 0
sql alter database db keep -1
sql_error alter database db keep 365001
print ============== step cache
sql_error alter database db cache 60
sql_error alter database db cache 50
sql_error alter database db cache 20
sql_error alter database db cache 3
sql_error alter database db cache 129
sql_error alter database db cache 300
sql_error alter database db cache 0
sql_error alter database db cache -1
print ============== step blocks
sql show databases
print blocks $data9_db
if $data9_db != 4 then
return -1
endi
sql alter database db blocks 10
sql show databases
print blocks $data9_db
if $data9_db != 10 then
return -1
endi
sql alter database db blocks 20
sql show databases
print blocks $data9_db
if $data9_db != 20 then
return -1
endi
sql alter database db blocks 30
sql show databases
print blocks $data9_db
if $data9_db != 30 then
return -1
endi
sql alter database db blocks 40
sql alter database db blocks 30
sql alter database db blocks 20
sql alter database db blocks 10
sql_error alter database db blocks 2
sql_error alter database db blocks 1
sql alter database db blocks 0
sql_error alter database db blocks -1
sql_error alter database db blocks 10001
print ============== step minrows
sql_error alter database db minrows 1
sql_error alter database db minrows 100
sql_error alter database db minrows 1000
print ============== step maxrows
sql_error alter database db maxrows 1
sql_error alter database db maxrows 100
sql_error alter database db maxrows 1000
print ============== step wallevel
sql show databases
print wallevel $data12_db
if $data12_db != 1 then
return -1
endi
sql alter database db wal 1
sql show databases
print wal $data12_db
if $data12_db != 1 then
return -1
endi
sql_error alter database db wal 2
sql_error alter database db wal 0
sql_error alter database db wal 3
sql_error alter database db wal 4
sql_error alter database db wal -1
sql_error alter database db wal 1000
print ============== step fsync
sql_error alter database db fsync 2
sql_error alter database db fsync 3
sql_error alter database db fsync 4
sql_error alter database db fsync -1
sql_error alter database db fsync 1000
print ============== step comp
sql show databases
print comp $data14_db
if $data14_db != 2 then
return -1
endi
sql alter database db comp 1
sql show databases
print comp $data14_db
if $data14_db != 1 then
return -1
endi
sql alter database db comp 2
sql show databases
print comp $data14_db
if $data14_db != 2 then
return -1
endi
sql alter database db comp 0
sql show databases
print comp $data14_db
if $data14_db != 0 then
return -1
endi
sql_error alter database db comp 3
sql_error alter database db comp 4
sql_error alter database db comp 5
sql_error alter database db comp -1
print ============== step precision
sql_error alter database db prec 'us'
print ============== step status
sql_error alter database db status 'delete'
#system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录