提交 d01a0c59 编写于 作者: S slguan

fix compile error for rpc interface changed

上级 3870a01e
...@@ -379,7 +379,7 @@ int tsParseSql(SSqlObj *pSql, bool multiVnodeInsertion); ...@@ -379,7 +379,7 @@ int tsParseSql(SSqlObj *pSql, bool multiVnodeInsertion);
void tscInitMsgs(); void tscInitMsgs();
extern int (*tscBuildMsg[TSDB_SQL_MAX])(SSqlObj *pSql, SSqlInfo *pInfo); extern int (*tscBuildMsg[TSDB_SQL_MAX])(SSqlObj *pSql, SSqlInfo *pInfo);
void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, int32_t code); void tscProcessMsgFromServer(SRpcMsg *rpcMsg);
int tscProcessSql(SSqlObj *pSql); int tscProcessSql(SSqlObj *pSql);
void tscAsyncInsertMultiVnodesProxy(void *param, TAOS_RES *tres, int numOfRows); void tscAsyncInsertMultiVnodesProxy(void *param, TAOS_RES *tres, int numOfRows);
......
...@@ -320,7 +320,6 @@ void tscProcessFetchRow(SSchedMsg *pMsg) { ...@@ -320,7 +320,6 @@ void tscProcessFetchRow(SSchedMsg *pMsg) {
void tscProcessAsyncRes(SSchedMsg *pMsg) { void tscProcessAsyncRes(SSchedMsg *pMsg) {
SSqlObj *pSql = (SSqlObj *)pMsg->ahandle; SSqlObj *pSql = (SSqlObj *)pMsg->ahandle;
STscObj *pTscObj = pSql->pTscObj;
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
SSqlRes *pRes = &pSql->res; SSqlRes *pRes = &pSql->res;
......
...@@ -98,6 +98,7 @@ void tscSetMgmtIpList(SRpcIpSet *pIpList) { ...@@ -98,6 +98,7 @@ void tscSetMgmtIpList(SRpcIpSet *pIpList) {
* The retry will not be executed since only *two* retry is allowed in case of single management node in the cluster. * The retry will not be executed since only *two* retry is allowed in case of single management node in the cluster.
* Therefore, we need to multiply the retry times by factor of 2 to fix this problem. * Therefore, we need to multiply the retry times by factor of 2 to fix this problem.
*/ */
UNUSED_FUNC
static int32_t tscGetMgmtConnMaxRetryTimes() { static int32_t tscGetMgmtConnMaxRetryTimes() {
int32_t factor = 2; int32_t factor = 2;
return tscMgmtIpList.numOfIps * factor; return tscMgmtIpList.numOfIps * factor;
...@@ -185,20 +186,35 @@ int tscSendMsgToServer(SSqlObj *pSql) { ...@@ -185,20 +186,35 @@ int tscSendMsgToServer(SSqlObj *pSql) {
pSql->ipList->port = tsVnodeShellPort; pSql->ipList->port = tsVnodeShellPort;
tscPrint("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList->port); tscPrint("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList->port);
memcpy(pMsg, pSql->cmd.payload + tsRpcHeadSize, pSql->cmd.payloadLen); memcpy(pMsg, pSql->cmd.payload + tsRpcHeadSize, pSql->cmd.payloadLen);
rpcSendRequest(pVnodeConn, pSql->ipList, pSql->cmd.msgType, pMsg, pSql->cmd.payloadLen, pSql);
SRpcMsg rpcMsg = {
.msgType = pSql->cmd.msgType,
.pCont = pMsg,
.contLen = pSql->cmd.payloadLen,
.handle = pSql,
.code = 0
};
rpcSendRequest(pVnodeConn, pSql->ipList, &rpcMsg);
} else { } else {
pSql->ipList->port = tsMgmtShellPort; pSql->ipList->port = tsMgmtShellPort;
tscPrint("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList->port); tscPrint("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList->port);
memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen); memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen);
rpcSendRequest(pTscMgmtConn, pSql->ipList, pSql->cmd.msgType, pMsg, pSql->cmd.payloadLen, pSql); SRpcMsg rpcMsg = {
.msgType = pSql->cmd.msgType,
.pCont = pMsg,
.contLen = pSql->cmd.payloadLen,
.handle = pSql,
.code = 0
};
rpcSendRequest(pTscMgmtConn, pSql->ipList, &rpcMsg);
} }
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, int32_t code) { void tscProcessMsgFromServer(SRpcMsg *rpcMsg) {
tscPrint("response:%s is received, len:%d error:%s", taosMsg[(uint8_t)type], contLen, tstrerror(code)); tscPrint("response:%s is received, len:%d error:%s", taosMsg[rpcMsg->msgType], rpcMsg->contLen, tstrerror(rpcMsg->code));
SSqlObj *pSql = (SSqlObj *)ahandle; SSqlObj *pSql = (SSqlObj *)rpcMsg->handle;
if (pSql == NULL || pSql->signature != pSql) { if (pSql == NULL || pSql->signature != pSql) {
tscError("%p sql is already released, signature:%p", pSql, pSql->signature); tscError("%p sql is already released, signature:%p", pSql, pSql->signature);
return; return;
...@@ -207,24 +223,24 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, ...@@ -207,24 +223,24 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle,
SSqlRes *pRes = &pSql->res; SSqlRes *pRes = &pSql->res;
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
STscObj *pObj = pSql->pTscObj; STscObj *pObj = pSql->pTscObj;
tscTrace("%p msg:%p is received from server", pSql, pCont); tscTrace("%p msg:%p is received from server", pSql, rpcMsg->pCont);
if (pSql->freed || pObj->signature != pObj) { if (pSql->freed || pObj->signature != pObj) {
tscTrace("%p sql is already released or DB connection is closed, freed:%d pObj:%p signature:%p", pSql, pSql->freed, tscTrace("%p sql is already released or DB connection is closed, freed:%d pObj:%p signature:%p", pSql, pSql->freed,
pObj, pObj->signature); pObj, pObj->signature);
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
rpcFreeCont(pCont); rpcFreeCont(rpcMsg->pCont);
return; return;
} }
if (pCont == NULL) { if (rpcMsg->pCont == NULL) {
code = TSDB_CODE_NETWORK_UNAVAIL; rpcMsg->code = TSDB_CODE_NETWORK_UNAVAIL;
} else { } else {
SMeterMetaInfo *pMeterMetaInfo = tscGetMeterMetaInfo(pCmd, pCmd->clauseIndex, 0); SMeterMetaInfo *pMeterMetaInfo = tscGetMeterMetaInfo(pCmd, pCmd->clauseIndex, 0);
if (code == TSDB_CODE_NOT_ACTIVE_TABLE || code == TSDB_CODE_INVALID_TABLE_ID || if (rpcMsg->code == TSDB_CODE_NOT_ACTIVE_TABLE || rpcMsg->code == TSDB_CODE_INVALID_TABLE_ID ||
code == TSDB_CODE_INVALID_VNODE_ID || code == TSDB_CODE_NOT_ACTIVE_VNODE || rpcMsg->code == TSDB_CODE_INVALID_VNODE_ID || rpcMsg->code == TSDB_CODE_NOT_ACTIVE_VNODE ||
code == TSDB_CODE_NETWORK_UNAVAIL || code == TSDB_CODE_NOT_ACTIVE_SESSION || rpcMsg->code == TSDB_CODE_NETWORK_UNAVAIL || rpcMsg->code == TSDB_CODE_NOT_ACTIVE_SESSION ||
code == TSDB_CODE_TABLE_ID_MISMATCH) { rpcMsg->code == TSDB_CODE_TABLE_ID_MISMATCH) {
/* /*
* not_active_table: 1. the virtual node may fail to create table, since the procedure of create table is asynchronized, * not_active_table: 1. the virtual node may fail to create table, since the procedure of create table is asynchronized,
* the virtual node may have not create table till now, so try again by using the new metermeta. * the virtual node may have not create table till now, so try again by using the new metermeta.
...@@ -236,24 +252,24 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, ...@@ -236,24 +252,24 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle,
* not_active_session: db has been move to other node, the vnode does not exist on this dnode anymore. * not_active_session: db has been move to other node, the vnode does not exist on this dnode anymore.
*/ */
if (pCmd->command == TSDB_SQL_CONNECT) { if (pCmd->command == TSDB_SQL_CONNECT) {
code = TSDB_CODE_NETWORK_UNAVAIL; rpcMsg->code = TSDB_CODE_NETWORK_UNAVAIL;
rpcFreeCont(pCont); rpcFreeCont(rpcMsg->pCont);
return; return;
} else if (pCmd->command == TSDB_SQL_HB) { } else if (pCmd->command == TSDB_SQL_HB) {
code = TSDB_CODE_NOT_READY; rpcMsg->code = TSDB_CODE_NOT_READY;
rpcFreeCont(pCont); rpcFreeCont(rpcMsg->pCont);
return; return;
} else { } else {
tscTrace("%p it shall renew meter meta, code:%d", pSql, code); tscTrace("%p it shall renew meter meta, code:%d", pSql, rpcMsg->code);
pSql->maxRetry = TSDB_VNODES_SUPPORT * 2; pSql->maxRetry = TSDB_VNODES_SUPPORT * 2;
pSql->res.code = (uint8_t) code; // keep the previous error code pSql->res.code = rpcMsg->code; // keep the previous error code
code = tscRenewMeterMeta(pSql, pMeterMetaInfo->name); rpcMsg->code = tscRenewMeterMeta(pSql, pMeterMetaInfo->name);
if (pMeterMetaInfo->pMeterMeta) { if (pMeterMetaInfo->pMeterMeta) {
tscSendMsgToServer(pSql); tscSendMsgToServer(pSql);
rpcFreeCont(pCont); rpcFreeCont(rpcMsg->pCont);
return; return;
} }
} }
...@@ -266,16 +282,16 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, ...@@ -266,16 +282,16 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle,
pRes->rspLen = 0; pRes->rspLen = 0;
if (pRes->code != TSDB_CODE_QUERY_CANCELLED) { if (pRes->code != TSDB_CODE_QUERY_CANCELLED) {
pRes->code = (code != TSDB_CODE_SUCCESS) ? code : TSDB_CODE_NETWORK_UNAVAIL; pRes->code = (rpcMsg->code != TSDB_CODE_SUCCESS) ? rpcMsg->code : TSDB_CODE_NETWORK_UNAVAIL;
} else { } else {
tscTrace("%p query is cancelled, code:%d", pSql, pRes->code); tscTrace("%p query is cancelled, code:%d", pSql, pRes->code);
} }
if (pRes->code != TSDB_CODE_QUERY_CANCELLED) { if (pRes->code != TSDB_CODE_QUERY_CANCELLED) {
assert(type == pCmd->msgType + 1); assert(rpcMsg->msgType == pCmd->msgType + 1);
pRes->code = (int32_t)code; pRes->code = (int32_t)rpcMsg->code;
pRes->rspType = type; pRes->rspType = rpcMsg->msgType;
pRes->rspLen = contLen; pRes->rspLen = rpcMsg->contLen;
char *tmp = (char *)realloc(pRes->pRsp, pRes->rspLen); char *tmp = (char *)realloc(pRes->pRsp, pRes->rspLen);
if (tmp == NULL) { if (tmp == NULL) {
...@@ -283,7 +299,7 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, ...@@ -283,7 +299,7 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle,
} else { } else {
pRes->pRsp = tmp; pRes->pRsp = tmp;
if (pRes->rspLen) { if (pRes->rspLen) {
memcpy(pRes->pRsp, pCont, pRes->rspLen); memcpy(pRes->pRsp, rpcMsg->pCont, pRes->rspLen);
} }
} }
...@@ -296,8 +312,8 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, ...@@ -296,8 +312,8 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle,
* There is not response callback function for submit response. * There is not response callback function for submit response.
* The actual inserted number of points is the first number. * The actual inserted number of points is the first number.
*/ */
if (type == TSDB_MSG_TYPE_SUBMIT_RSP) { if (rpcMsg->msgType == TSDB_MSG_TYPE_SUBMIT_RSP) {
SShellSubmitRspMsg *pMsg = pRes->pRsp; SShellSubmitRspMsg *pMsg = (SShellSubmitRspMsg*)pRes->pRsp;
pMsg->code = htonl(pMsg->code); pMsg->code = htonl(pMsg->code);
pMsg->numOfRows = htonl(pMsg->numOfRows); pMsg->numOfRows = htonl(pMsg->numOfRows);
pMsg->affectedRows = htonl(pMsg->affectedRows); pMsg->affectedRows = htonl(pMsg->affectedRows);
...@@ -316,14 +332,14 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, ...@@ -316,14 +332,14 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle,
tsem_post(&pSql->rspSem); tsem_post(&pSql->rspSem);
} else { } else {
if (pRes->code == TSDB_CODE_SUCCESS && tscProcessMsgRsp[pCmd->command]) if (pRes->code == TSDB_CODE_SUCCESS && tscProcessMsgRsp[pCmd->command])
code = (*tscProcessMsgRsp[pCmd->command])(pSql); rpcMsg->code = (*tscProcessMsgRsp[pCmd->command])(pSql);
if (code != TSDB_CODE_ACTION_IN_PROGRESS) { if (rpcMsg->code != TSDB_CODE_ACTION_IN_PROGRESS) {
int command = pCmd->command; int command = pCmd->command;
void *taosres = tscKeepConn[command] ? pSql : NULL; void *taosres = tscKeepConn[command] ? pSql : NULL;
code = pRes->code ? -pRes->code : pRes->numOfRows; rpcMsg->code = pRes->code ? -pRes->code : pRes->numOfRows;
tscTrace("%p Async SQL result:%d res:%p", pSql, code, taosres); tscTrace("%p Async SQL result:%d res:%p", pSql, rpcMsg->code, taosres);
/* /*
* Whether to free sqlObj or not should be decided before call the user defined function, since this SqlObj * Whether to free sqlObj or not should be decided before call the user defined function, since this SqlObj
...@@ -335,9 +351,9 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, ...@@ -335,9 +351,9 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle,
*/ */
bool shouldFree = tscShouldFreeAsyncSqlObj(pSql); bool shouldFree = tscShouldFreeAsyncSqlObj(pSql);
if (command == TSDB_SQL_INSERT) { // handle multi-vnode insertion situation if (command == TSDB_SQL_INSERT) { // handle multi-vnode insertion situation
(*pSql->fp)(pSql, taosres, code); (*pSql->fp)(pSql, taosres, rpcMsg->code);
} else { } else {
(*pSql->fp)(pSql->param, taosres, code); (*pSql->fp)(pSql->param, taosres, rpcMsg->code);
} }
if (shouldFree) { if (shouldFree) {
...@@ -353,7 +369,7 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, ...@@ -353,7 +369,7 @@ void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle,
} }
} }
rpcFreeCont(pCont); rpcFreeCont(rpcMsg->pCont);
} }
static SSqlObj *tscCreateSqlObjForSubquery(SSqlObj *pSql, SRetrieveSupport *trsupport, SSqlObj *prevSqlObj); static SSqlObj *tscCreateSqlObjForSubquery(SSqlObj *pSql, SRetrieveSupport *trsupport, SSqlObj *prevSqlObj);
...@@ -1206,7 +1222,7 @@ int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1206,7 +1222,7 @@ int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pStart = pSql->cmd.payload + tsRpcHeadSize; pStart = pSql->cmd.payload + tsRpcHeadSize;
pMsg = pStart; pMsg = pStart;
SRetrieveTableMsg *pRetrieveMsg = (SShellSubmitMsg *)pMsg; SRetrieveTableMsg *pRetrieveMsg = (SRetrieveTableMsg *)pMsg;
pRetrieveMsg->qhandle = htobe64(pSql->res.qhandle); pRetrieveMsg->qhandle = htobe64(pSql->res.qhandle);
pMsg += sizeof(pSql->res.qhandle); pMsg += sizeof(pSql->res.qhandle);
...@@ -1221,13 +1237,13 @@ int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1221,13 +1237,13 @@ int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
} }
void tscUpdateVnodeInSubmitMsg(SSqlObj *pSql, char *buf) { void tscUpdateVnodeInSubmitMsg(SSqlObj *pSql, char *buf) {
SShellSubmitMsg *pShellMsg; //SShellSubmitMsg *pShellMsg;
char * pMsg; //char * pMsg;
SMeterMetaInfo * pMeterMetaInfo = tscGetMeterMetaInfo(&pSql->cmd, pSql->cmd.clauseIndex, 0); //SMeterMetaInfo * pMeterMetaInfo = tscGetMeterMetaInfo(&pSql->cmd, pSql->cmd.clauseIndex, 0);
STableMeta *pMeterMeta = pMeterMetaInfo->pMeterMeta; //STableMeta *pMeterMeta = pMeterMetaInfo->pMeterMeta;
pMsg = buf + tsRpcHeadSize; //pMsg = buf + tsRpcHeadSize;
//TODO set iplist //TODO set iplist
//pShellMsg = (SShellSubmitMsg *)pMsg; //pShellMsg = (SShellSubmitMsg *)pMsg;
...@@ -1999,7 +2015,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1999,7 +2015,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
memcpy(pMsg, &pInfo->pCreateTableInfo->usingInfo.tagdata, sizeof(STagData)); memcpy(pMsg, &pInfo->pCreateTableInfo->usingInfo.tagdata, sizeof(STagData));
pMsg += sizeof(STagData); pMsg += sizeof(STagData);
} else { // create (super) table } else { // create (super) table
pSchema = pCreateTableMsg->schema; pSchema = (SSchema *)pCreateTableMsg->schema;
for (int i = 0; i < pCmd->numOfCols + pCmd->count; ++i) { for (int i = 0; i < pCmd->numOfCols + pCmd->count; ++i) {
TAOS_FIELD *pField = tscFieldInfoGetField(pQueryInfo, i); TAOS_FIELD *pField = tscFieldInfoGetField(pQueryInfo, i);
...@@ -2039,7 +2055,7 @@ int tscEstimateAlterTableMsgLength(SSqlCmd *pCmd) { ...@@ -2039,7 +2055,7 @@ int tscEstimateAlterTableMsgLength(SSqlCmd *pCmd) {
int tscBuildAlterTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscBuildAlterTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SAlterTableMsg *pAlterTableMsg; SAlterTableMsg *pAlterTableMsg;
char * pMsg, *pStart; char * pMsg;
int msgLen = 0; int msgLen = 0;
int size = 0; int size = 0;
...@@ -2557,7 +2573,6 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -2557,7 +2573,6 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int tscProcessMeterMetaRsp(SSqlObj *pSql) { int tscProcessMeterMetaRsp(SSqlObj *pSql) {
STableMeta *pMeta; STableMeta *pMeta;
SSchema * pSchema; SSchema * pSchema;
uint8_t ieType;
pMeta = (STableMeta *)pSql->res.pRsp; pMeta = (STableMeta *)pSql->res.pRsp;
...@@ -2661,7 +2676,7 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) { ...@@ -2661,7 +2676,7 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) {
for (i = 0; i < totalNum; i++) { for (i = 0; i < totalNum; i++) {
SMultiTableMeta *pMultiMeta = (SMultiTableMeta *)rsp; SMultiTableMeta *pMultiMeta = (SMultiTableMeta *)rsp;
STableMeta * pMeta = &pMultiMeta->metas; STableMeta * pMeta = pMultiMeta->metas;
pMeta->sid = htonl(pMeta->sid); pMeta->sid = htonl(pMeta->sid);
pMeta->sversion = htons(pMeta->sversion); pMeta->sversion = htons(pMeta->sversion);
...@@ -3023,7 +3038,7 @@ int tscProcessAlterDbMsgRsp(SSqlObj *pSql) { ...@@ -3023,7 +3038,7 @@ int tscProcessAlterDbMsgRsp(SSqlObj *pSql) {
int tscProcessQueryRsp(SSqlObj *pSql) { int tscProcessQueryRsp(SSqlObj *pSql) {
SSqlRes *pRes = &pSql->res; SSqlRes *pRes = &pSql->res;
SQueryTableRsp *pQuery = (SRetrieveTableRsp *)pRes->pRsp; SQueryTableRsp *pQuery = (SQueryTableRsp *)pRes->pRsp;
pQuery->qhandle = htobe64(pQuery->qhandle); pQuery->qhandle = htobe64(pQuery->qhandle);
pRes->qhandle = pQuery->qhandle; pRes->qhandle = pQuery->qhandle;
...@@ -3035,7 +3050,6 @@ int tscProcessQueryRsp(SSqlObj *pSql) { ...@@ -3035,7 +3050,6 @@ int tscProcessQueryRsp(SSqlObj *pSql) {
int tscProcessRetrieveRspFromVnode(SSqlObj *pSql) { int tscProcessRetrieveRspFromVnode(SSqlObj *pSql) {
SSqlRes *pRes = &pSql->res; SSqlRes *pRes = &pSql->res;
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
STscObj *pObj = pSql->pTscObj;
SRetrieveTableRsp *pRetrieve = (SRetrieveTableRsp *)pRes->pRsp; SRetrieveTableRsp *pRetrieve = (SRetrieveTableRsp *)pRes->pRsp;
......
...@@ -72,7 +72,7 @@ int32_t tscInitRpc(const char *user, const char *secret) { ...@@ -72,7 +72,7 @@ int32_t tscInitRpc(const char *user, const char *secret) {
rpcInit.cfp = tscProcessMsgFromServer; rpcInit.cfp = tscProcessMsgFromServer;
rpcInit.sessions = tsMaxVnodeConnections; rpcInit.sessions = tsMaxVnodeConnections;
rpcInit.connType = TAOS_CONN_CLIENT; rpcInit.connType = TAOS_CONN_CLIENT;
rpcInit.user = user; rpcInit.user = (char*)user;
rpcInit.ckey = "key"; rpcInit.ckey = "key";
rpcInit.secret = secretEncrypt; rpcInit.secret = secretEncrypt;
......
...@@ -359,7 +359,7 @@ void rpcSendRequest(void *shandle, SRpcIpSet *pIpSet, SRpcMsg *pMsg) { ...@@ -359,7 +359,7 @@ void rpcSendRequest(void *shandle, SRpcIpSet *pIpSet, SRpcMsg *pMsg) {
// connection type is application specific. // connection type is application specific.
// for TDengine, all the query, show commands shall have TCP connection // for TDengine, all the query, show commands shall have TCP connection
char type = pMsg->msgType; char type = pMsg->msgType;
if (type == TSDB_MSG_TYPE_DNODE_QUERY || type == TSDB_MSG_TYPE_DNODE_RETRIEVE || if (type == TSDB_MSG_TYPE_QUERY || type == TSDB_MSG_TYPE_RETRIEVE ||
type == TSDB_MSG_TYPE_STABLE_META || type == TSDB_MSG_TYPE_MULTI_TABLE_META || type == TSDB_MSG_TYPE_STABLE_META || type == TSDB_MSG_TYPE_MULTI_TABLE_META ||
type == TSDB_MSG_TYPE_SHOW ) type == TSDB_MSG_TYPE_SHOW )
pContext->connType = RPC_CONN_TCPC; pContext->connType = RPC_CONN_TCPC;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册