[TD-890] while create table failed, it should not renew mtea, update by hjl
This commit is contained in:
parent
412abce6ea
commit
84e3b0732a
|
@ -246,43 +246,52 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
|
||||||
rpcMsg->code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
|
rpcMsg->code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
|
||||||
} else {
|
} else {
|
||||||
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0);
|
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0);
|
||||||
if (rpcMsg->code == TSDB_CODE_TDB_INVALID_TABLE_ID || rpcMsg->code == TSDB_CODE_VND_INVALID_VGROUP_ID ||
|
if (rpcMsg->code != TSDB_CODE_SUCCESS) {
|
||||||
rpcMsg->code == TSDB_CODE_RPC_NETWORK_UNAVAIL || rpcMsg->code == TSDB_CODE_TDB_TABLE_RECONFIGURE) {
|
|
||||||
if (pCmd->command == TSDB_SQL_CONNECT) {
|
if (pCmd->command == TSDB_SQL_CONNECT) {
|
||||||
rpcMsg->code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
|
rpcMsg->code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
|
||||||
rpcFreeCont(rpcMsg->pCont);
|
rpcFreeCont(rpcMsg->pCont);
|
||||||
return;
|
return;
|
||||||
} else if (pCmd->command == TSDB_SQL_HB) {
|
}
|
||||||
|
|
||||||
|
if (pCmd->command == TSDB_SQL_HB) {
|
||||||
rpcMsg->code = TSDB_CODE_RPC_NOT_READY;
|
rpcMsg->code = TSDB_CODE_RPC_NOT_READY;
|
||||||
rpcFreeCont(rpcMsg->pCont);
|
rpcFreeCont(rpcMsg->pCont);
|
||||||
return;
|
return;
|
||||||
} else if (pCmd->command == TSDB_SQL_META) {
|
}
|
||||||
// get table meta query will not retry, do nothing
|
|
||||||
|
if (pCmd->command == TSDB_SQL_META || pCmd->command == TSDB_SQL_DESCRIBE_TABLE ||
|
||||||
|
pCmd->command == TSDB_SQL_STABLEVGROUP || pCmd->command == TSDB_SQL_SHOW ||
|
||||||
|
pCmd->command == TSDB_SQL_RETRIEVE) {
|
||||||
|
// get table meta/vgroup query will not retry, do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pCmd->command == TSDB_SQL_SELECT || pCmd->command == TSDB_SQL_FETCH || pCmd->command == TSDB_SQL_INSERT ||
|
||||||
|
pCmd->command == TSDB_SQL_UPDATE_TAGS_VAL) &&
|
||||||
|
(rpcMsg->code == TSDB_CODE_TDB_INVALID_TABLE_ID || rpcMsg->code == TSDB_CODE_VND_INVALID_VGROUP_ID ||
|
||||||
|
rpcMsg->code == TSDB_CODE_RPC_NETWORK_UNAVAIL || rpcMsg->code == TSDB_CODE_TDB_TABLE_RECONFIGURE)) {
|
||||||
|
tscWarn("%p it shall renew table meta, code:%s, retry:%d", pSql, tstrerror(rpcMsg->code), ++pSql->retry);
|
||||||
|
// set the flag to denote that sql string needs to be re-parsed and build submit block with table schema
|
||||||
|
if (rpcMsg->code == TSDB_CODE_TDB_TABLE_RECONFIGURE) {
|
||||||
|
pSql->cmd.submitSchema = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pSql->res.code = rpcMsg->code; // keep the previous error code
|
||||||
|
if (pSql->retry > pSql->maxRetry) {
|
||||||
|
tscError("%p max retry %d reached, give up", pSql, pSql->maxRetry);
|
||||||
} else {
|
} else {
|
||||||
tscWarn("%p it shall renew table meta, code:%s, retry:%d", pSql, tstrerror(rpcMsg->code), ++pSql->retry);
|
rpcMsg->code = tscRenewTableMeta(pSql, pTableMetaInfo->name);
|
||||||
|
|
||||||
// set the flag to denote that sql string needs to be re-parsed and build submit block with table schema
|
// if there is an error occurring, proceed to the following error handling procedure.
|
||||||
if (rpcMsg->code == TSDB_CODE_TDB_TABLE_RECONFIGURE) {
|
// todo add test cases
|
||||||
pSql->cmd.submitSchema = 1;
|
if (rpcMsg->code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) {
|
||||||
}
|
rpcFreeCont(rpcMsg->pCont);
|
||||||
|
return;
|
||||||
pSql->res.code = rpcMsg->code; // keep the previous error code
|
|
||||||
if (pSql->retry > pSql->maxRetry) {
|
|
||||||
tscError("%p max retry %d reached, give up", pSql, pSql->maxRetry);
|
|
||||||
} else {
|
|
||||||
rpcMsg->code = tscRenewTableMeta(pSql, pTableMetaInfo->name);
|
|
||||||
|
|
||||||
// if there is an error occurring, proceed to the following error handling procedure.
|
|
||||||
// todo add test cases
|
|
||||||
if (rpcMsg->code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) {
|
|
||||||
rpcFreeCont(rpcMsg->pCont);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pRes->rspLen = 0;
|
pRes->rspLen = 0;
|
||||||
|
|
||||||
if (pRes->code != TSDB_CODE_TSC_QUERY_CANCELLED) {
|
if (pRes->code != TSDB_CODE_TSC_QUERY_CANCELLED) {
|
||||||
|
|
Loading…
Reference in New Issue