Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9ab7c1c1
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
9ab7c1c1
编写于
12月 14, 2022
作者:
D
dapan1121
提交者:
GitHub
12月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18935 from taosdata/fix/TS-2260-2.6
fix(rpc): if all vnode in one group can not connect, return TSDB_CODE…
上级
9933c110
7e2b8350
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
17 addition
and
5 deletion
+17
-5
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+2
-2
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+2
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-0
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-0
src/inc/taoserror.h
src/inc/taoserror.h
+1
-0
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+6
-0
src/util/src/terror.c
src/util/src/terror.c
+1
-0
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+3
-2
未找到文件。
src/client/src/tscLocal.c
浏览文件 @
9ab7c1c1
...
@@ -910,7 +910,7 @@ static int32_t tscProcessServStatus(SSqlObj *pSql) {
...
@@ -910,7 +910,7 @@ static int32_t tscProcessServStatus(SSqlObj *pSql) {
pSql
->
res
.
code
=
pHb
->
res
.
code
;
pSql
->
res
.
code
=
pHb
->
res
.
code
;
}
}
if
(
pSql
->
res
.
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
if
(
pSql
->
res
.
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
pSql
->
res
.
code
==
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
)
{
taosReleaseRef
(
tscObjRef
,
pObj
->
hbrid
);
taosReleaseRef
(
tscObjRef
,
pObj
->
hbrid
);
return
pSql
->
res
.
code
;
return
pSql
->
res
.
code
;
}
}
...
@@ -920,7 +920,7 @@ static int32_t tscProcessServStatus(SSqlObj *pSql) {
...
@@ -920,7 +920,7 @@ static int32_t tscProcessServStatus(SSqlObj *pSql) {
taosReleaseRef
(
tscObjRef
,
pObj
->
hbrid
);
taosReleaseRef
(
tscObjRef
,
pObj
->
hbrid
);
}
}
if
(
pSql
->
res
.
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
if
(
pSql
->
res
.
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
pSql
->
res
.
code
==
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
)
{
return
pSql
->
res
.
code
;
return
pSql
->
res
.
code
;
}
}
...
...
src/client/src/tscParseLineProtocol.c
浏览文件 @
9ab7c1c1
...
@@ -974,6 +974,7 @@ static void insertCallback(void *param, TAOS_RES *res, int32_t notUsedCode) {
...
@@ -974,6 +974,7 @@ static void insertCallback(void *param, TAOS_RES *res, int32_t notUsedCode) {
||
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
||
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
||
code
==
TSDB_CODE_TDB_TABLE_RECONFIGURE
||
code
==
TSDB_CODE_TDB_TABLE_RECONFIGURE
||
code
==
TSDB_CODE_APP_NOT_READY
||
code
==
TSDB_CODE_APP_NOT_READY
||
code
==
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
||
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
&&
batch
->
tryTimes
<
TSDB_MAX_REPLICA
)
{
||
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
&&
batch
->
tryTimes
<
TSDB_MAX_REPLICA
)
{
batch
->
tryAgain
=
true
;
batch
->
tryAgain
=
true
;
}
}
...
@@ -985,7 +986,7 @@ static void insertCallback(void *param, TAOS_RES *res, int32_t notUsedCode) {
...
@@ -985,7 +986,7 @@ static void insertCallback(void *param, TAOS_RES *res, int32_t notUsedCode) {
}
}
}
}
if
(
code
==
TSDB_CODE_APP_NOT_READY
||
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
if
(
code
==
TSDB_CODE_APP_NOT_READY
||
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
code
==
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
)
{
if
(
batch
->
tryAgain
)
{
if
(
batch
->
tryAgain
)
{
batch
->
sleep
=
true
;
batch
->
sleep
=
true
;
}
}
...
...
src/client/src/tscServer.c
浏览文件 @
9ab7c1c1
...
@@ -509,6 +509,7 @@ bool shouldRewTableMeta(SSqlObj* pSql, SRpcMsg* rpcMsg) {
...
@@ -509,6 +509,7 @@ bool shouldRewTableMeta(SSqlObj* pSql, SRpcMsg* rpcMsg) {
rpcMsg
->
code
!=
TSDB_CODE_VND_INVALID_VGROUP_ID
&&
rpcMsg
->
code
!=
TSDB_CODE_VND_INVALID_VGROUP_ID
&&
rpcMsg
->
code
!=
TSDB_CODE_QRY_INVALID_SCHEMA_VERSION
&&
rpcMsg
->
code
!=
TSDB_CODE_QRY_INVALID_SCHEMA_VERSION
&&
rpcMsg
->
code
!=
TSDB_CODE_RPC_NETWORK_UNAVAIL
&&
rpcMsg
->
code
!=
TSDB_CODE_RPC_NETWORK_UNAVAIL
&&
rpcMsg
->
code
!=
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
&&
rpcMsg
->
code
!=
TSDB_CODE_APP_NOT_READY
)
{
rpcMsg
->
code
!=
TSDB_CODE_APP_NOT_READY
)
{
return
false
;
return
false
;
}
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
9ab7c1c1
...
@@ -3462,6 +3462,7 @@ static bool needRetryInsert(SSqlObj* pParentObj) {
...
@@ -3462,6 +3462,7 @@ static bool needRetryInsert(SSqlObj* pParentObj) {
if
(
code
!=
TSDB_CODE_TDB_TABLE_RECONFIGURE
&&
code
!=
TSDB_CODE_TDB_INVALID_TABLE_ID
&&
if
(
code
!=
TSDB_CODE_TDB_TABLE_RECONFIGURE
&&
code
!=
TSDB_CODE_TDB_INVALID_TABLE_ID
&&
code
!=
TSDB_CODE_VND_INVALID_VGROUP_ID
&&
code
!=
TSDB_CODE_RPC_NETWORK_UNAVAIL
&&
code
!=
TSDB_CODE_VND_INVALID_VGROUP_ID
&&
code
!=
TSDB_CODE_RPC_NETWORK_UNAVAIL
&&
code
!=
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
&&
code
!=
TSDB_CODE_APP_NOT_READY
)
{
code
!=
TSDB_CODE_APP_NOT_READY
)
{
pParentObj
->
res
.
code
=
code
;
pParentObj
->
res
.
code
=
code
;
ret
=
false
;
ret
=
false
;
...
...
src/inc/taoserror.h
浏览文件 @
9ab7c1c1
...
@@ -61,6 +61,7 @@ int32_t* taosGetErrno();
...
@@ -61,6 +61,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_RPC_FQDN_ERROR TAOS_DEF_ERROR_CODE(0, 0x0015) //"Unable to resolve FQDN"
#define TSDB_CODE_RPC_FQDN_ERROR TAOS_DEF_ERROR_CODE(0, 0x0015) //"Unable to resolve FQDN"
#define TSDB_CODE_RPC_INVALID_VERSION TAOS_DEF_ERROR_CODE(0, 0x0016) //"Invalid app version"
#define TSDB_CODE_RPC_INVALID_VERSION TAOS_DEF_ERROR_CODE(0, 0x0016) //"Invalid app version"
#define TSDB_CODE_RPC_SHORTCUT TAOS_DEF_ERROR_CODE(0, 0x0017) //"Shortcut"
#define TSDB_CODE_RPC_SHORTCUT TAOS_DEF_ERROR_CODE(0, 0x0017) //"Shortcut"
#define TSDB_CODE_RPC_VGROUP_NOT_CONNECTED TAOS_DEF_ERROR_CODE(0, 0x0018) //"Vgroup could not be connected"
//common & util
//common & util
#define TSDB_CODE_COM_OPS_NOT_SUPPORT TAOS_DEF_ERROR_CODE(0, 0x0100) //"Operation not supported"
#define TSDB_CODE_COM_OPS_NOT_SUPPORT TAOS_DEF_ERROR_CODE(0, 0x0100) //"Operation not supported"
...
...
src/rpc/src/rpcMain.c
浏览文件 @
9ab7c1c1
...
@@ -1515,6 +1515,12 @@ static void rpcProcessConnError(void *param, void *id) {
...
@@ -1515,6 +1515,12 @@ static void rpcProcessConnError(void *param, void *id) {
rpcMsg
.
pCont
=
NULL
;
rpcMsg
.
pCont
=
NULL
;
rpcMsg
.
contLen
=
0
;
rpcMsg
.
contLen
=
0
;
if
(
pContext
->
numOfTry
>=
pContext
->
epSet
.
numOfEps
&&
rpcMsg
.
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
if
(
pContext
->
msgType
==
TSDB_MSG_TYPE_SUBMIT
||
pContext
->
msgType
==
TSDB_MSG_TYPE_QUERY
)
{
rpcMsg
.
code
=
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
;
}
}
tWarn
(
"%s %p, connection error. notify client query over. numOfTry=%d msgType=%d"
,
pRpc
->
label
,
pContext
->
ahandle
,
pContext
->
numOfTry
,
pContext
->
msgType
);
tWarn
(
"%s %p, connection error. notify client query over. numOfTry=%d msgType=%d"
,
pRpc
->
label
,
pContext
->
ahandle
,
pContext
->
numOfTry
,
pContext
->
msgType
);
rpcNotifyClient
(
pContext
,
&
rpcMsg
);
rpcNotifyClient
(
pContext
,
&
rpcMsg
);
}
else
{
}
else
{
...
...
src/util/src/terror.c
浏览文件 @
9ab7c1c1
...
@@ -69,6 +69,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_APP_NOT_READY, "Database not ready")
...
@@ -69,6 +69,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_APP_NOT_READY, "Database not ready")
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_FQDN_ERROR
,
"Unable to resolve FQDN"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_FQDN_ERROR
,
"Unable to resolve FQDN"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_VERSION
,
"Invalid app version"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_VERSION
,
"Invalid app version"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_SHORTCUT
,
"Shortcut"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_SHORTCUT
,
"Shortcut"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
,
"Vgroup could not be connected"
)
//common & util
//common & util
TAOS_DEFINE_ERROR
(
TSDB_CODE_COM_OPS_NOT_SUPPORT
,
"Operation not supported"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_COM_OPS_NOT_SUPPORT
,
"Operation not supported"
)
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
9ab7c1c1
...
@@ -145,7 +145,8 @@ int32_t vnodeWriteToRQueue(void *vparam, void *pCont, int32_t contLen, int8_t qt
...
@@ -145,7 +145,8 @@ int32_t vnodeWriteToRQueue(void *vparam, void *pCont, int32_t contLen, int8_t qt
atomic_add_fetch_32
(
&
pVnode
->
queuedRMsg
,
1
);
atomic_add_fetch_32
(
&
pVnode
->
queuedRMsg
,
1
);
if
(
pRead
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
pRead
->
msgType
==
TSDB_MSG_TYPE_FETCH
)
{
if
(
pRead
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
pRead
->
code
==
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
||
pRead
->
msgType
==
TSDB_MSG_TYPE_FETCH
)
{
vTrace
(
"vgId:%d, write into vfetch queue, refCount:%d queued:%d"
,
pVnode
->
vgId
,
pVnode
->
refCount
,
vTrace
(
"vgId:%d, write into vfetch queue, refCount:%d queued:%d"
,
pVnode
->
vgId
,
pVnode
->
refCount
,
pVnode
->
queuedRMsg
);
pVnode
->
queuedRMsg
);
return
taosWriteQitem
(
pVnode
->
fqueue
,
qtype
,
pRead
);
return
taosWriteQitem
(
pVnode
->
fqueue
,
qtype
,
pRead
);
...
@@ -229,7 +230,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
...
@@ -229,7 +230,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
memset
(
pRet
,
0
,
sizeof
(
SRspRet
));
memset
(
pRet
,
0
,
sizeof
(
SRspRet
));
// qHandle needs to be freed correctly
// qHandle needs to be freed correctly
if
(
pRead
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
if
(
pRead
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
pRead
->
code
==
TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
)
{
vError
(
"error rpc msg in query, %s"
,
tstrerror
(
pRead
->
code
));
vError
(
"error rpc msg in query, %s"
,
tstrerror
(
pRead
->
code
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录