change paramter
This commit is contained in:
parent
f3c1eb829e
commit
f5db4a8b40
|
@ -1416,13 +1416,19 @@ FORCE_INLINE bool cliTryExtractEpSet(STransMsg* pResp, SEpSet* dst) {
|
||||||
bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) {
|
bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) {
|
||||||
bool noDelay = true;
|
bool noDelay = true;
|
||||||
if (hasEpSet == false) {
|
if (hasEpSet == false) {
|
||||||
assert(pResp->contLen == 0);
|
// assert(pResp->contLen == 0);
|
||||||
if (pResp->contLen == 0) {
|
if (pResp->contLen == 0) {
|
||||||
if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) {
|
if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) {
|
||||||
noDelay = false;
|
noDelay = false;
|
||||||
} else {
|
} else {
|
||||||
EPSET_FORWARD_INUSE(&pCtx->epSet);
|
EPSET_FORWARD_INUSE(&pCtx->epSet);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) {
|
||||||
|
noDelay = false;
|
||||||
|
} else {
|
||||||
|
EPSET_FORWARD_INUSE(&pCtx->epSet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SEpSet epSet;
|
SEpSet epSet;
|
||||||
|
@ -1433,17 +1439,19 @@ bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) {
|
||||||
noDelay = false;
|
noDelay = false;
|
||||||
} else {
|
} else {
|
||||||
EPSET_FORWARD_INUSE(&pCtx->epSet);
|
EPSET_FORWARD_INUSE(&pCtx->epSet);
|
||||||
noDelay = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!transEpSetIsEqual(&pCtx->epSet, &epSet)) {
|
if (!transEpSetIsEqual(&pCtx->epSet, &epSet)) {
|
||||||
tDebug("epset not equal, retry new epset");
|
tDebug("epset not equal, retry new epset");
|
||||||
pCtx->epSet = epSet;
|
pCtx->epSet = epSet;
|
||||||
|
} else {
|
||||||
|
if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) {
|
||||||
|
noDelay = false;
|
||||||
} else {
|
} else {
|
||||||
tDebug("epset equal, continue");
|
tDebug("epset equal, continue");
|
||||||
EPSET_FORWARD_INUSE(&pCtx->epSet);
|
EPSET_FORWARD_INUSE(&pCtx->epSet);
|
||||||
}
|
}
|
||||||
noDelay = false;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return noDelay;
|
return noDelay;
|
||||||
|
@ -1459,14 +1467,22 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
|
||||||
if (retry == false) {
|
if (retry == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (pCtx->retryInit) {
|
|
||||||
|
if (!pCtx->retryInit) {
|
||||||
|
pCtx->retryMinInterval = pTransInst->retryMinInterval;
|
||||||
|
pCtx->retryMaxInterval = pTransInst->retryMaxInterval;
|
||||||
|
pCtx->retryStepFactor = pTransInst->retryStepFactor;
|
||||||
|
pCtx->retryMaxTimeout = pTransInst->retryMaxTimouet;
|
||||||
|
pCtx->retryInitTimestamp = taosGetTimestampMs();
|
||||||
|
pCtx->retryNextInterval = pCtx->retryMinInterval;
|
||||||
|
pCtx->retryStep = 1;
|
||||||
|
pCtx->retryInit = true;
|
||||||
|
}
|
||||||
if (-1 != pCtx->retryMaxTimeout && taosGetTimestampMs() - pCtx->retryInitTimestamp >= pCtx->retryMaxTimeout) {
|
if (-1 != pCtx->retryMaxTimeout && taosGetTimestampMs() - pCtx->retryInitTimestamp >= pCtx->retryMaxTimeout) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool noDelay = false;
|
bool noDelay = false;
|
||||||
|
|
||||||
if (code == TSDB_CODE_RPC_BROKEN_LINK || code == TSDB_CODE_RPC_NETWORK_UNAVAIL) {
|
if (code == TSDB_CODE_RPC_BROKEN_LINK || code == TSDB_CODE_RPC_NETWORK_UNAVAIL) {
|
||||||
tDebug("code str %s, contlen:%d 0", tstrerror(code), pResp->contLen);
|
tDebug("code str %s, contlen:%d 0", tstrerror(code), pResp->contLen);
|
||||||
noDelay = cliResetEpset(pCtx, pResp, false);
|
noDelay = cliResetEpset(pCtx, pResp, false);
|
||||||
|
@ -1490,18 +1506,8 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
|
||||||
transFreeMsg(pResp->pCont);
|
transFreeMsg(pResp->pCont);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pCtx->retryInit) {
|
|
||||||
pCtx->retryMinInterval = pTransInst->retryMinInterval;
|
|
||||||
pCtx->retryMaxInterval = pTransInst->retryMaxInterval;
|
|
||||||
pCtx->retryStepFactor = pTransInst->retryStepFactor;
|
|
||||||
pCtx->retryMaxTimeout = pTransInst->retryMaxTimouet;
|
|
||||||
pCtx->retryInitTimestamp = taosGetTimestampMs();
|
|
||||||
pCtx->retryNextInterval = pCtx->retryMinInterval;
|
|
||||||
pCtx->retryStep = 1;
|
|
||||||
pCtx->retryInit = true;
|
|
||||||
} else {
|
|
||||||
if (noDelay == false) {
|
if (noDelay == false) {
|
||||||
pCtx->epsetRetryCnt = 0;
|
pCtx->epsetRetryCnt = 1;
|
||||||
pCtx->retryStep++;
|
pCtx->retryStep++;
|
||||||
|
|
||||||
int64_t factor = pow(pCtx->retryStepFactor, pCtx->retryStep - 1);
|
int64_t factor = pow(pCtx->retryStepFactor, pCtx->retryStep - 1);
|
||||||
|
@ -1517,7 +1523,7 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
|
||||||
pCtx->retryNextInterval = 0;
|
pCtx->retryNextInterval = 0;
|
||||||
pCtx->epsetRetryCnt++;
|
pCtx->epsetRetryCnt++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
pMsg->sent = 0;
|
pMsg->sent = 0;
|
||||||
cliSchedMsgToNextNode(pMsg, pThrd);
|
cliSchedMsgToNextNode(pMsg, pThrd);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue