Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzh_me
TDengine
提交
03f02317
TDengine
项目概览
lzh_me
/
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,发现更多精彩内容 >>
提交
03f02317
编写于
7月 23, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-926]
上级
c02b53fc
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
24 addition
and
13 deletion
+24
-13
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+3
-3
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+1
-1
src/common/src/tglobal.c
src/common/src/tglobal.c
+4
-4
src/inc/taoserror.h
src/inc/taoserror.h
+1
-0
src/inc/tbalance.h
src/inc/tbalance.h
+1
-1
src/mnode/src/mnodeBalance.c
src/mnode/src/mnodeBalance.c
+1
-1
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+12
-2
tests/test/c/insertPerRow.c
tests/test/c/insertPerRow.c
+1
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
03f02317
...
...
@@ -4700,10 +4700,10 @@ int32_t validateDNodeConfig(tDCLSQL* pOptions) {
}
else
if
((
strncasecmp
(
cfgOptions
[
tokenBalance
].
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
)
&&
(
cfgOptions
[
tokenBalance
].
len
==
pOptionToken
->
n
))
{
SSQLToken
*
pValToken
=
&
pOptions
->
a
[
2
];
int32_t
vnodeI
ndex
=
0
;
int32_t
dnodeI
ndex
=
0
;
int32_t
vnodeI
d
=
0
;
int32_t
dnodeI
d
=
0
;
strdequote
(
pValToken
->
z
);
bool
parseOk
=
taosCheckBalanceCfgOptions
(
pValToken
->
z
,
&
vnodeI
ndex
,
&
dnodeIndex
);
bool
parseOk
=
taosCheckBalanceCfgOptions
(
pValToken
->
z
,
&
vnodeI
d
,
&
dnodeId
);
if
(
!
parseOk
)
{
return
TSDB_CODE_TSC_INVALID_SQL
;
// options value is invalid
}
...
...
src/common/inc/tglobal.h
浏览文件 @
03f02317
...
...
@@ -174,7 +174,7 @@ bool taosCheckGlobalCfg();
void
taosSetAllDebugFlag
();
bool
taosCfgDynamicOptions
(
char
*
msg
);
int
taosGetFqdnPortFromEp
(
const
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
bool
taosCheckBalanceCfgOptions
(
const
char
*
option
,
int32_t
*
vnodeI
ndex
,
int32_t
*
dnodeIndex
);
bool
taosCheckBalanceCfgOptions
(
const
char
*
option
,
int32_t
*
vnodeI
d
,
int32_t
*
dnodeId
);
#ifdef __cplusplus
}
...
...
src/common/src/tglobal.c
浏览文件 @
03f02317
...
...
@@ -1315,7 +1315,7 @@ int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port) {
* alter dnode 1 balance "vnode:1-dnode:2"
*/
bool
taosCheckBalanceCfgOptions
(
const
char
*
option
,
int32_t
*
vnodeI
ndex
,
int32_t
*
dnodeIndex
)
{
bool
taosCheckBalanceCfgOptions
(
const
char
*
option
,
int32_t
*
vnodeI
d
,
int32_t
*
dnodeId
)
{
int
len
=
strlen
(
option
);
if
(
strncasecmp
(
option
,
"vnode:"
,
6
)
!=
0
)
{
return
false
;
...
...
@@ -1331,9 +1331,9 @@ bool taosCheckBalanceCfgOptions(const char *option, int32_t *vnodeIndex, int32_t
return
false
;
}
*
vnodeI
ndex
=
strtol
(
option
+
6
,
NULL
,
10
);
*
dnodeI
ndex
=
strtol
(
option
+
pos
+
6
,
NULL
,
10
);
if
(
*
vnodeI
ndex
<=
1
||
*
dnodeIndex
<=
0
)
{
*
vnodeI
d
=
strtol
(
option
+
6
,
NULL
,
10
);
*
dnodeI
d
=
strtol
(
option
+
pos
+
6
,
NULL
,
10
);
if
(
*
vnodeI
d
<=
1
||
*
dnodeId
<=
0
)
{
return
false
;
}
...
...
src/inc/taoserror.h
浏览文件 @
03f02317
...
...
@@ -126,6 +126,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_VGROUP_NOT_EXIST, 0, 0x0332, "mnode vgro
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NO_REMOVE_MASTER
,
0
,
0x0333
,
"mnode cant not remove master"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NO_ENOUGH_DNODES
,
0
,
0x0334
,
"mnode no enough dnodes"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_CLUSTER_CFG_INCONSISTENT
,
0
,
0x0335
,
"mnode cluster cfg inconsistent"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_DNODE_CFG_OPTION
,
0
,
0x0336
,
"mnode invalid dnode cfg option"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACCT_ALREADY_EXIST
,
0
,
0x0340
,
"mnode accounts already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_ACCT
,
0
,
0x0341
,
"mnode invalid account"
)
...
...
src/inc/tbalance.h
浏览文件 @
03f02317
...
...
@@ -29,7 +29,7 @@ void balanceAsyncNotify();
void
balanceSyncNotify
();
void
balanceReset
();
int32_t
balanceAllocVnodes
(
struct
SVgObj
*
pVgroup
);
int32_t
balance
CfgDnode
(
struct
SDnodeObj
*
pDnode
,
const
char
*
option
);
int32_t
balance
AlterDnode
(
struct
SDnodeObj
*
pDnode
,
int32_t
vnodeId
,
int32_t
dnodeId
);
int32_t
balanceDropDnode
(
struct
SDnodeObj
*
pDnode
);
#ifdef __cplusplus
...
...
src/mnode/src/mnodeBalance.c
浏览文件 @
03f02317
...
...
@@ -28,7 +28,7 @@ void balanceCleanUp() {}
void
balanceAsyncNotify
()
{}
void
balanceSyncNotify
()
{}
void
balanceReset
()
{}
int32_t
balance
CfgDnode
(
struct
SDnodeObj
*
pDnode
,
const
char
*
option
)
{
return
TSDB_CODE_SYN_NOT_ENABLED
;
}
int32_t
balance
AlterDnode
(
struct
SDnodeObj
*
pDnode
,
int32_t
vnodeId
,
int32_t
dnodeId
)
{
return
TSDB_CODE_SYN_NOT_ENABLED
;
}
int32_t
balanceAllocVnodes
(
SVgObj
*
pVgroup
)
{
void
*
pIter
=
NULL
;
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
03f02317
...
...
@@ -295,10 +295,19 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) {
}
SRpcEpSet
epSet
=
mnodeGetEpSetFromIp
(
pDnode
->
dnodeEp
);
mnodeDecDnodeRef
(
pDnode
);
if
(
strncasecmp
(
pCmCfgDnode
->
config
,
"balance"
,
7
)
==
0
)
{
return
balanceCfgDnode
(
pDnode
,
pCmCfgDnode
->
config
+
8
);
int32_t
vnodeId
=
0
;
int32_t
dnodeId
=
0
;
bool
parseOk
=
taosCheckBalanceCfgOptions
(
pCmCfgDnode
->
config
+
8
,
&
vnodeId
,
&
dnodeId
);
if
(
!
parseOk
)
{
mnodeDecDnodeRef
(
pDnode
);
return
TSDB_CODE_MND_INVALID_DNODE_CFG_OPTION
;
}
int32_t
code
=
balanceAlterDnode
(
pDnode
,
vnodeId
,
dnodeId
);
mnodeDecDnodeRef
(
pDnode
);
return
code
;
}
else
{
SMDCfgDnodeMsg
*
pMdCfgDnode
=
rpcMallocCont
(
sizeof
(
SMDCfgDnodeMsg
));
strcpy
(
pMdCfgDnode
->
ep
,
pCmCfgDnode
->
ep
);
...
...
@@ -314,6 +323,7 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) {
mInfo
(
"dnode:%s, is configured by %s"
,
pCmCfgDnode
->
ep
,
pMsg
->
pUser
->
user
);
dnodeSendMsgToDnode
(
&
epSet
,
&
rpcMdCfgDnodeMsg
);
mnodeDecDnodeRef
(
pDnode
);
return
TSDB_CODE_SUCCESS
;
}
}
...
...
tests/test/c/insertPerRow.c
浏览文件 @
03f02317
...
...
@@ -50,7 +50,7 @@ int64_t numOfThreads = 10;
int64_t
numOfTablesPerThread
=
100
;
char
dbName
[
32
]
=
"db"
;
char
stableName
[
64
]
=
"st"
;
int32_t
cache
=
4
;
int32_t
cache
=
1
;
int32_t
replica
=
3
;
int32_t
days
=
10
;
int32_t
interval
=
1000
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录