Merge pull request #2988 from taosdata/hotfix/TD-1094
if redirect does not include Ep List, treat it as NOT_READY
This commit is contained in:
commit
0e89d9e641
|
@ -322,6 +322,8 @@ void *rpcMallocCont(int contLen) {
|
|||
if (start == NULL) {
|
||||
tError("failed to malloc msg, size:%d", size);
|
||||
return NULL;
|
||||
} else {
|
||||
tDebug("malloc mem: %p", start);
|
||||
}
|
||||
|
||||
return start + sizeof(SRpcReqContext) + sizeof(SRpcHead);
|
||||
|
@ -331,7 +333,7 @@ void rpcFreeCont(void *cont) {
|
|||
if ( cont ) {
|
||||
char *temp = ((char *)cont) - sizeof(SRpcHead) - sizeof(SRpcReqContext);
|
||||
free(temp);
|
||||
// tTrace("free mem: %p", temp);
|
||||
tDebug("free mem: %p", temp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -551,7 +553,7 @@ static void rpcFreeMsg(void *msg) {
|
|||
if ( msg ) {
|
||||
char *temp = (char *)msg - sizeof(SRpcReqContext);
|
||||
free(temp);
|
||||
// tTrace("free mem: %p", temp);
|
||||
tDebug("free mem: %p", temp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1098,10 +1100,15 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
|
|||
}
|
||||
|
||||
if (pHead->code == TSDB_CODE_RPC_REDIRECT) {
|
||||
pContext->redirect++;
|
||||
if (pContext->redirect > TSDB_MAX_REPLICA) {
|
||||
pHead->code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
|
||||
tWarn("%s, too many redirects, quit", pConn->info);
|
||||
if (rpcMsg.contLen < sizeof(SRpcEpSet)) {
|
||||
// if EpSet is not included in the msg, treat it as NOT_READY
|
||||
pHead->code = TSDB_CODE_RPC_NOT_READY;
|
||||
} else {
|
||||
pContext->redirect++;
|
||||
if (pContext->redirect > TSDB_MAX_REPLICA) {
|
||||
pHead->code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
|
||||
tWarn("%s, too many redirects, quit", pConn->info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue