Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
74d7e80f
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看板
未验证
提交
74d7e80f
编写于
7月 01, 2021
作者:
H
Hongze Cheng
提交者:
GitHub
7月 01, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6693 from taosdata/fix/TD-4593
[TD-4593]<fix>: fix vnode cannnot close while syncing
上级
47195680
b9ccb24a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
28 addition
and
9 deletion
+28
-9
src/dnode/src/dnodeVMgmt.c
src/dnode/src/dnodeVMgmt.c
+1
-1
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+1
-1
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+1
-1
src/inc/vnode.h
src/inc/vnode.h
+1
-0
src/vnode/inc/vnodeInt.h
src/vnode/inc/vnodeInt.h
+2
-0
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+5
-4
src/vnode/src/vnodeMgmt.c
src/vnode/src/vnodeMgmt.c
+13
-1
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+4
-1
未找到文件。
src/dnode/src/dnodeVMgmt.c
浏览文件 @
74d7e80f
...
...
@@ -169,7 +169,7 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
static
int32_t
dnodeProcessAlterVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
SAlterVnodeMsg
*
pAlter
=
dnodeParseVnodeMsg
(
rpcMsg
);
void
*
pVnode
=
vnodeAcquire
(
pAlter
->
cfg
.
vgId
);
void
*
pVnode
=
vnodeAcquire
NotClose
(
pAlter
->
cfg
.
vgId
);
if
(
pVnode
!=
NULL
)
{
dDebug
(
"vgId:%d, alter vnode msg is received"
,
pAlter
->
cfg
.
vgId
);
int32_t
code
=
vnodeAlter
(
pVnode
,
pAlter
);
...
...
src/dnode/src/dnodeVRead.c
浏览文件 @
74d7e80f
...
...
@@ -63,7 +63,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
assert
(
pHead
->
contLen
>
0
);
void
*
pVnode
=
vnodeAcquire
(
pHead
->
vgId
);
void
*
pVnode
=
vnodeAcquire
NotClose
(
pHead
->
vgId
);
if
(
pVnode
!=
NULL
)
{
code
=
vnodeWriteToRQueue
(
pVnode
,
pCont
,
pHead
->
contLen
,
TAOS_QTYPE_RPC
,
pMsg
);
if
(
code
==
TSDB_CODE_SUCCESS
)
queuedMsgNum
++
;
...
...
src/dnode/src/dnodeVWrite.c
浏览文件 @
74d7e80f
...
...
@@ -85,7 +85,7 @@ void dnodeDispatchToVWriteQueue(SRpcMsg *pRpcMsg) {
pMsg
->
vgId
=
htonl
(
pMsg
->
vgId
);
pMsg
->
contLen
=
htonl
(
pMsg
->
contLen
);
void
*
pVnode
=
vnodeAcquire
(
pMsg
->
vgId
);
void
*
pVnode
=
vnodeAcquire
NotClose
(
pMsg
->
vgId
);
if
(
pVnode
==
NULL
)
{
code
=
TSDB_CODE_VND_INVALID_VGROUP_ID
;
}
else
{
...
...
src/inc/vnode.h
浏览文件 @
74d7e80f
...
...
@@ -68,6 +68,7 @@ int32_t vnodeInitMgmt();
void
vnodeCleanupMgmt
();
void
*
vnodeAcquire
(
int32_t
vgId
);
void
vnodeRelease
(
void
*
pVnode
);
void
*
vnodeAcquireNotClose
(
int32_t
vgId
);
void
*
vnodeGetWal
(
void
*
pVnode
);
int32_t
vnodeGetVnodeList
(
int32_t
vnodeList
[],
int32_t
*
numOfVnodes
);
void
vnodeBuildStatusMsg
(
void
*
pStatus
);
...
...
src/vnode/inc/vnodeInt.h
浏览文件 @
74d7e80f
...
...
@@ -41,6 +41,8 @@ typedef struct {
int32_t
queuedWMsg
;
int32_t
queuedRMsg
;
int32_t
flowctrlLevel
;
int8_t
preClose
;
// drop and close switch
int8_t
reserved
[
3
];
int64_t
sequence
;
// for topic
int8_t
status
;
int8_t
role
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
74d7e80f
...
...
@@ -93,7 +93,7 @@ int32_t vnodeCreate(SCreateVnodeMsg *pVnodeCfg) {
}
int32_t
vnodeSync
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
NotClose
(
vgId
);
if
(
pVnode
==
NULL
)
{
vDebug
(
"vgId:%d, failed to sync, vnode not find"
,
vgId
);
return
TSDB_CODE_VND_INVALID_VGROUP_ID
;
...
...
@@ -115,7 +115,7 @@ int32_t vnodeSync(int32_t vgId) {
}
int32_t
vnodeDrop
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
NotClose
(
vgId
);
if
(
pVnode
==
NULL
)
{
vDebug
(
"vgId:%d, failed to drop, vnode not find"
,
vgId
);
return
TSDB_CODE_VND_INVALID_VGROUP_ID
;
...
...
@@ -390,15 +390,16 @@ int32_t vnodeOpen(int32_t vgId) {
}
int32_t
vnodeClose
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
NotClose
(
vgId
);
if
(
pVnode
==
NULL
)
return
0
;
if
(
pVnode
->
dropped
)
{
vnodeRelease
(
pVnode
);
return
0
;
}
pVnode
->
preClose
=
1
;
vDebug
(
"vgId:%d, vnode will be closed, pVnode:%p"
,
pVnode
->
vgId
,
pVnode
);
vnodeRemoveFromHash
(
pVnode
);
vnodeRelease
(
pVnode
);
vnodeCleanUp
(
pVnode
);
...
...
src/vnode/src/vnodeMgmt.c
浏览文件 @
74d7e80f
...
...
@@ -125,6 +125,18 @@ void vnodeRelease(void *vparam) {
}
}
void
*
vnodeAcquireNotClose
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vgId
);
if
(
pVnode
!=
NULL
&&
pVnode
->
preClose
==
1
)
{
vnodeRelease
(
pVnode
);
terrno
=
TSDB_CODE_VND_INVALID_VGROUP_ID
;
vDebug
(
"vgId:%d, not exist, pre closing"
,
vgId
);
return
NULL
;
}
return
pVnode
;
}
static
void
vnodeBuildVloadMsg
(
SVnodeObj
*
pVnode
,
SStatusMsg
*
pStatus
)
{
int64_t
totalStorage
=
0
;
int64_t
compStorage
=
0
;
...
...
@@ -187,7 +199,7 @@ void vnodeBuildStatusMsg(void *param) {
void
vnodeSetAccess
(
SVgroupAccess
*
pAccess
,
int32_t
numOfVnodes
)
{
for
(
int32_t
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
pAccess
[
i
].
vgId
=
htonl
(
pAccess
[
i
].
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
(
pAccess
[
i
].
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
NotClose
(
pAccess
[
i
].
vgId
);
if
(
pVnode
!=
NULL
)
{
pVnode
->
accessState
=
pAccess
[
i
].
accessState
;
if
(
pVnode
->
accessState
!=
TSDB_VN_ALL_ACCCESS
)
{
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
74d7e80f
...
...
@@ -396,10 +396,13 @@ static int32_t vnodePerformFlowCtrl(SVWriteMsg *pWrite) {
}
void
vnodeWaitWriteCompleted
(
SVnodeObj
*
pVnode
)
{
int32_t
extraSleep
=
0
;
while
(
pVnode
->
queuedWMsg
>
0
)
{
vTrace
(
"vgId:%d, queued wmsg num:%d"
,
pVnode
->
vgId
,
pVnode
->
queuedWMsg
);
taosMsleep
(
10
);
extraSleep
=
1
;
}
taosMsleep
(
900
);
if
(
extraSleep
)
taosMsleep
(
900
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录