提交 c270cea5 编写于 作者: A Alex Duan

fix(rpc): if all vnode in one group can not connect, return TSDB_CODE_RPC_VGROUP_NOT_REACHED

上级 9933c110
......@@ -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_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_VGROUP_NOT_REACHED TAOS_DEF_ERROR_CODE(0, 0x0018) //"Vgroup could not be reached"
//common & util
#define TSDB_CODE_COM_OPS_NOT_SUPPORT TAOS_DEF_ERROR_CODE(0, 0x0100) //"Operation not supported"
......
......@@ -1515,6 +1515,10 @@ static void rpcProcessConnError(void *param, void *id) {
rpcMsg.pCont = NULL;
rpcMsg.contLen = 0;
if( pContext->numOfTry >= pContext->epSet.numOfEps && rpcMsg.code == TSDB_CODE_RPC_NETWORK_UNAVAIL) {
rpcMsg.code = TSDB_CODE_RPC_VGROUP_NOT_REACHED;
}
tWarn("%s %p, connection error. notify client query over. numOfTry=%d msgType=%d", pRpc->label, pContext->ahandle, pContext->numOfTry, pContext->msgType);
rpcNotifyClient(pContext, &rpcMsg);
} else {
......
......@@ -126,6 +126,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSC_INVALID_PRECISION_TYPE, "Invalid timestamp pre
TAOS_DEFINE_ERROR(TSDB_CODE_TSC_RES_TOO_MANY, "Result set too large to be output")
TAOS_DEFINE_ERROR(TSDB_CODE_TSC_TOO_MANY_SML_LINES, "Too many lines in batch")
TAOS_DEFINE_ERROR(TSDB_CODE_TSC_SEND_DATA_FAILED, "Client send request data failed")
TAOS_DEFINE_ERROR(TSDB_CODE_TSC_VGROUP_NOT_REACHED, "Vgroup could not be reached")
// mnode
TAOS_DEFINE_ERROR(TSDB_CODE_MND_MSG_NOT_PROCESSED, "Message not processed")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册