Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ffc98a26
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
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看板
提交
ffc98a26
编写于
7月 06, 2020
作者:
陶建辉(Jeff)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check vnode status before alter or build status
上级
87e80f8f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
7 deletion
+17
-7
src/inc/taoserror.h
src/inc/taoserror.h
+2
-1
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+10
-1
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+3
-3
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+2
-2
未找到文件。
src/inc/taoserror.h
浏览文件 @
ffc98a26
...
@@ -180,7 +180,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_DISK_PERMISSIONS, 0, 0x0506, "vnode no d
...
@@ -180,7 +180,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_DISK_PERMISSIONS, 0, 0x0506, "vnode no d
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_SUCH_FILE_OR_DIR
,
0
,
0x0507
,
"vnode no such file or directory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_SUCH_FILE_OR_DIR
,
0
,
0x0507
,
"vnode no such file or directory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_OUT_OF_MEMORY
,
0
,
0x0508
,
"vnode out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_OUT_OF_MEMORY
,
0
,
0x0508
,
"vnode out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_APP_ERROR
,
0
,
0x0509
,
"vnode app error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_APP_ERROR
,
0
,
0x0509
,
"vnode app error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_WRITE_AUTH
,
0
,
0x0214
,
"vnode no write auth"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_INVALID_STATUS
,
0
,
0x0510
,
"vnode not in ready state"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_WRITE_AUTH
,
0
,
0x0511
,
"vnode no write auth"
)
// tsdb
// tsdb
TAOS_DEFINE_ERROR
(
TSDB_CODE_TDB_INVALID_TABLE_ID
,
0
,
0x0600
,
"tsdb invalid table id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TDB_INVALID_TABLE_ID
,
0
,
0x0600
,
"tsdb invalid table id"
)
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
ffc98a26
...
@@ -162,6 +162,12 @@ int32_t vnodeAlter(void *param, SMDCreateVnodeMsg *pVnodeCfg) {
...
@@ -162,6 +162,12 @@ int32_t vnodeAlter(void *param, SMDCreateVnodeMsg *pVnodeCfg) {
SVnodeObj
*
pVnode
=
param
;
SVnodeObj
*
pVnode
=
param
;
pVnode
->
status
=
TAOS_VN_STATUS_UPDATING
;
pVnode
->
status
=
TAOS_VN_STATUS_UPDATING
;
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
return
TSDB_CODE_VND_INVALID_STATUS
;
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
==
TAOS_SYNC_ROLE_UNSYNCED
)
return
TSDB_CODE_VND_INVALID_STATUS
;
int32_t
code
=
vnodeSaveCfg
(
pVnodeCfg
);
int32_t
code
=
vnodeSaveCfg
(
pVnodeCfg
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
return
code
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
return
code
;
...
@@ -408,8 +414,11 @@ void *vnodeGetWal(void *pVnode) {
...
@@ -408,8 +414,11 @@ void *vnodeGetWal(void *pVnode) {
}
}
static
void
vnodeBuildVloadMsg
(
SVnodeObj
*
pVnode
,
SDMStatusMsg
*
pStatus
)
{
static
void
vnodeBuildVloadMsg
(
SVnodeObj
*
pVnode
,
SDMStatusMsg
*
pStatus
)
{
if
(
pVnode
->
status
==
TAOS_VN_STATUS_DELETING
)
return
;
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
return
;
if
(
pStatus
->
openVnodes
>=
TSDB_MAX_VNODES
)
return
;
if
(
pStatus
->
openVnodes
>=
TSDB_MAX_VNODES
)
return
;
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
==
TAOS_SYNC_ROLE_UNSYNCED
)
return
;
if
(
pVnode
->
tsdb
==
NULL
)
return
;
int64_t
totalStorage
,
compStorage
,
pointsWritten
=
0
;
int64_t
totalStorage
,
compStorage
,
pointsWritten
=
0
;
tsdbReportStat
(
pVnode
->
tsdb
,
&
pointsWritten
,
&
totalStorage
,
&
compStorage
);
tsdbReportStat
(
pVnode
->
tsdb
,
&
pointsWritten
,
&
totalStorage
,
&
compStorage
);
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
ffc98a26
...
@@ -46,9 +46,9 @@ int32_t vnodeProcessRead(void *param, SReadMsg *pReadMsg) {
...
@@ -46,9 +46,9 @@ int32_t vnodeProcessRead(void *param, SReadMsg *pReadMsg) {
return
TSDB_CODE_VND_MSG_NOT_PROCESSED
;
return
TSDB_CODE_VND_MSG_NOT_PROCESSED
;
}
}
if
(
pVnode
->
status
==
TAOS_VN_STATUS_DELETING
||
pVnode
->
status
==
TAOS_VN_STATUS_CLOSING
)
{
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
{
vDebug
(
"vgId:%d, msgType:%s not processed, vnode status is %d"
,
pVnode
->
vgId
,
taosMsg
[
msgType
],
pVnode
->
status
);
vDebug
(
"vgId:%d, msgType:%s not processed, vnode status is %d"
,
pVnode
->
vgId
,
taosMsg
[
msgType
],
pVnode
->
status
);
return
TSDB_CODE_VND_INVALID_
VGROUP_ID
;
return
TSDB_CODE_VND_INVALID_
STATUS
;
}
}
// TODO: Later, let slave to support query
// TODO: Later, let slave to support query
...
@@ -225,4 +225,4 @@ int32_t vnodeNotifyCurrentQhandle(void* handle, void* qhandle, int32_t vgId) {
...
@@ -225,4 +225,4 @@ int32_t vnodeNotifyCurrentQhandle(void* handle, void* qhandle, int32_t vgId) {
vDebug
(
"QInfo:%p register qhandle to connect:%p"
,
qhandle
,
handle
);
vDebug
(
"QInfo:%p register qhandle to connect:%p"
,
qhandle
,
handle
);
return
rpcReportProgress
(
handle
,
(
char
*
)
killQueryMsg
,
sizeof
(
SRetrieveTableMsg
));
return
rpcReportProgress
(
handle
,
(
char
*
)
killQueryMsg
,
sizeof
(
SRetrieveTableMsg
));
}
}
\ No newline at end of file
src/vnode/src/vnodeWrite.c
浏览文件 @
ffc98a26
...
@@ -58,10 +58,10 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
...
@@ -58,10 +58,10 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
if
(
pHead
->
version
==
0
)
{
// from client or CQ
if
(
pHead
->
version
==
0
)
{
// from client or CQ
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
return
TSDB_CODE_VND_INVALID_
VGROUP_ID
;
// it may be in deleting or closing state
return
TSDB_CODE_VND_INVALID_
STATUS
;
// it may be in deleting or closing state
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
return
TSDB_CODE_
RPC_NOT_READY
;
return
TSDB_CODE_
VND_INVALID_STATUS
;
// assign version
// assign version
pVnode
->
version
++
;
pVnode
->
version
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录