Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
王长生-AnH
TDengine
提交
7782318d
T
TDengine
项目概览
王长生-AnH
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
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,发现更多精彩内容 >>
提交
7782318d
编写于
8月 20, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1184 add error code
上级
34d88f98
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
19 addition
and
17 deletion
+19
-17
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-0
src/dnode/src/dnodePeer.c
src/dnode/src/dnodePeer.c
+1
-1
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+2
-2
src/inc/taoserror.h
src/inc/taoserror.h
+2
-1
src/mnode/src/mnodeUser.c
src/mnode/src/mnodeUser.c
+2
-2
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+1
-1
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+2
-2
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+4
-4
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+4
-4
未找到文件。
src/client/src/tscServer.c
浏览文件 @
7782318d
...
@@ -275,6 +275,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
...
@@ -275,6 +275,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
(
rpcMsg
->
code
==
TSDB_CODE_TDB_INVALID_TABLE_ID
||
(
rpcMsg
->
code
==
TSDB_CODE_TDB_INVALID_TABLE_ID
||
rpcMsg
->
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
||
rpcMsg
->
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
||
rpcMsg
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
rpcMsg
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
rpcMsg
->
code
==
TSDB_CODE_APP_NOT_READY
||
rpcMsg
->
code
==
TSDB_CODE_TDB_TABLE_RECONFIGURE
))
{
rpcMsg
->
code
==
TSDB_CODE_TDB_TABLE_RECONFIGURE
))
{
tscWarn
(
"%p it shall renew table meta, code:%s, retry:%d"
,
pSql
,
tstrerror
(
rpcMsg
->
code
),
++
pSql
->
retry
);
tscWarn
(
"%p it shall renew table meta, code:%s, retry:%d"
,
pSql
,
tstrerror
(
rpcMsg
->
code
),
++
pSql
->
retry
);
...
...
src/dnode/src/dnodePeer.c
浏览文件 @
7782318d
...
@@ -93,7 +93,7 @@ static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
...
@@ -93,7 +93,7 @@ static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
if
(
pMsg
->
pCont
==
NULL
)
return
;
if
(
pMsg
->
pCont
==
NULL
)
return
;
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_RUNING
)
{
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_RUNING
)
{
rspMsg
.
code
=
TSDB_CODE_
RPC
_NOT_READY
;
rspMsg
.
code
=
TSDB_CODE_
APP
_NOT_READY
;
rpcSendResponse
(
&
rspMsg
);
rpcSendResponse
(
&
rspMsg
);
rpcFreeCont
(
pMsg
->
pCont
);
rpcFreeCont
(
pMsg
->
pCont
);
dDebug
(
"RPC %p, msg:%s is ignored since dnode not running"
,
pMsg
->
handle
,
taosMsg
[
pMsg
->
msgType
]);
dDebug
(
"RPC %p, msg:%s is ignored since dnode not running"
,
pMsg
->
handle
,
taosMsg
[
pMsg
->
msgType
]);
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
7782318d
...
@@ -119,7 +119,7 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
...
@@ -119,7 +119,7 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_RUNING
)
{
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_RUNING
)
{
dError
(
"RPC %p, shell msg:%s is ignored since dnode not running"
,
pMsg
->
handle
,
taosMsg
[
pMsg
->
msgType
]);
dError
(
"RPC %p, shell msg:%s is ignored since dnode not running"
,
pMsg
->
handle
,
taosMsg
[
pMsg
->
msgType
]);
rpcMsg
.
code
=
TSDB_CODE_
RPC
_NOT_READY
;
rpcMsg
.
code
=
TSDB_CODE_
APP
_NOT_READY
;
rpcSendResponse
(
&
rpcMsg
);
rpcSendResponse
(
&
rpcMsg
);
rpcFreeCont
(
pMsg
->
pCont
);
rpcFreeCont
(
pMsg
->
pCont
);
return
;
return
;
...
@@ -144,7 +144,7 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
...
@@ -144,7 +144,7 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
static
int
dnodeRetrieveUserAuthInfo
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
static
int
dnodeRetrieveUserAuthInfo
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
int
code
=
mnodeRetriveAuth
(
user
,
spi
,
encrypt
,
secret
,
ckey
);
int
code
=
mnodeRetriveAuth
(
user
,
spi
,
encrypt
,
secret
,
ckey
);
if
(
code
!=
TSDB_CODE_
RPC
_NOT_READY
)
return
code
;
if
(
code
!=
TSDB_CODE_
APP
_NOT_READY
)
return
code
;
SDMAuthMsg
*
pMsg
=
rpcMallocCont
(
sizeof
(
SDMAuthMsg
));
SDMAuthMsg
*
pMsg
=
rpcMallocCont
(
sizeof
(
SDMAuthMsg
));
tstrncpy
(
pMsg
->
user
,
user
,
sizeof
(
pMsg
->
user
));
tstrncpy
(
pMsg
->
user
,
user
,
sizeof
(
pMsg
->
user
));
...
...
src/inc/taoserror.h
浏览文件 @
7782318d
...
@@ -65,6 +65,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RPC_INVALID_SESSION_ID, 0, 0x0010, "Invalid se
...
@@ -65,6 +65,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RPC_INVALID_SESSION_ID, 0, 0x0010, "Invalid se
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_MSG_TYPE
,
0
,
0x0011
,
"Invalid message type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_MSG_TYPE
,
0
,
0x0011
,
"Invalid message type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_RESPONSE_TYPE
,
0
,
0x0012
,
"Invalid response type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_RESPONSE_TYPE
,
0
,
0x0012
,
"Invalid response type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_TIME_STAMP
,
0
,
0x0013
,
"Invalid timestamp"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_TIME_STAMP
,
0
,
0x0013
,
"Invalid timestamp"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_APP_NOT_READY
,
0
,
0x0014
,
"Database not ready"
)
//common & util
//common & util
TAOS_DEFINE_ERROR
(
TSDB_CODE_COM_OPS_NOT_SUPPORT
,
0
,
0x0100
,
"Operation not supported"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_COM_OPS_NOT_SUPPORT
,
0
,
0x0100
,
"Operation not supported"
)
...
@@ -184,7 +185,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_DISK_PERMISSIONS, 0, 0x0506, "No write p
...
@@ -184,7 +185,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_DISK_PERMISSIONS, 0, 0x0506, "No write p
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_SUCH_FILE_OR_DIR
,
0
,
0x0507
,
"Missing data file"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_SUCH_FILE_OR_DIR
,
0
,
0x0507
,
"Missing data file"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_OUT_OF_MEMORY
,
0
,
0x0508
,
"Out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_OUT_OF_MEMORY
,
0
,
0x0508
,
"Out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_APP_ERROR
,
0
,
0x0509
,
"Unexpected generic error in vnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_APP_ERROR
,
0
,
0x0509
,
"Unexpected generic error in vnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_INVALID_STATUS
,
0
,
0x0510
,
"
Database not ready
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_INVALID_STATUS
,
0
,
0x0510
,
"
Invalid Vgroup status
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NOT_SYNCED
,
0
,
0x0511
,
"Database suspended"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NOT_SYNCED
,
0
,
0x0511
,
"Database suspended"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_WRITE_AUTH
,
0
,
0x0512
,
"Write operation denied"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_WRITE_AUTH
,
0
,
0x0512
,
"Write operation denied"
)
...
...
src/mnode/src/mnodeUser.c
浏览文件 @
7782318d
...
@@ -581,8 +581,8 @@ void mnodeDropAllUsers(SAcctObj *pAcct) {
...
@@ -581,8 +581,8 @@ void mnodeDropAllUsers(SAcctObj *pAcct) {
int32_t
mnodeRetriveAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
int32_t
mnodeRetriveAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
if
(
!
sdbIsMaster
())
{
if
(
!
sdbIsMaster
())
{
*
secret
=
0
;
*
secret
=
0
;
mDebug
(
"user:%s, failed to auth user, reason:%s"
,
user
,
tstrerror
(
TSDB_CODE_
RPC
_NOT_READY
));
mDebug
(
"user:%s, failed to auth user, reason:%s"
,
user
,
tstrerror
(
TSDB_CODE_
APP
_NOT_READY
));
return
TSDB_CODE_
RPC
_NOT_READY
;
return
TSDB_CODE_
APP
_NOT_READY
;
}
}
SUserObj
*
pUser
=
mnodeGetUser
(
user
);
SUserObj
*
pUser
=
mnodeGetUser
(
user
);
...
...
src/rpc/src/rpcMain.c
浏览文件 @
7782318d
...
@@ -1120,7 +1120,7 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
...
@@ -1120,7 +1120,7 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
pContext
->
epSet
.
port
[
i
]
=
htons
(
pContext
->
epSet
.
port
[
i
]);
pContext
->
epSet
.
port
[
i
]
=
htons
(
pContext
->
epSet
.
port
[
i
]);
rpcSendReqToServer
(
pRpc
,
pContext
);
rpcSendReqToServer
(
pRpc
,
pContext
);
rpcFreeCont
(
rpcMsg
.
pCont
);
rpcFreeCont
(
rpcMsg
.
pCont
);
}
else
if
(
pHead
->
code
==
TSDB_CODE_RPC_NOT_READY
)
{
}
else
if
(
pHead
->
code
==
TSDB_CODE_RPC_NOT_READY
||
pHead
->
code
==
TSDB_CODE_APP_NOT_READY
)
{
pContext
->
code
=
pHead
->
code
;
pContext
->
code
=
pHead
->
code
;
rpcProcessConnError
(
pContext
,
NULL
);
rpcProcessConnError
(
pContext
,
NULL
);
rpcFreeCont
(
rpcMsg
.
pCont
);
rpcFreeCont
(
rpcMsg
.
pCont
);
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
7782318d
...
@@ -390,7 +390,7 @@ void *vnodeAcquireRqueue(int32_t vgId) {
...
@@ -390,7 +390,7 @@ void *vnodeAcquireRqueue(int32_t 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
)
{
terrno
=
TSDB_CODE_
VND_INVALID_STATUS
;
terrno
=
TSDB_CODE_
APP_NOT_READY
;
vInfo
(
"vgId:%d, status is in reset"
,
vgId
);
vInfo
(
"vgId:%d, status is in reset"
,
vgId
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
return
NULL
;
return
NULL
;
...
@@ -404,7 +404,7 @@ void *vnodeAcquireWqueue(int32_t vgId) {
...
@@ -404,7 +404,7 @@ void *vnodeAcquireWqueue(int32_t 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
)
{
terrno
=
TSDB_CODE_
VND_INVALID_STATUS
;
terrno
=
TSDB_CODE_
APP_NOT_READY
;
vInfo
(
"vgId:%d, status is in reset"
,
vgId
);
vInfo
(
"vgId:%d, status is in reset"
,
vgId
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
return
NULL
;
return
NULL
;
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
7782318d
...
@@ -49,18 +49,18 @@ int32_t vnodeProcessRead(void *param, SReadMsg *pReadMsg) {
...
@@ -49,18 +49,18 @@ int32_t vnodeProcessRead(void *param, SReadMsg *pReadMsg) {
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
{
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_STATUS
;
return
TSDB_CODE_
APP_NOT_READY
;
}
}
// tsdb may be in reset state
// tsdb may be in reset state
if
(
pVnode
->
tsdb
==
NULL
)
return
TSDB_CODE_
RPC
_NOT_READY
;
if
(
pVnode
->
tsdb
==
NULL
)
return
TSDB_CODE_
APP
_NOT_READY
;
if
(
pVnode
->
status
==
TAOS_VN_STATUS_CLOSING
)
if
(
pVnode
->
status
==
TAOS_VN_STATUS_CLOSING
)
return
TSDB_CODE_
RPC
_NOT_READY
;
return
TSDB_CODE_
APP
_NOT_READY
;
// TODO: Later, let slave to support query
// TODO: Later, let slave to support query
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
{
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
{
vDebug
(
"vgId:%d, msgType:%s not processed, replica:%d role:%d"
,
pVnode
->
vgId
,
taosMsg
[
msgType
],
pVnode
->
syncCfg
.
replica
,
pVnode
->
role
);
vDebug
(
"vgId:%d, msgType:%s not processed, replica:%d role:%d"
,
pVnode
->
vgId
,
taosMsg
[
msgType
],
pVnode
->
syncCfg
.
replica
,
pVnode
->
role
);
return
TSDB_CODE_
RPC
_NOT_READY
;
return
TSDB_CODE_
APP
_NOT_READY
;
}
}
return
(
*
vnodeProcessReadMsgFp
[
msgType
])(
pVnode
,
pReadMsg
);
return
(
*
vnodeProcessReadMsgFp
[
msgType
])(
pVnode
,
pReadMsg
);
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
7782318d
...
@@ -60,19 +60,19 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
...
@@ -60,19 +60,19 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
}
}
// tsdb may be in reset state
// tsdb may be in reset state
if
(
pVnode
->
tsdb
==
NULL
)
return
TSDB_CODE_
RPC
_NOT_READY
;
if
(
pVnode
->
tsdb
==
NULL
)
return
TSDB_CODE_
APP
_NOT_READY
;
if
(
pVnode
->
status
==
TAOS_VN_STATUS_CLOSING
)
if
(
pVnode
->
status
==
TAOS_VN_STATUS_CLOSING
)
return
TSDB_CODE_
RPC
_NOT_READY
;
return
TSDB_CODE_
APP
_NOT_READY
;
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
)
{
vDebug
(
"vgId:%d, msgType:%s not processed, vnode status is %d"
,
pVnode
->
vgId
,
taosMsg
[
pHead
->
msgType
],
pVnode
->
status
);
vDebug
(
"vgId:%d, msgType:%s not processed, vnode status is %d"
,
pVnode
->
vgId
,
taosMsg
[
pHead
->
msgType
],
pVnode
->
status
);
return
TSDB_CODE_
VND_INVALID_STATUS
;
// it may be in deleting or closing state
return
TSDB_CODE_
APP_NOT_READY
;
// it may be in deleting or closing state
}
}
if
(
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
{
if
(
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
{
vDebug
(
"vgId:%d, msgType:%s not processed, replica:%d role:%d"
,
pVnode
->
vgId
,
taosMsg
[
pHead
->
msgType
],
pVnode
->
syncCfg
.
replica
,
pVnode
->
role
);
vDebug
(
"vgId:%d, msgType:%s not processed, replica:%d role:%d"
,
pVnode
->
vgId
,
taosMsg
[
pHead
->
msgType
],
pVnode
->
syncCfg
.
replica
,
pVnode
->
role
);
return
TSDB_CODE_
RPC
_NOT_READY
;
return
TSDB_CODE_
APP
_NOT_READY
;
}
}
// assign version
// assign version
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录