Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c1498e4a
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c1498e4a
编写于
7月 12, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: invalid vnode ref while drop stream
上级
afc316ef
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
4 deletion
+15
-4
source/common/src/tglobal.c
source/common/src/tglobal.c
+4
-0
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
+1
-1
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+3
-0
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+7
-3
未找到文件。
source/common/src/tglobal.c
浏览文件 @
c1498e4a
...
...
@@ -412,8 +412,12 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
tsNumOfVnodeQueryThreads
=
TMAX
(
tsNumOfVnodeQueryThreads
,
2
);
if
(
cfgAddInt32
(
pCfg
,
"numOfVnodeQueryThreads"
,
tsNumOfVnodeQueryThreads
,
1
,
1024
,
0
)
!=
0
)
return
-
1
;
#if 0
tsNumOfVnodeFetchThreads = tsNumOfCores / 4;
tsNumOfVnodeFetchThreads = TMAX(tsNumOfVnodeFetchThreads, 4);
#else
tsNumOfVnodeFetchThreads
=
1
;
#endif
if
(
cfgAddInt32
(
pCfg
,
"numOfVnodeFetchThreads"
,
tsNumOfVnodeFetchThreads
,
1
,
1024
,
0
)
!=
0
)
return
-
1
;
tsNumOfVnodeWriteThreads
=
tsNumOfCores
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
浏览文件 @
c1498e4a
...
...
@@ -31,7 +31,7 @@ SVnodeObj **vmGetVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes) {
SVnodeObj
*
pVnode
=
*
ppVnode
;
if
(
pVnode
&&
num
<
size
)
{
int32_t
refCount
=
atomic_add_fetch_32
(
&
pVnode
->
refCount
,
1
);
// dTrace("vgId:%d, acquire vnode
, refCount
:%d", pVnode->vgId, refCount);
// dTrace("vgId:%d, acquire vnode
list, ref
:%d", pVnode->vgId, refCount);
pVnodes
[
num
++
]
=
(
*
ppVnode
);
pIter
=
taosHashIterate
(
pMgmt
->
hash
,
pIter
);
}
else
{
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
c1498e4a
...
...
@@ -23,6 +23,7 @@ SVnodeObj *vmAcquireVnode(SVnodeMgmt *pMgmt, int32_t vgId) {
taosHashGetDup
(
pMgmt
->
hash
,
&
vgId
,
sizeof
(
int32_t
),
(
void
*
)
&
pVnode
);
if
(
pVnode
==
NULL
||
pVnode
->
dropped
)
{
terrno
=
TSDB_CODE_VND_INVALID_VGROUP_ID
;
pVnode
=
NULL
;
}
else
{
int32_t
refCount
=
atomic_add_fetch_32
(
&
pVnode
->
refCount
,
1
);
// dTrace("vgId:%d, acquire vnode, ref:%d", pVnode->vgId, refCount);
...
...
@@ -80,6 +81,8 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
taosThreadRwlockUnlock
(
&
pMgmt
->
lock
);
vmReleaseVnode
(
pMgmt
,
pVnode
);
dTrace
(
"vgId:%d, wait for vnode ref become 0"
,
pVnode
->
vgId
);
while
(
pVnode
->
refCount
>
0
)
taosMsleep
(
10
);
dTrace
(
"vgId:%d, wait for vnode queue is empty"
,
pVnode
->
vgId
);
...
...
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
c1498e4a
...
...
@@ -206,9 +206,9 @@ int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
int32_t
code
=
vmPutMsgToQueue
(
pMgmt
,
pMsg
,
qtype
);
if
(
code
!=
0
)
{
dTrace
(
"msg:%p, is freed"
,
pMsg
);
taosFreeQitem
(
pMsg
);
rpcFreeCont
(
pMsg
->
pCont
);
pRpc
->
pCont
=
NULL
;
taosFreeQitem
(
pMsg
);
}
return
code
;
...
...
@@ -237,8 +237,8 @@ int32_t vmGetQueueSize(SVnodeMgmt *pMgmt, int32_t vgId, EQueueType qtype) {
default:
break
;
}
vmReleaseVnode
(
pMgmt
,
pVnode
);
}
vmReleaseVnode
(
pMgmt
,
pVnode
);
return
size
;
}
...
...
@@ -255,7 +255,11 @@ int32_t vmAllocQueue(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
return
-
1
;
}
dDebug
(
"vgId:%d, queue is alloced"
,
pVnode
->
vgId
);
dDebug
(
"vgId:%d, write-queue:%p is alloced"
,
pVnode
->
vgId
,
pVnode
->
pWriteQ
);
dDebug
(
"vgId:%d, sync-queue:%p is alloced"
,
pVnode
->
vgId
,
pVnode
->
pSyncQ
);
dDebug
(
"vgId:%d, apply-queue:%p is alloced"
,
pVnode
->
vgId
,
pVnode
->
pApplyQ
);
dDebug
(
"vgId:%d, query-queue:%p is alloced"
,
pVnode
->
vgId
,
pVnode
->
pQueryQ
);
dDebug
(
"vgId:%d, fetch-queue:%p is alloced"
,
pVnode
->
vgId
,
pVnode
->
pFetchQ
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录