fix(query): return TSDB_CODE_RPC_VGROUP_NOT_CONNECTED if all nodes in vgroups is offline
This commit is contained in:
parent
13bee02129
commit
02dbf35354
|
@ -65,6 +65,7 @@ int32_t* taosGetErrno();
|
|||
#define TSDB_CODE_RPC_PORT_EADDRINUSE TAOS_DEF_ERROR_CODE(0, 0x0017) //
|
||||
#define TSDB_CODE_RPC_BROKEN_LINK TAOS_DEF_ERROR_CODE(0, 0x0018) //
|
||||
#define TSDB_CODE_RPC_TIMEOUT TAOS_DEF_ERROR_CODE(0, 0x0019) //
|
||||
#define TSDB_CODE_RPC_VGROUP_NOT_CONNECTED TAOS_DEF_ERROR_CODE(0, 0x0020) // "Vgroup could not be connected"
|
||||
|
||||
//common & util
|
||||
#define TSDB_CODE_OPS_NOT_SUPPORT TAOS_DEF_ERROR_CODE(0, 0x0100) //
|
||||
|
|
|
@ -1670,6 +1670,15 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
|
|||
}
|
||||
}
|
||||
|
||||
// check whole vnodes is offline on this vgroup
|
||||
if (pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL || pResp->code == TSDB_CODE_RPC_BROKEN_LINK) {
|
||||
if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps || pCtx->retryStep > 0) {
|
||||
if (pMsg->msg.msgType == TDMT_VND_SUBMIT || pMsg->msg.msgType == TDMT_SCH_QUERY) {
|
||||
pResp->code = TSDB_CODE_RPC_VGROUP_NOT_CONNECTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
STraceId* trace = &pResp->info.traceId;
|
||||
bool hasEpSet = cliTryExtractEpSet(pResp, &pCtx->epSet);
|
||||
if (hasEpSet) {
|
||||
|
|
|
@ -51,6 +51,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RPC_FQDN_ERROR, "Unable to resolve FQD
|
|||
TAOS_DEFINE_ERROR(TSDB_CODE_RPC_PORT_EADDRINUSE, "Port already in use")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_RPC_BROKEN_LINK, "Conn is broken")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_RPC_TIMEOUT, "Conn read timeout")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_RPC_VGROUP_NOT_CONNECTED, "Vgroup could not be connected")
|
||||
|
||||
//common & util
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_TIME_UNSYNCED, "Client and server's time is not synchronized")
|
||||
|
|
Loading…
Reference in New Issue