Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
53ac9c72
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看板
提交
53ac9c72
编写于
1月 31, 2023
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: commit tsdb after split
上级
141fcdd4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
15 deletion
+31
-15
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
+1
-1
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+9
-10
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+16
-2
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-0
source/dnode/vnode/src/vnd/vnodeOpen.c
source/dnode/vnode/src/vnd/vnodeOpen.c
+4
-2
未找到文件。
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
浏览文件 @
53ac9c72
...
...
@@ -81,7 +81,7 @@ typedef struct {
SVnodeObj
*
vmAcquireVnode
(
SVnodeMgmt
*
pMgmt
,
int32_t
vgId
);
void
vmReleaseVnode
(
SVnodeMgmt
*
pMgmt
,
SVnodeObj
*
pVnode
);
int32_t
vmOpenVnode
(
SVnodeMgmt
*
pMgmt
,
SWrapperCfg
*
pCfg
,
SVnode
*
pImpl
);
void
vmCloseVnode
(
SVnodeMgmt
*
pMgmt
,
SVnodeObj
*
pVnode
);
void
vmCloseVnode
(
SVnodeMgmt
*
pMgmt
,
SVnodeObj
*
pVnode
,
bool
commitAndRemoveWal
);
// vmHandle.c
SArray
*
vmGetMsgHandles
();
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
53ac9c72
...
...
@@ -322,13 +322,7 @@ int32_t vmProcessAlterHashRangeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
}
dInfo
(
"vgId:%d, start to close vnode"
,
srcVgId
);
SWrapperCfg
wrapperCfg
=
{
.
dropped
=
pVnode
->
dropped
,
.
vgId
=
pVnode
->
vgId
,
.
vgVersion
=
pVnode
->
vgVersion
,
};
tstrncpy
(
wrapperCfg
.
path
,
pVnode
->
path
,
sizeof
(
wrapperCfg
.
path
));
vmCloseVnode
(
pMgmt
,
pVnode
);
vmCloseVnode
(
pMgmt
,
pVnode
,
true
);
char
srcPath
[
TSDB_FILENAME_LEN
]
=
{
0
};
char
dstPath
[
TSDB_FILENAME_LEN
]
=
{
0
};
...
...
@@ -348,7 +342,12 @@ int32_t vmProcessAlterHashRangeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
wrapperCfg
.
vgId
=
dstVgId
;
SWrapperCfg
wrapperCfg
=
{
.
dropped
=
pVnode
->
dropped
,
.
vgId
=
dstVgId
,
.
vgVersion
=
pVnode
->
vgVersion
,
};
tstrncpy
(
wrapperCfg
.
path
,
pVnode
->
path
,
sizeof
(
wrapperCfg
.
path
));
if
(
vmOpenVnode
(
pMgmt
,
&
wrapperCfg
,
pImpl
)
!=
0
)
{
dError
(
"vgId:%d, failed to open vnode mgmt since %s"
,
dstVgId
,
terrstr
());
return
-
1
;
...
...
@@ -407,7 +406,7 @@ int32_t vmProcessAlterVnodeReplicaReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
.
vgVersion
=
pVnode
->
vgVersion
,
};
tstrncpy
(
wrapperCfg
.
path
,
pVnode
->
path
,
sizeof
(
wrapperCfg
.
path
));
vmCloseVnode
(
pMgmt
,
pVnode
);
vmCloseVnode
(
pMgmt
,
pVnode
,
false
);
char
path
[
TSDB_FILENAME_LEN
]
=
{
0
};
snprintf
(
path
,
TSDB_FILENAME_LEN
,
"vnode%svnode%d"
,
TD_DIRSEP
,
vgId
);
...
...
@@ -469,7 +468,7 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
vmCloseVnode
(
pMgmt
,
pVnode
);
vmCloseVnode
(
pMgmt
,
pVnode
,
false
);
vmWriteVnodeListToFile
(
pMgmt
);
dInfo
(
"vgId:%d, is dropped"
,
vgId
);
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
53ac9c72
...
...
@@ -76,7 +76,7 @@ int32_t vmOpenVnode(SVnodeMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) {
return
code
;
}
void
vmCloseVnode
(
SVnodeMgmt
*
pMgmt
,
SVnodeObj
*
pVnode
)
{
void
vmCloseVnode
(
SVnodeMgmt
*
pMgmt
,
SVnodeObj
*
pVnode
,
bool
commitAndRemoveWal
)
{
char
path
[
TSDB_FILENAME_LEN
]
=
{
0
};
vnodeProposeCommitOnNeed
(
pVnode
->
pImpl
);
...
...
@@ -124,10 +124,24 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
vnodePostClose
(
pVnode
->
pImpl
);
vmFreeQueue
(
pMgmt
,
pVnode
);
if
(
commitAndRemoveWal
)
{
dInfo
(
"vgId:%d, commit data"
,
pVnode
->
vgId
);
vnodeSyncCommit
(
pVnode
->
pImpl
);
}
vnodeClose
(
pVnode
->
pImpl
);
pVnode
->
pImpl
=
NULL
;
dInfo
(
"vgId:%d, vnode is closed"
,
pVnode
->
vgId
);
if
(
commitAndRemoveWal
)
{
char
path
[
TSDB_FILENAME_LEN
]
=
{
0
};
snprintf
(
path
,
TSDB_FILENAME_LEN
,
"vnode%svnode%d%swal"
,
TD_DIRSEP
,
pVnode
->
vgId
,
TD_DIRSEP
);
dInfo
(
"vgId:%d, remove all wals, path:%s"
,
pVnode
->
vgId
,
path
);
tfsRmdir
(
pMgmt
->
pTfs
,
path
);
tfsMkdir
(
pMgmt
->
pTfs
,
path
);
}
if
(
pVnode
->
dropped
)
{
dInfo
(
"vgId:%d, vnode is destroyed, dropped:%d"
,
pVnode
->
vgId
,
pVnode
->
dropped
);
snprintf
(
path
,
TSDB_FILENAME_LEN
,
"vnode%svnode%d"
,
TD_DIRSEP
,
pVnode
->
vgId
);
...
...
@@ -257,7 +271,7 @@ static void *vmCloseVnodeInThread(void *param) {
pMgmt
->
state
.
openVnodes
,
pMgmt
->
state
.
totalVnodes
);
tmsgReportStartup
(
"vnode-close"
,
stepDesc
);
vmCloseVnode
(
pMgmt
,
pVnode
);
vmCloseVnode
(
pMgmt
,
pVnode
,
false
);
}
dInfo
(
"thread:%d, numOfVnodes:%d is closed"
,
pThread
->
threadIndex
,
pThread
->
vnodeNum
);
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
53ac9c72
...
...
@@ -58,6 +58,7 @@ void vnodePreClose(SVnode *pVnode);
void
vnodePostClose
(
SVnode
*
pVnode
);
void
vnodeSyncCheckTimeout
(
SVnode
*
pVnode
);
void
vnodeClose
(
SVnode
*
pVnode
);
int32_t
vnodeSyncCommit
(
SVnode
*
pVnode
);
int32_t
vnodeStart
(
SVnode
*
pVnode
);
void
vnodeStop
(
SVnode
*
pVnode
);
...
...
source/dnode/vnode/src/vnd/vnodeOpen.c
浏览文件 @
53ac9c72
...
...
@@ -124,8 +124,8 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod
return
-
1
;
}
vInfo
(
"vgId:%d,
alter hashrange from [%u, %u) to [%u, %u)"
,
pReq
->
srcVgId
,
info
.
config
.
hash
Begin
,
info
.
config
.
hash
End
,
pReq
->
hashBegin
,
pReq
->
hashEnd
);
vInfo
(
"vgId:%d,
start to alter hashrange from [%u, %u) to [%u, %u)"
,
pReq
->
srcVgId
,
info
.
config
.
hashBegin
,
info
.
config
.
hashEnd
,
pReq
->
hashBegin
,
pReq
->
hashEnd
);
info
.
config
.
vgId
=
pReq
->
dstVgId
;
info
.
config
.
hashBegin
=
pReq
->
hashBegin
;
info
.
config
.
hashEnd
=
pReq
->
hashEnd
;
...
...
@@ -165,6 +165,8 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod
return
-
1
;
}
// todo compact here
vInfo
(
"vgId:%d, vnode hashrange is altered"
,
info
.
config
.
vgId
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录