[td-98] add retry counting
This commit is contained in:
parent
44620e056c
commit
54f28dc5f3
|
@ -266,10 +266,14 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg) {
|
||||||
rpcFreeCont(rpcMsg->pCont);
|
rpcFreeCont(rpcMsg->pCont);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
tscTrace("%p it shall renew meter meta, code:%d", pSql, tstrerror(rpcMsg->code));
|
tscTrace("%p it shall renew table meta, code:%d", pSql, tstrerror(rpcMsg->code));
|
||||||
|
|
||||||
pSql->maxRetry = TSDB_VNODES_SUPPORT * 2;
|
pSql->maxRetry = TSDB_VNODES_SUPPORT * 2;
|
||||||
pSql->res.code = rpcMsg->code; // keep the previous error code
|
pSql->res.code = rpcMsg->code; // keep the previous error code
|
||||||
|
if (++pSql->retry > pSql->maxRetry) {
|
||||||
|
tscError("%p max retry %d reached, ", pSql, pSql->retry);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rpcMsg->code = tscRenewMeterMeta(pSql, pTableMetaInfo->name);
|
rpcMsg->code = tscRenewMeterMeta(pSql, pTableMetaInfo->name);
|
||||||
|
|
||||||
|
@ -2449,7 +2453,7 @@ static void tscWaitingForCreateTable(SSqlCmd *pCmd) {
|
||||||
int tscRenewMeterMeta(SSqlObj *pSql, char *tableId) {
|
int tscRenewMeterMeta(SSqlObj *pSql, char *tableId) {
|
||||||
int code = 0;
|
int code = 0;
|
||||||
|
|
||||||
// handle metric meta renew process
|
// handle table meta renew process
|
||||||
SSqlCmd *pCmd = &pSql->cmd;
|
SSqlCmd *pCmd = &pSql->cmd;
|
||||||
|
|
||||||
SQueryInfo * pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
|
SQueryInfo * pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
|
||||||
|
|
|
@ -1096,6 +1096,10 @@ static void rpcProcessConnError(void *param, void *id) {
|
||||||
SRpcInfo *pRpc = pContext->pRpc;
|
SRpcInfo *pRpc = pContext->pRpc;
|
||||||
SRpcMsg rpcMsg;
|
SRpcMsg rpcMsg;
|
||||||
|
|
||||||
|
if (pRpc == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tTrace("%s connection error happens", pRpc->label);
|
tTrace("%s connection error happens", pRpc->label);
|
||||||
|
|
||||||
if ( pContext->numOfTry >= pContext->ipSet.numOfIps ) {
|
if ( pContext->numOfTry >= pContext->ipSet.numOfIps ) {
|
||||||
|
|
Loading…
Reference in New Issue