Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小楼昨夜-听风雨
TDengine
提交
72e8540c
T
TDengine
项目概览
小楼昨夜-听风雨
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
72e8540c
编写于
5月 30, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
5月 30, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2079 from taosdata/enhance/clean
Enhance/clean
上级
f17bc158
2bbe747b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
23 addition
and
28 deletion
+23
-28
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-3
src/inc/taoserror.h
src/inc/taoserror.h
+7
-11
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+6
-6
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+2
-2
src/plugins/http/src/httpJson.c
src/plugins/http/src/httpJson.c
+2
-2
src/plugins/http/src/tgJson.c
src/plugins/http/src/tgJson.c
+2
-2
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+1
-1
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+1
-1
未找到文件。
src/client/src/tscServer.c
浏览文件 @
72e8540c
...
...
@@ -237,9 +237,8 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
rpcMsg
->
code
=
TSDB_CODE_NETWORK_UNAVAIL
;
}
else
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
if
(
rpcMsg
->
code
==
TSDB_CODE_NOT_ACTIVE_TABLE
||
rpcMsg
->
code
==
TSDB_CODE_INVALID_TABLE_ID
||
rpcMsg
->
code
==
TSDB_CODE_INVALID_VGROUP_ID
||
rpcMsg
->
code
==
TSDB_CODE_NOT_ACTIVE_VNODE
||
rpcMsg
->
code
==
TSDB_CODE_NETWORK_UNAVAIL
||
rpcMsg
->
code
==
TSDB_CODE_TABLE_ID_MISMATCH
)
{
if
(
rpcMsg
->
code
==
TSDB_CODE_INVALID_TABLE_ID
||
rpcMsg
->
code
==
TSDB_CODE_INVALID_VGROUP_ID
||
rpcMsg
->
code
==
TSDB_CODE_NETWORK_UNAVAIL
)
{
/*
* not_active_table: 1. the virtual node may fail to create table, since the procedure of create table is asynchronized,
* the virtual node may have not create table till now, so try again by using the new metermeta.
...
...
src/inc/taoserror.h
浏览文件 @
72e8540c
...
...
@@ -93,16 +93,13 @@ TAOS_DEFINE_ERROR(TSDB_CODE_NO_USER_FROM_CONN, 0, 0x0185, "can not get
TAOS_DEFINE_ERROR
(
TSDB_CODE_TABLE_ALREADY_EXIST
,
0
,
0x0200
,
"table already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_TABLE_ID
,
0
,
0x0201
,
"invalid table id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_TABLE_TYPE
,
0
,
0x0202
,
"invalid table typee"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_TABLE
,
0
,
0x0203
,
"invalid table name"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_SUPER_TABLE
,
0
,
0x0204
,
"no super table"
)
// operation only available for super table
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_ACTIVE_TABLE
,
0
,
0x0205
,
"not active table"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TABLE_ID_MISMATCH
,
0
,
0x0206
,
"table id mismatch"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TAG_ALREAY_EXIST
,
0
,
0x0207
,
"tag already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TAG_NOT_EXIST
,
0
,
0x0208
,
"tag not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FIELD_ALREAY_EXIST
,
0
,
0x0209
,
"field already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FIELD_NOT_EXIST
,
0
,
0x020A
,
"field not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_COL_NAME_TOO_LONG
,
0
,
0x020B
,
"column name too long"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_TAGS
,
0
,
0x020C
,
"too many tags"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_SUPER_TABLE
,
0
,
0x0203
,
"no super table"
)
// operation only available for super table
TAOS_DEFINE_ERROR
(
TSDB_CODE_TAG_ALREAY_EXIST
,
0
,
0x0204
,
"tag already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TAG_NOT_EXIST
,
0
,
0x0205
,
"tag not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FIELD_ALREAY_EXIST
,
0
,
0x0206
,
"field already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FIELD_NOT_EXIST
,
0
,
0x0207
,
"field not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_COL_NAME_TOO_LONG
,
0
,
0x0209
,
"column name too long"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TOO_MANY_TAGS
,
0
,
0x0209
,
"too many tags"
)
// dnode & mnode
...
...
@@ -147,7 +144,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_CPU_LIMITED, 0, 0x038F, "grant cpu li
// server
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VGROUP_ID
,
0
,
0x0400
,
"invalid vgroup id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_ACTIVE_VNODE
,
0
,
0x0401
,
"not active vnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VG_INIT_FAILED
,
0
,
0x0402
,
"vgroup init failed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_NO_DISKSPACE
,
0
,
0x0403
,
"server no diskspace"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_OUT_OF_MEMORY
,
0
,
0x0404
,
"server out of memory"
)
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
72e8540c
...
...
@@ -721,7 +721,7 @@ static int32_t mnodeProcessDropTableMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_SUCCESS
;
}
else
{
mError
(
"table:%s, failed to drop table, table not exist"
,
pDrop
->
tableId
);
return
TSDB_CODE_INVALID_TABLE
;
return
TSDB_CODE_INVALID_TABLE
_ID
;
}
}
...
...
@@ -749,7 +749,7 @@ static int32_t mnodeProcessTableMetaMsg(SMnodeMsg *pMsg) {
if
(
pMsg
->
pTable
==
NULL
)
{
if
(
!
pInfo
->
createFlag
)
{
mError
(
"table:%s, failed to get table meta, table not exist"
,
pInfo
->
tableId
);
return
TSDB_CODE_INVALID_TABLE
;
return
TSDB_CODE_INVALID_TABLE
_ID
;
}
else
{
mTrace
(
"table:%s, failed to get table meta, start auto create table "
,
pInfo
->
tableId
);
return
mnodeAutoCreateChildTable
(
pMsg
);
...
...
@@ -786,7 +786,7 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
if
(
pStable
->
schema
==
NULL
)
{
free
(
pStable
);
mError
(
"table:%s, failed to create, no schema input"
,
pCreate
->
tableId
);
return
TSDB_CODE_INVALID_TABLE
;
return
TSDB_CODE_INVALID_TABLE
_ID
;
}
memcpy
(
pStable
->
schema
,
pCreate
->
schema
,
numOfCols
*
sizeof
(
SSchema
));
...
...
@@ -1430,7 +1430,7 @@ static SChildTableObj* mnodeDoCreateChildTable(SCMCreateTableMsg *pCreate, SVgOb
if
(
pSuperTable
==
NULL
)
{
mError
(
"table:%s, corresponding super table:%s does not exist"
,
pCreate
->
tableId
,
pTagData
->
name
);
free
(
pTable
);
terrno
=
TSDB_CODE_INVALID_TABLE
;
terrno
=
TSDB_CODE_INVALID_TABLE
_ID
;
return
NULL
;
}
mnodeDecTableRef
(
pSuperTable
);
...
...
@@ -1888,7 +1888,7 @@ static int32_t mnodeProcessTableCfgMsg(SMnodeMsg *pMsg) {
SChildTableObj
*
pTable
=
mnodeGetTableByPos
(
pCfg
->
vgId
,
pCfg
->
sid
);
if
(
pTable
==
NULL
)
{
mError
(
"dnode:%d, vgId:%d sid:%d, table not found"
,
pCfg
->
dnodeId
,
pCfg
->
vgId
,
pCfg
->
sid
);
return
TSDB_CODE_
NOT_ACTIVE_TABLE
;
return
TSDB_CODE_
INVALID_TABLE_ID
;
}
SMDCreateTableMsg
*
pCreate
=
NULL
;
...
...
@@ -2199,7 +2199,7 @@ static int32_t mnodeProcessAlterTableMsg(SMnodeMsg *pMsg) {
if
(
pMsg
->
pTable
==
NULL
)
pMsg
->
pTable
=
mnodeGetTable
(
pAlter
->
tableId
);
if
(
pMsg
->
pTable
==
NULL
)
{
mError
(
"table:%s, failed to alter table, table not exist"
,
pMsg
->
pTable
->
tableId
);
return
TSDB_CODE_INVALID_TABLE
;
return
TSDB_CODE_INVALID_TABLE
_ID
;
}
pAlter
->
type
=
htons
(
pAlter
->
type
);
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
72e8540c
...
...
@@ -716,14 +716,14 @@ static int32_t mnodeProcessVnodeCfgMsg(SMnodeMsg *pMsg) {
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pCfg
->
dnodeId
);
if
(
pDnode
==
NULL
)
{
mTrace
(
"dnode:%s, invalid dnode"
,
taosIpStr
(
pCfg
->
dnodeId
),
pCfg
->
vgId
);
return
TSDB_CODE_
NOT_ACTIVE_VNODE
;
return
TSDB_CODE_
INVALID_VGROUP_ID
;
}
mnodeDecDnodeRef
(
pDnode
);
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pCfg
->
vgId
);
if
(
pVgroup
==
NULL
)
{
mTrace
(
"dnode:%s, vgId:%d, no vgroup info"
,
taosIpStr
(
pCfg
->
dnodeId
),
pCfg
->
vgId
);
return
TSDB_CODE_
NOT_ACTIVE_VNODE
;
return
TSDB_CODE_
INVALID_VGROUP_ID
;
}
mnodeDecVgroupRef
(
pVgroup
);
...
...
src/plugins/http/src/httpJson.c
浏览文件 @
72e8540c
...
...
@@ -445,10 +445,10 @@ void httpJsonPairStatus(JsonBuf* buf, int code) {
httpJsonItemToken
(
buf
);
if
(
code
==
TSDB_CODE_DB_NOT_SELECTED
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create database"
,
23
);
}
else
if
(
code
==
TSDB_CODE_INVALID_TABLE
)
{
}
else
if
(
code
==
TSDB_CODE_INVALID_TABLE
_ID
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create table"
,
22
);
}
else
httpJsonPair
(
buf
,
"desc"
,
4
,
(
char
*
)
tstrerror
(
code
),
(
int
)
strlen
(
tstrerror
(
code
)));
}
}
}
\ No newline at end of file
}
src/plugins/http/src/tgJson.c
浏览文件 @
72e8540c
...
...
@@ -111,7 +111,7 @@ bool tgCheckFinished(struct HttpContext *pContext, HttpSqlCmd *cmd, int code) {
pContext
->
ipstr
);
return
false
;
}
}
else
if
(
code
==
TSDB_CODE_INVALID_TABLE
)
{
}
else
if
(
code
==
TSDB_CODE_INVALID_TABLE
_ID
)
{
cmd
->
cmdState
=
HTTP_CMD_STATE_RUN_FINISHED
;
if
(
multiCmds
->
cmds
[
multiCmds
->
pos
-
1
].
cmdState
==
HTTP_CMD_STATE_NOT_RUN_YET
)
{
multiCmds
->
pos
=
(
int16_t
)(
multiCmds
->
pos
-
2
);
...
...
@@ -151,4 +151,4 @@ void tgSetNextCmd(struct HttpContext *pContext, HttpSqlCmd *cmd, int code) {
}
else
{
multiCmds
->
pos
++
;
}
}
\ No newline at end of file
}
src/vnode/src/vnodeRead.c
浏览文件 @
72e8540c
...
...
@@ -43,7 +43,7 @@ int32_t vnodeProcessRead(void *param, int msgType, void *pCont, int32_t contLen,
return
TSDB_CODE_MSG_NOT_PROCESSED
;
if
(
pVnode
->
status
==
TAOS_VN_STATUS_DELETING
||
pVnode
->
status
==
TAOS_VN_STATUS_CLOSING
)
return
TSDB_CODE_
NOT_ACTIVE_VNODE
;
return
TSDB_CODE_
INVALID_VGROUP_ID
;
return
(
*
vnodeProcessReadMsgFp
[
msgType
])(
pVnode
,
pCont
,
contLen
,
ret
);
}
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
72e8540c
...
...
@@ -53,7 +53,7 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
if
(
pHead
->
version
==
0
)
{
// from client or CQ
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
return
TSDB_CODE_
NOT_ACTIVE_VNODE
;
return
TSDB_CODE_
INVALID_VGROUP_ID
;
// it may be in deleting or closing state
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
return
TSDB_CODE_NOT_READY
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录