[td-225] handle TSDB_CODE_TDB_TABLE_RECONFIGURE code.
This commit is contained in:
parent
8559032b5f
commit
c86b6877e9
|
@ -471,7 +471,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// in case of insert, redo parsing the sql string and build new submit data block for two reasons:
|
// in case of insert, redo parsing the sql string and build new submit data block for two reasons:
|
||||||
// 1. the table Id(tid & uid) may have been update, the submit block needs to be updated
|
// 1. the table Id(tid & uid) may have been update, the submit block needs to be updated accordingly.
|
||||||
// 2. vnode may need the schema information along with submit block to update its local table schema.
|
// 2. vnode may need the schema information along with submit block to update its local table schema.
|
||||||
if (pCmd->command == TSDB_SQL_INSERT) {
|
if (pCmd->command == TSDB_SQL_INSERT) {
|
||||||
tscDebug("%p redo parse sql string to build submit block", pSql);
|
tscDebug("%p redo parse sql string to build submit block", pSql);
|
||||||
|
|
|
@ -247,7 +247,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
|
||||||
} 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_TDB_INVALID_TABLE_ID || rpcMsg->code == TSDB_CODE_VND_INVALID_VGROUP_ID ||
|
||||||
rpcMsg->code == TSDB_CODE_RPC_NETWORK_UNAVAIL) {
|
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);
|
||||||
|
@ -260,7 +260,12 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
|
||||||
// get table meta query will not retry, do nothing
|
// get table meta query will not retry, do nothing
|
||||||
} else {
|
} else {
|
||||||
tscWarn("%p it shall renew table meta, code:%s, retry:%d", pSql, tstrerror(rpcMsg->code), ++pSql->retry);
|
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
|
pSql->res.code = rpcMsg->code; // keep the previous error code
|
||||||
if (pSql->retry > pSql->maxRetry) {
|
if (pSql->retry > pSql->maxRetry) {
|
||||||
tscError("%p max retry %d reached, give up", pSql, pSql->maxRetry);
|
tscError("%p max retry %d reached, give up", pSql, pSql->maxRetry);
|
||||||
|
|
Loading…
Reference in New Issue