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

fix(rpc): check TSDB_CODE_RPC_VGROUP_NOT_CONNECTED like TSDB_CODE_RPC_NETWORK_UNAVAIL condition

上级 4801003d
......@@ -910,7 +910,7 @@ static int32_t tscProcessServStatus(SSqlObj *pSql) {
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);
return pSql->res.code;
}
......@@ -920,7 +920,7 @@ static int32_t tscProcessServStatus(SSqlObj *pSql) {
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;
}
......
......@@ -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_TDB_TABLE_RECONFIGURE
|| code == TSDB_CODE_APP_NOT_READY
|| code == TSDB_CODE_RPC_VGROUP_NOT_CONNECTED
|| code == TSDB_CODE_RPC_NETWORK_UNAVAIL) && batch->tryTimes < TSDB_MAX_REPLICA) {
batch->tryAgain = true;
}
......@@ -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) {
batch->sleep = true;
}
......
......@@ -509,6 +509,7 @@ bool shouldRewTableMeta(SSqlObj* pSql, SRpcMsg* rpcMsg) {
rpcMsg->code != TSDB_CODE_VND_INVALID_VGROUP_ID &&
rpcMsg->code != TSDB_CODE_QRY_INVALID_SCHEMA_VERSION &&
rpcMsg->code != TSDB_CODE_RPC_NETWORK_UNAVAIL &&
rpcMsg->code != TSDB_CODE_RPC_VGROUP_NOT_CONNECTED &&
rpcMsg->code != TSDB_CODE_APP_NOT_READY ) {
return false;
}
......
......@@ -3462,6 +3462,7 @@ static bool needRetryInsert(SSqlObj* pParentObj) {
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_RPC_VGROUP_NOT_CONNECTED &&
code != TSDB_CODE_APP_NOT_READY) {
pParentObj->res.code = code;
ret = false;
......
......@@ -61,7 +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"
#define TSDB_CODE_RPC_VGROUP_NOT_CONNECTED TAOS_DEF_ERROR_CODE(0, 0x0018) //"Vgroup could not be connected"
//common & util
#define TSDB_CODE_COM_OPS_NOT_SUPPORT TAOS_DEF_ERROR_CODE(0, 0x0100) //"Operation not supported"
......
......@@ -1517,7 +1517,7 @@ static void rpcProcessConnError(void *param, void *id) {
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_REACHED;
rpcMsg.code = TSDB_CODE_RPC_VGROUP_NOT_CONNECTED;
}
}
......
......@@ -69,7 +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_INVALID_VERSION, "Invalid app version")
TAOS_DEFINE_ERROR(TSDB_CODE_RPC_SHORTCUT, "Shortcut")
TAOS_DEFINE_ERROR(TSDB_CODE_RPC_VGROUP_NOT_REACHED, "Vgroup could not be reached")
TAOS_DEFINE_ERROR(TSDB_CODE_RPC_VGROUP_NOT_CONNECTED, "Vgroup could not be connected")
//common & util
TAOS_DEFINE_ERROR(TSDB_CODE_COM_OPS_NOT_SUPPORT, "Operation not supported")
......
......@@ -145,7 +145,8 @@ int32_t vnodeWriteToRQueue(void *vparam, void *pCont, int32_t contLen, int8_t qt
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->msgType == 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,
pVnode->queuedRMsg);
return taosWriteQitem(pVnode->fqueue, qtype, pRead);
......@@ -229,7 +230,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
memset(pRet, 0, sizeof(SRspRet));
// 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));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册