提交 84e3b073 编写于 作者: S Shengliang Guan

[TD-890] while create table failed, it should not renew mtea, update by hjl

上级 412abce6
...@@ -246,43 +246,52 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) { ...@@ -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
} else {
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 (pCmd->command == TSDB_SQL_META || pCmd->command == TSDB_SQL_DESCRIBE_TABLE ||
if (rpcMsg->code == TSDB_CODE_TDB_TABLE_RECONFIGURE) { pCmd->command == TSDB_SQL_STABLEVGROUP || pCmd->command == TSDB_SQL_SHOW ||
pSql->cmd.submitSchema = 1; pCmd->command == TSDB_SQL_RETRIEVE) {
} // get table meta/vgroup query will not retry, do nothing
}
}
pSql->res.code = rpcMsg->code; // keep the previous error code if ((pCmd->command == TSDB_SQL_SELECT || pCmd->command == TSDB_SQL_FETCH || pCmd->command == TSDB_SQL_INSERT ||
if (pSql->retry > pSql->maxRetry) { pCmd->command == TSDB_SQL_UPDATE_TAGS_VAL) &&
tscError("%p max retry %d reached, give up", pSql, pSql->maxRetry); (rpcMsg->code == TSDB_CODE_TDB_INVALID_TABLE_ID || rpcMsg->code == TSDB_CODE_VND_INVALID_VGROUP_ID ||
} else { rpcMsg->code == TSDB_CODE_RPC_NETWORK_UNAVAIL || rpcMsg->code == TSDB_CODE_TDB_TABLE_RECONFIGURE)) {
rpcMsg->code = tscRenewTableMeta(pSql, pTableMetaInfo->name); 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 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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册