Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
c37671f3
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c37671f3
编写于
7月 16, 2020
作者:
陶建辉(Jeff)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
renanme function
上级
a58e2164
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
11 addition
and
12 deletion
+11
-12
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+2
-2
src/inc/vnode.h
src/inc/vnode.h
+4
-5
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+5
-5
未找到文件。
src/dnode/src/dnodeMgmt.c
浏览文件 @
c37671f3
...
@@ -416,7 +416,7 @@ static void* dnodeParseVnodeMsg(SRpcMsg *rpcMsg) {
...
@@ -416,7 +416,7 @@ static void* dnodeParseVnodeMsg(SRpcMsg *rpcMsg) {
static
int32_t
dnodeProcessCreateVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
static
int32_t
dnodeProcessCreateVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
SMDCreateVnodeMsg
*
pCreate
=
dnodeParseVnodeMsg
(
rpcMsg
);
SMDCreateVnodeMsg
*
pCreate
=
dnodeParseVnodeMsg
(
rpcMsg
);
void
*
pVnode
=
vnodeAcquire
Vnode
(
pCreate
->
cfg
.
vgId
);
void
*
pVnode
=
vnodeAcquire
(
pCreate
->
cfg
.
vgId
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
dDebug
(
"vgId:%d, already exist, return success"
,
pCreate
->
cfg
.
vgId
);
dDebug
(
"vgId:%d, already exist, return success"
,
pCreate
->
cfg
.
vgId
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
...
@@ -430,7 +430,7 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
...
@@ -430,7 +430,7 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
static
int32_t
dnodeProcessAlterVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
static
int32_t
dnodeProcessAlterVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
SMDAlterVnodeMsg
*
pAlter
=
dnodeParseVnodeMsg
(
rpcMsg
);
SMDAlterVnodeMsg
*
pAlter
=
dnodeParseVnodeMsg
(
rpcMsg
);
void
*
pVnode
=
vnodeAcquire
Vnode
(
pAlter
->
cfg
.
vgId
);
void
*
pVnode
=
vnodeAcquire
(
pAlter
->
cfg
.
vgId
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
dDebug
(
"vgId:%d, alter vnode msg is received"
,
pAlter
->
cfg
.
vgId
);
dDebug
(
"vgId:%d, alter vnode msg is received"
,
pAlter
->
cfg
.
vgId
);
int32_t
code
=
vnodeAlter
(
pVnode
,
pAlter
);
int32_t
code
=
vnodeAlter
(
pVnode
,
pAlter
);
...
...
src/inc/vnode.h
浏览文件 @
c37671f3
...
@@ -48,11 +48,10 @@ int32_t vnodeStartStream(int32_t vgId);
...
@@ -48,11 +48,10 @@ int32_t vnodeStartStream(int32_t vgId);
int32_t
vnodeAlter
(
void
*
pVnode
,
SMDCreateVnodeMsg
*
pVnodeCfg
);
int32_t
vnodeAlter
(
void
*
pVnode
,
SMDCreateVnodeMsg
*
pVnodeCfg
);
int32_t
vnodeClose
(
int32_t
vgId
);
int32_t
vnodeClose
(
int32_t
vgId
);
void
*
vnodeAcquireVnode
(
int32_t
vgId
);
// add refcount
void
*
vnodeAcquire
(
int32_t
vgId
);
// add refcount
void
vnodeRelease
(
void
*
pVnode
);
void
*
vnodeAcquireRqueue
(
int32_t
vgId
);
// add refCount, get read queue
void
*
vnodeAcquireWqueue
(
int32_t
vgId
);
// add recCount, get write queue
void
*
vnodeAcquireRqueue
(
int32_t
vgId
);
void
vnodeRelease
(
void
*
pVnode
);
// dec refCount
void
*
vnodeAcquireWqueue
(
int32_t
vgId
);
void
*
vnodeGetWal
(
void
*
pVnode
);
void
*
vnodeGetWal
(
void
*
pVnode
);
int32_t
vnodeProcessWrite
(
void
*
pVnode
,
int
qtype
,
void
*
pHead
,
void
*
item
);
int32_t
vnodeProcessWrite
(
void
*
pVnode
,
int
qtype
,
void
*
pHead
,
void
*
item
);
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
c37671f3
...
@@ -314,7 +314,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
...
@@ -314,7 +314,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
}
}
int32_t
vnodeStartStream
(
int32_t
vnode
)
{
int32_t
vnodeStartStream
(
int32_t
vnode
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
Vnode
(
vnode
);
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vnode
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
tsdbStartStream
(
pVnode
->
tsdb
);
tsdbStartStream
(
pVnode
->
tsdb
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
...
@@ -387,7 +387,7 @@ void vnodeRelease(void *pVnodeRaw) {
...
@@ -387,7 +387,7 @@ void vnodeRelease(void *pVnodeRaw) {
vDebug
(
"vgId:%d, vnode is released, vnodes:%d"
,
vgId
,
count
);
vDebug
(
"vgId:%d, vnode is released, vnodes:%d"
,
vgId
,
count
);
}
}
void
*
vnodeAcquire
Vnode
(
int32_t
vgId
)
{
void
*
vnodeAcquire
(
int32_t
vgId
)
{
SVnodeObj
**
ppVnode
=
(
SVnodeObj
**
)
taosHashGet
(
tsDnodeVnodesHash
,
(
const
char
*
)
&
vgId
,
sizeof
(
int32_t
));
SVnodeObj
**
ppVnode
=
(
SVnodeObj
**
)
taosHashGet
(
tsDnodeVnodesHash
,
(
const
char
*
)
&
vgId
,
sizeof
(
int32_t
));
if
(
ppVnode
==
NULL
||
*
ppVnode
==
NULL
)
{
if
(
ppVnode
==
NULL
||
*
ppVnode
==
NULL
)
{
terrno
=
TSDB_CODE_VND_INVALID_VGROUP_ID
;
terrno
=
TSDB_CODE_VND_INVALID_VGROUP_ID
;
...
@@ -403,7 +403,7 @@ void *vnodeAcquireVnode(int32_t vgId) {
...
@@ -403,7 +403,7 @@ void *vnodeAcquireVnode(int32_t vgId) {
}
}
void
*
vnodeAcquireRqueue
(
int32_t
vgId
)
{
void
*
vnodeAcquireRqueue
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
Vnode
(
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vgId
);
if
(
pVnode
==
NULL
)
return
NULL
;
if
(
pVnode
==
NULL
)
return
NULL
;
if
(
pVnode
->
status
==
TAOS_VN_STATUS_RESET
)
{
if
(
pVnode
->
status
==
TAOS_VN_STATUS_RESET
)
{
...
@@ -417,7 +417,7 @@ void *vnodeAcquireRqueue(int32_t vgId) {
...
@@ -417,7 +417,7 @@ void *vnodeAcquireRqueue(int32_t vgId) {
}
}
void
*
vnodeAcquireWqueue
(
int32_t
vgId
)
{
void
*
vnodeAcquireWqueue
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
Vnode
(
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vgId
);
if
(
pVnode
==
NULL
)
return
NULL
;
if
(
pVnode
==
NULL
)
return
NULL
;
if
(
pVnode
->
status
==
TAOS_VN_STATUS_RESET
)
{
if
(
pVnode
->
status
==
TAOS_VN_STATUS_RESET
)
{
...
@@ -498,7 +498,7 @@ void vnodeBuildStatusMsg(void *param) {
...
@@ -498,7 +498,7 @@ void vnodeBuildStatusMsg(void *param) {
void
vnodeSetAccess
(
SDMVgroupAccess
*
pAccess
,
int32_t
numOfVnodes
)
{
void
vnodeSetAccess
(
SDMVgroupAccess
*
pAccess
,
int32_t
numOfVnodes
)
{
for
(
int32_t
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
pAccess
[
i
].
vgId
=
htonl
(
pAccess
[
i
].
vgId
);
pAccess
[
i
].
vgId
=
htonl
(
pAccess
[
i
].
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
Vnode
(
pAccess
[
i
].
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquire
(
pAccess
[
i
].
vgId
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
pVnode
->
accessState
=
pAccess
[
i
].
accessState
;
pVnode
->
accessState
=
pAccess
[
i
].
accessState
;
if
(
pVnode
->
accessState
!=
TSDB_VN_ALL_ACCCESS
)
{
if
(
pVnode
->
accessState
!=
TSDB_VN_ALL_ACCCESS
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录