Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
74af31b4
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
74af31b4
编写于
1月 12, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2677
上级
150632a1
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
133 addition
and
11 deletion
+133
-11
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+2
-2
src/common/src/tglobal.c
src/common/src/tglobal.c
+2
-2
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+3
-3
src/inc/taosdef.h
src/inc/taosdef.h
+3
-0
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+8
-3
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+3
-1
tests/script/issue/TD-2677.sim
tests/script/issue/TD-2677.sim
+111
-0
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-0
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
74af31b4
...
...
@@ -6022,9 +6022,9 @@ int32_t tscCheckCreateDbParams(SSqlCmd* pCmd, SCreateDbMsg* pCreate) {
}
if
(
pCreate
->
quorum
!=
-
1
&&
(
pCreate
->
quorum
<
TSDB_MIN_DB_
REPLICA_OPTION
||
pCreate
->
quorum
>
TSDB_MAX_DB_REPLICA
_OPTION
))
{
(
pCreate
->
quorum
<
TSDB_MIN_DB_
QUORUM_OPTION
||
pCreate
->
quorum
>
TSDB_MAX_DB_QUORUM
_OPTION
))
{
snprintf
(
msg
,
tListLen
(
msg
),
"invalid db option quorum: %d valid range: [%d, %d]"
,
pCreate
->
quorum
,
TSDB_MIN_DB_
REPLICA_OPTION
,
TSDB_MAX_DB_REPLICA
_OPTION
);
TSDB_MIN_DB_
QUORUM_OPTION
,
TSDB_MAX_DB_QUORUM
_OPTION
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
);
}
...
...
src/common/src/tglobal.c
浏览文件 @
74af31b4
...
...
@@ -811,8 +811,8 @@ static void doInitGlobalConfig(void) {
cfg
.
ptr
=
&
tsQuorum
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
TSDB_MIN_DB_
REPLICA
_OPTION
;
cfg
.
maxValue
=
TSDB_MAX_DB_
REPLICA
_OPTION
;
cfg
.
minValue
=
TSDB_MIN_DB_
QUORUM
_OPTION
;
cfg
.
maxValue
=
TSDB_MAX_DB_
QUORUM
_OPTION
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
...
...
src/dnode/src/dnodeVWrite.c
浏览文件 @
74af31b4
...
...
@@ -163,10 +163,9 @@ void dnodeFreeVWriteQueue(void *pWqueue) {
void
dnodeSendRpcVWriteRsp
(
void
*
pVnode
,
void
*
wparam
,
int32_t
code
)
{
if
(
wparam
==
NULL
)
return
;
if
(
code
>
0
)
code
=
0
;
SVWriteMsg
*
pWrite
=
wparam
;
if
(
code
<
=
0
)
pWrite
->
code
=
code
;
if
(
code
<
0
)
pWrite
->
code
=
code
;
int32_t
count
=
atomic_add_fetch_32
(
&
pWrite
->
processedCount
,
1
);
if
(
count
<=
1
)
return
;
...
...
@@ -207,7 +206,8 @@ static void *dnodeProcessVWriteQueue(void *wparam) {
pWrite
->
code
=
vnodeProcessWrite
(
pVnode
,
pWrite
->
pHead
,
qtype
,
pWrite
);
if
(
pWrite
->
code
<=
0
)
pWrite
->
processedCount
=
1
;
if
(
pWrite
->
code
>=
0
&&
pWrite
->
pHead
->
msgType
!=
TSDB_MSG_TYPE_SUBMIT
)
forceFsync
=
true
;
if
(
pWrite
->
code
>
0
)
pWrite
->
code
=
0
;
if
(
pWrite
->
code
==
0
&&
pWrite
->
pHead
->
msgType
!=
TSDB_MSG_TYPE_SUBMIT
)
forceFsync
=
true
;
dTrace
(
"msg:%p is processed in vwrite queue, code:0x%x"
,
pWrite
,
pWrite
->
code
);
}
...
...
src/inc/taosdef.h
浏览文件 @
74af31b4
...
...
@@ -395,6 +395,9 @@ int32_t tStrToInteger(const char* z, int16_t type, int32_t n, int64_t* value, bo
#define TSDB_MIN_DB_REPLICA_OPTION 1
#define TSDB_MAX_DB_REPLICA_OPTION 3
#define TSDB_DEFAULT_DB_REPLICA_OPTION 1
#define TSDB_MIN_DB_QUORUM_OPTION 1
#define TSDB_MAX_DB_QUORUM_OPTION 2
#define TSDB_DEFAULT_DB_QUORUM_OPTION 1
#define TSDB_MAX_JOIN_TABLE_NUM 5
...
...
src/mnode/src/mnodeDb.c
浏览文件 @
74af31b4
...
...
@@ -316,9 +316,14 @@ static int32_t mnodeCheckDbCfg(SDbCfg *pCfg) {
return
TSDB_CODE_MND_INVALID_DB_OPTION
;
}
if
(
pCfg
->
quorum
<
TSDB_MIN_DB_REPLICA_OPTION
||
pCfg
->
quorum
>
TSDB_MAX_DB_REPLICA_OPTION
)
{
mError
(
"invalid db option quorum:%d valid range: [%d, %d]"
,
pCfg
->
quorum
,
TSDB_MIN_DB_REPLICA_OPTION
,
TSDB_MAX_DB_REPLICA_OPTION
);
if
(
pCfg
->
quorum
>
pCfg
->
replications
)
{
mError
(
"invalid db option quorum:%d larger than replica:%d"
,
pCfg
->
quorum
,
pCfg
->
replications
);
return
TSDB_CODE_MND_INVALID_DB_OPTION
;
}
if
(
pCfg
->
quorum
<
TSDB_MIN_DB_QUORUM_OPTION
||
pCfg
->
quorum
>
TSDB_MAX_DB_QUORUM_OPTION
)
{
mError
(
"invalid db option quorum:%d valid range: [%d, %d]"
,
pCfg
->
quorum
,
TSDB_MIN_DB_QUORUM_OPTION
,
TSDB_MAX_DB_QUORUM_OPTION
);
return
TSDB_CODE_MND_INVALID_DB_OPTION
;
}
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
74af31b4
...
...
@@ -53,7 +53,9 @@ int32_t vnodeProcessWrite(void *vparam, void *wparam, int32_t qtype, void *rpara
SVnodeObj
*
pVnode
=
vparam
;
SWalHead
*
pHead
=
wparam
;
SVWriteMsg
*
pWrite
=
rparam
;
SRspRet
*
pRspRet
=
&
pWrite
->
rspRet
;
SRspRet
*
pRspRet
=
NULL
;
if
(
pWrite
!=
NULL
)
pRspRet
=
&
pWrite
->
rspRet
;
if
(
vnodeProcessWriteMsgFp
[
pHead
->
msgType
]
==
NULL
)
{
vError
(
"vgId:%d, msg:%s not processed since no handle, qtype:%s hver:%"
PRIu64
,
pVnode
->
vgId
,
...
...
tests/script/issue/TD-2677.sim
0 → 100644
浏览文件 @
74af31b4
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
print ============== deploy
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
print =============== step1
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
sql show mnodes
$mnode1Role = $data2_1
print mnode1Role $mnode1Role
$mnode2Role = $data2_2
print mnode2Role $mnode2Role
$mnode3Role = $data2_3
print mnode3Role $mnode3Role
if $mnode1Role != master then
goto step1
endi
if $mnode2Role != slave then
goto step1
endi
if $mnode3Role != slave then
goto step1
endi
$x = 1
show2:
print =============== step1
sql create database d1 replica 2 quorum 2
sql create table d1.t1 (ts timestamp, i int)
sql_error create table d1.t1 (ts timestamp, i int)
sql insert into d1.t1 values(now, 1)
sql select * from d1.t1;
if $rows != 1 then
return -1
endi
print =============== step2
sql create database d2 replica 3 quorum 2
sql create table d2.t1 (ts timestamp, i int)
sql_error create table d2.t1 (ts timestamp, i int)
sql insert into d2.t1 values(now, 1)
sql select * from d2.t1;
if $rows != 1 then
return -1
endi
print =============== step3
sql create database d4 replica 1 quorum 1
sql_error create database d5 replica 1 quorum 2
sql_error create database d6 replica 1 quorum 3
sql_error create database d7 replica 1 quorum 4
sql_error create database d8 replica 1 quorum 0
sql create database d9 replica 2 quorum 1
sql create database d10 replica 2 quorum 2
sql_error create database d11 replica 2 quorum 3
sql_error create database d12 replica 2 quorum 4
sql_error create database d12 replica 2 quorum 0
sql create database d13 replica 3 quorum 1
sql create database d14 replica 3 quorum 2
sql_error create database d15 replica 3 quorum 3
sql_error create database d16 replica 3 quorum 4
sql_error create database d17 replica 3 quorum 0
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
tests/script/jenkins/basic.txt
浏览文件 @
74af31b4
cd ../../../debug; cmake ..
cd ../../../debug; make
./test.sh -f issue/TD-2677.sim
./test.sh -f issue/TD-2680.sim
./test.sh -f issue/TD-2713.sim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录