[tbase-1203]
This commit is contained in:
parent
85bdad282b
commit
2830f322d4
|
@ -184,6 +184,15 @@ void tscGetConnToMgmt(SSqlObj *pSql, uint8_t *pCode) {
|
||||||
pSql->vnode = TSC_MGMT_VNODE;
|
pSql->vnode = TSC_MGMT_VNODE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the pSql->res.code is the previous error(status) code.
|
||||||
|
if (pSql->thandle == NULL && pSql->retry >= pSql->maxRetry) {
|
||||||
|
if (pSql->res.code != TSDB_CODE_SUCCESS && pSql->res.code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||||
|
*pCode = pSql->res.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
tscError("%p reach the max retry:%d, code:%d", pSql, pSql->retry, *pCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) {
|
void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) {
|
||||||
|
@ -442,6 +451,9 @@ void *tscProcessMsgFromServer(char *msg, void *ahandle, void *thandle) {
|
||||||
tscTrace("%p it shall be redirected!", pSql);
|
tscTrace("%p it shall be redirected!", pSql);
|
||||||
taosAddConnIntoCache(tscConnCache, thandle, pSql->ip, pSql->vnode, pObj->user);
|
taosAddConnIntoCache(tscConnCache, thandle, pSql->ip, pSql->vnode, pObj->user);
|
||||||
pSql->thandle = NULL;
|
pSql->thandle = NULL;
|
||||||
|
|
||||||
|
// reset the retry times for a new mgmt node
|
||||||
|
pSql->retry = 0;
|
||||||
|
|
||||||
if (pCmd->command > TSDB_SQL_MGMT) {
|
if (pCmd->command > TSDB_SQL_MGMT) {
|
||||||
tscProcessMgmtRedirect(pSql, pMsg->content + 1);
|
tscProcessMgmtRedirect(pSql, pMsg->content + 1);
|
||||||
|
|
|
@ -245,9 +245,9 @@ int taos_query_imp(STscObj* pObj, SSqlObj* pSql) {
|
||||||
pRes->qhandle = 0;
|
pRes->qhandle = 0;
|
||||||
pSql->thandle = NULL;
|
pSql->thandle = NULL;
|
||||||
|
|
||||||
if (pRes->code != TSDB_CODE_SUCCESS) return pRes->code;
|
if (pRes->code == TSDB_CODE_SUCCESS) {
|
||||||
|
tscDoQuery(pSql);
|
||||||
tscDoQuery(pSql);
|
}
|
||||||
|
|
||||||
tscTrace("%p SQL result:%d, %s pObj:%p", pSql, pRes->code, taos_errstr(pObj), pObj);
|
tscTrace("%p SQL result:%d, %s pObj:%p", pSql, pRes->code, taos_errstr(pObj), pObj);
|
||||||
if (pRes->code != TSDB_CODE_SUCCESS) {
|
if (pRes->code != TSDB_CODE_SUCCESS) {
|
||||||
|
|
Loading…
Reference in New Issue