Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f2ea40e0
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看板
提交
f2ea40e0
编写于
12月 28, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/feature/3_liaohj' into feature/3_liaohj
上级
011c8395
024a7a58
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
13 deletion
+22
-13
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
+13
-5
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+4
-3
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+5
-5
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
浏览文件 @
f2ea40e0
...
...
@@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE
#include "vmInt.h"
#define MAX_CONTENT_LEN 1024 * 1024
#define MAX_CONTENT_LEN
2 *
1024 * 1024
SVnodeObj
**
vmGetVnodeListFromHash
(
SVnodeMgmt
*
pMgmt
,
int32_t
*
numOfVnodes
)
{
taosThreadRwlockRdlock
(
&
pMgmt
->
lock
);
...
...
@@ -60,7 +60,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t
pFile
=
taosOpenFile
(
file
,
TD_FILE_READ
);
if
(
pFile
==
NULL
)
{
d
Debug
(
"file %s not exist"
,
file
);
d
Info
(
"file %s not exist"
,
file
);
code
=
0
;
goto
_OVER
;
}
...
...
@@ -133,7 +133,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t
*
numOfVnodes
=
vnodesNum
;
code
=
0
;
d
Debug
(
"succcessed to read file %s, numOfVnodes:%d"
,
file
,
vnodesNum
);
d
Info
(
"succcessed to read file %s, numOfVnodes:%d"
,
file
,
vnodesNum
);
_OVER:
if
(
content
!=
NULL
)
taosMemoryFree
(
content
);
...
...
@@ -163,6 +163,7 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) {
if
(
ppVnodes
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
-
1
;
dError
(
"failed to write %s while get vnodelist"
,
file
);
goto
_OVER
;
}
...
...
@@ -172,6 +173,7 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) {
if
(
content
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
-
1
;
dError
(
"failed to write %s while malloc content"
,
file
);
goto
_OVER
;
}
...
...
@@ -213,6 +215,12 @@ _OVER:
if
(
code
!=
0
)
return
-
1
;
dDebug
(
"successed to write %s, numOfVnodes:%d"
,
realfile
,
numOfVnodes
);
return
taosRenameFile
(
file
,
realfile
);
dInfo
(
"successed to write %s, numOfVnodes:%d"
,
realfile
,
numOfVnodes
);
code
=
taosRenameFile
(
file
,
realfile
);
if
(
code
!=
0
)
{
dError
(
"failed to rename %s to %s"
,
file
,
realfile
);
}
return
code
;
}
\ No newline at end of file
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
f2ea40e0
...
...
@@ -213,7 +213,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
SVnodeObj
*
pVnode
=
vmAcquireVnode
(
pMgmt
,
req
.
vgId
);
if
(
pVnode
!=
NULL
)
{
d
Debug
(
"vgId:%d, already exist"
,
req
.
vgId
);
d
Info
(
"vgId:%d, already exist"
,
req
.
vgId
);
tFreeSCreateVnodeReq
(
&
req
);
vmReleaseVnode
(
pMgmt
,
pVnode
);
terrno
=
TSDB_CODE_VND_ALREADY_EXIST
;
...
...
@@ -358,7 +358,7 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
}
int32_t
vgId
=
dropReq
.
vgId
;
d
Debug
(
"vgId:%d, start to drop vnode"
,
vgId
);
d
Info
(
"vgId:%d, start to drop vnode"
,
vgId
);
if
(
dropReq
.
dnodeId
!=
pMgmt
->
pData
->
dnodeId
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
...
...
@@ -368,7 +368,7 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
SVnodeObj
*
pVnode
=
vmAcquireVnode
(
pMgmt
,
vgId
);
if
(
pVnode
==
NULL
)
{
d
Debug
(
"vgId:%d, failed to drop since %s"
,
vgId
,
terrstr
());
d
Info
(
"vgId:%d, failed to drop since %s"
,
vgId
,
terrstr
());
terrno
=
TSDB_CODE_VND_NOT_EXIST
;
return
-
1
;
}
...
...
@@ -383,6 +383,7 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
vmCloseVnode
(
pMgmt
,
pVnode
);
vmWriteVnodeListToFile
(
pMgmt
);
dInfo
(
"vgId:%d, is dropped"
,
vgId
);
return
0
;
}
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
f2ea40e0
...
...
@@ -138,7 +138,7 @@ static void *vmOpenVnodeInThread(void *param) {
SVnodeMgmt
*
pMgmt
=
pThread
->
pMgmt
;
char
path
[
TSDB_FILENAME_LEN
];
d
Debug
(
"thread:%d, start to open %d vnodes"
,
pThread
->
threadIndex
,
pThread
->
vnodeNum
);
d
Info
(
"thread:%d, start to open %d vnodes"
,
pThread
->
threadIndex
,
pThread
->
vnodeNum
);
setThreadName
(
"open-vnodes"
);
for
(
int32_t
v
=
0
;
v
<
pThread
->
vnodeNum
;
++
v
)
{
...
...
@@ -156,14 +156,14 @@ static void *vmOpenVnodeInThread(void *param) {
pThread
->
failed
++
;
}
else
{
vmOpenVnode
(
pMgmt
,
pCfg
,
pImpl
);
d
Debug
(
"vgId:%d, is opened by thread:%d"
,
pCfg
->
vgId
,
pThread
->
threadIndex
);
d
Info
(
"vgId:%d, is opened by thread:%d"
,
pCfg
->
vgId
,
pThread
->
threadIndex
);
pThread
->
opened
++
;
atomic_add_fetch_32
(
&
pMgmt
->
state
.
openVnodes
,
1
);
}
}
d
Debug
(
"thread:%d, numOfVnodes:%d, opened:%d failed:%d"
,
pThread
->
threadIndex
,
pThread
->
vnodeNum
,
pThread
->
opened
,
pThread
->
failed
);
d
Info
(
"thread:%d, numOfVnodes:%d, opened:%d failed:%d"
,
pThread
->
threadIndex
,
pThread
->
vnodeNum
,
pThread
->
opened
,
pThread
->
failed
);
return
NULL
;
}
...
...
@@ -496,7 +496,7 @@ static void *vmRestoreVnodeInThread(void *param) {
dError
(
"vgId:%d, failed to restore vnode by thread:%d"
,
pVnode
->
vgId
,
pThread
->
threadIndex
);
pThread
->
failed
++
;
}
else
{
d
Debug
(
"vgId:%d, is restored by thread:%d"
,
pVnode
->
vgId
,
pThread
->
threadIndex
);
d
Info
(
"vgId:%d, is restored by thread:%d"
,
pVnode
->
vgId
,
pThread
->
threadIndex
);
pThread
->
opened
++
;
atomic_add_fetch_32
(
&
pMgmt
->
state
.
openVnodes
,
1
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录