提交 2830f322 编写于 作者: H hjxilinx

[tbase-1203]

上级 85bdad28
...@@ -184,6 +184,15 @@ void tscGetConnToMgmt(SSqlObj *pSql, uint8_t *pCode) { ...@@ -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) {
...@@ -443,6 +452,9 @@ void *tscProcessMsgFromServer(char *msg, void *ahandle, void *thandle) { ...@@ -443,6 +452,9 @@ void *tscProcessMsgFromServer(char *msg, void *ahandle, void *thandle) {
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);
} else { } else {
......
...@@ -245,9 +245,9 @@ int taos_query_imp(STscObj* pObj, SSqlObj* pSql) { ...@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册