Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6507ac3c
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6507ac3c
编写于
12月 01, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1207
上级
ca3dd878
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
2 addition
and
100 deletion
+2
-100
CMakeLists.txt
CMakeLists.txt
+0
-1
cmake/define.inc
cmake/define.inc
+0
-4
cmake/input.inc
cmake/input.inc
+0
-5
src/CMakeLists.txt
src/CMakeLists.txt
+1
-3
src/dnode/CMakeLists.txt
src/dnode/CMakeLists.txt
+1
-5
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+0
-7
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+0
-62
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+0
-13
未找到文件。
CMakeLists.txt
浏览文件 @
6507ac3c
...
...
@@ -13,7 +13,6 @@ ENDIF ()
SET
(
TD_ACCOUNT FALSE
)
SET
(
TD_ADMIN FALSE
)
SET
(
TD_GRANT FALSE
)
SET
(
TD_SYNC TRUE
)
SET
(
TD_MQTT TRUE
)
SET
(
TD_TSDB_PLUGINS FALSE
)
SET
(
TD_STORAGE FALSE
)
...
...
cmake/define.inc
浏览文件 @
6507ac3c
...
...
@@ -13,10 +13,6 @@ IF (TD_GRANT)
ADD_DEFINITIONS
(
-
D_GRANT
)
ENDIF
()
IF
(
TD_SYNC
)
ADD_DEFINITIONS
(
-
D_SYNC
)
ENDIF
()
IF
(
TD_MQTT
)
ADD_DEFINITIONS
(
-
D_MQTT
)
ENDIF
()
...
...
cmake/input.inc
浏览文件 @
6507ac3c
...
...
@@ -47,11 +47,6 @@ IF (${MQTT} MATCHES "false")
MESSAGE
(
STATUS
"build without mqtt module"
)
ENDIF
()
IF
(
$
{
SYNC
}
MATCHES
"false"
)
SET
(
TD_SYNC
FALSE
)
MESSAGE
(
STATUS
"build without sync module"
)
ENDIF
()
IF
(
$
{
RANDOM_FILE_FAIL
}
MATCHES
"true"
)
SET
(
TD_RANDOM_FILE_FAIL
TRUE
)
MESSAGE
(
STATUS
"build with random-file-fail enabled"
)
...
...
src/CMakeLists.txt
浏览文件 @
6507ac3c
...
...
@@ -11,9 +11,7 @@ ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY
(
query
)
ADD_SUBDIRECTORY
(
kit
)
ADD_SUBDIRECTORY
(
plugins
)
IF
(
TD_SYNC
)
ADD_SUBDIRECTORY
(
sync
)
ENDIF
()
ADD_SUBDIRECTORY
(
sync
)
ADD_SUBDIRECTORY
(
balance
)
ADD_SUBDIRECTORY
(
mnode
)
ADD_SUBDIRECTORY
(
vnode
)
...
...
src/dnode/CMakeLists.txt
浏览文件 @
6507ac3c
...
...
@@ -12,7 +12,7 @@ AUX_SOURCE_DIRECTORY(src SRC)
IF
(
TD_LINUX
)
ADD_EXECUTABLE
(
taosd
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lz4
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lz4
balance sync
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosd taos_static
)
...
...
@@ -32,10 +32,6 @@ IF (TD_LINUX)
TARGET_LINK_LIBRARIES
(
taosd mqtt
)
ENDIF
()
IF
(
TD_SYNC
)
TARGET_LINK_LIBRARIES
(
taosd balance sync
)
ENDIF
()
SET
(
PREPARE_ENV_CMD
"prepare_env_cmd"
)
SET
(
PREPARE_ENV_TARGET
"prepare_env_target"
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
PREPARE_ENV_CMD
}
...
...
src/mnode/src/mnodeDb.c
浏览文件 @
6507ac3c
...
...
@@ -319,13 +319,6 @@ static int32_t mnodeCheckDbCfg(SDbCfg *pCfg) {
return
TSDB_CODE_MND_INVALID_DB_OPTION
;
}
#ifndef _SYNC
if
(
pCfg
->
replications
!=
1
)
{
mError
(
"invalid db option replications:%d can only be 1 in this version"
,
pCfg
->
replications
);
return
TSDB_CODE_MND_INVALID_DB_OPTION
;
}
#endif
if
(
pCfg
->
update
<
TSDB_MIN_DB_UPDATE
||
pCfg
->
update
>
TSDB_MAX_DB_UPDATE
)
{
mError
(
"invalid db option update:%d valid range: [%d, %d]"
,
pCfg
->
update
,
TSDB_MIN_DB_UPDATE
,
TSDB_MAX_DB_UPDATE
);
return
TSDB_CODE_MND_INVALID_DB_OPTION
;
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
6507ac3c
...
...
@@ -111,9 +111,6 @@ static int32_t mnodeDnodeActionInsert(SSdbRow *pRow) {
static
int32_t
mnodeDnodeActionDelete
(
SSdbRow
*
pRow
)
{
SDnodeObj
*
pDnode
=
pRow
->
pObj
;
#ifndef _SYNC
mnodeDropAllDnodeVgroups
(
pDnode
);
#endif
mnodeDropMnodeLocal
(
pDnode
->
dnodeId
);
balanceAsyncNotify
();
mnodeUpdateDnodeEps
();
...
...
@@ -705,11 +702,7 @@ static int32_t mnodeDropDnodeByEp(char *ep, SMnodeMsg *pMsg) {
mInfo
(
"dnode:%d, start to drop it"
,
pDnode
->
dnodeId
);
#ifndef _SYNC
int32_t
code
=
mnodeDropDnode
(
pDnode
,
pMsg
);
#else
int32_t
code
=
balanceDropDnode
(
pDnode
);
#endif
mnodeDecDnodeRef
(
pDnode
);
return
code
;
}
...
...
@@ -1179,58 +1172,3 @@ static char* mnodeGetDnodeAlternativeRoleStr(int32_t alternativeRole) {
default:
return
"any"
;
}
}
#ifndef _SYNC
int32_t
balanceInit
()
{
return
TSDB_CODE_SUCCESS
;
}
void
balanceCleanUp
()
{}
void
balanceAsyncNotify
()
{}
void
balanceSyncNotify
()
{}
void
balanceReset
()
{}
int32_t
balanceAlterDnode
(
struct
SDnodeObj
*
pDnode
,
int32_t
vnodeId
,
int32_t
dnodeId
)
{
return
TSDB_CODE_SYN_NOT_ENABLED
;
}
char
*
syncRole
[]
=
{
"offline"
,
"unsynced"
,
"syncing"
,
"slave"
,
"master"
};
int32_t
balanceAllocVnodes
(
SVgObj
*
pVgroup
)
{
void
*
pIter
=
NULL
;
SDnodeObj
*
pDnode
=
NULL
;
SDnodeObj
*
pSelDnode
=
NULL
;
float
vnodeUsage
=
1000
.
0
;
while
(
1
)
{
pIter
=
mnodeGetNextDnode
(
pIter
,
&
pDnode
);
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
->
numOfCores
>
0
&&
pDnode
->
openVnodes
<
TSDB_MAX_VNODES
)
{
float
openVnodes
=
pDnode
->
openVnodes
;
if
(
pDnode
->
isMgmt
)
openVnodes
+=
tsMnodeEqualVnodeNum
;
float
usage
=
openVnodes
/
pDnode
->
numOfCores
;
if
(
usage
<=
vnodeUsage
)
{
pSelDnode
=
pDnode
;
vnodeUsage
=
usage
;
}
}
mnodeDecDnodeRef
(
pDnode
);
}
if
(
pSelDnode
==
NULL
)
{
mError
(
"failed to alloc vnode to vgroup"
);
return
TSDB_CODE_MND_NO_ENOUGH_DNODES
;
}
pVgroup
->
vnodeGid
[
0
].
dnodeId
=
pSelDnode
->
dnodeId
;
pVgroup
->
vnodeGid
[
0
].
pDnode
=
pSelDnode
;
mDebug
(
"dnode:%d, alloc one vnode to vgroup, openVnodes:%d"
,
pSelDnode
->
dnodeId
,
pSelDnode
->
openVnodes
);
return
TSDB_CODE_SUCCESS
;
}
#endif
src/vnode/src/vnodeMain.c
浏览文件 @
6507ac3c
...
...
@@ -43,15 +43,6 @@ static void vnodeConfirmForard(int32_t vgId, void *wparam, int32_t code);
static
int32_t
vnodeWriteToCache
(
int32_t
vgId
,
void
*
wparam
,
int32_t
qtype
,
void
*
rparam
);
static
int32_t
vnodeGetFileVersion
(
int32_t
vgId
,
uint64_t
*
fver
);
#ifndef _SYNC
int64_t
syncStart
(
const
SSyncInfo
*
info
)
{
return
NULL
;
}
int32_t
syncForwardToPeer
(
int64_t
rid
,
void
*
pHead
,
void
*
mhandle
,
int32_t
qtype
)
{
return
0
;
}
void
syncStop
(
int64_t
rid
)
{}
int32_t
syncReconfig
(
int64_t
rid
,
const
SSyncCfg
*
cfg
)
{
return
0
;
}
int32_t
syncGetNodesRole
(
int64_t
rid
,
SNodesRole
*
cfg
)
{
return
0
;
}
void
syncConfirmForward
(
int64_t
rid
,
uint64_t
version
,
int32_t
code
)
{}
#endif
int32_t
vnodeInitResources
()
{
int32_t
code
=
syncInit
();
if
(
code
!=
0
)
return
code
;
...
...
@@ -346,9 +337,6 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
syncInfo
.
getFileVersion
=
vnodeGetFileVersion
;
pVnode
->
sync
=
syncStart
(
&
syncInfo
);
#ifndef _SYNC
pVnode
->
role
=
TAOS_SYNC_ROLE_MASTER
;
#else
if
(
pVnode
->
sync
<=
0
)
{
vError
(
"vgId:%d, failed to open sync module, replica:%d reason:%s"
,
pVnode
->
vgId
,
pVnode
->
syncCfg
.
replica
,
tstrerror
(
terrno
));
...
...
@@ -356,7 +344,6 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
vnodeCleanUp
(
pVnode
);
return
terrno
;
}
#endif
vnodeSetReadyStatus
(
pVnode
);
return
TSDB_CODE_SUCCESS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录