From c62ea73daaf386d09bd410d2bba01d19948d8c30 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 26 Jul 2022 06:54:07 +0800 Subject: [PATCH] fix: shortcut support taos benchmark --- src/client/src/tscAsync.c | 2 +- src/client/src/tscServer.c | 2 +- src/inc/taoserror.h | 1 + src/util/src/terror.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index df1b98478c..3edebd88ec 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -313,7 +313,7 @@ static void tscAsyncResultCallback(SSchedMsg *pMsg) { } assert(pSql->res.code != TSDB_CODE_SUCCESS); - if (tsShortcutFlag) { + if (tsShortcutFlag && (pSql->res.code == TSDB_CODE_RPC_SHORTCUT)) { tscDebug("0x%" PRIx64 " async result callback, code:%s", pSql->self, tstrerror(pSql->res.code)); pSql->res.code = TSDB_CODE_SUCCESS; } else { diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index c952bc2eb3..3f0a261a25 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -335,7 +335,7 @@ int tscSendMsgToServer(SSqlObj *pSql) { if ((rpcMsg.msgType == TSDB_MSG_TYPE_SUBMIT) && (tsShortcutFlag & TSDB_SHORTCUT_RB_RPC_SEND_SUBMIT)) { rpcFreeCont(rpcMsg.pCont); - return TSDB_CODE_FAILED; + return TSDB_CODE_RPC_SHORTCUT; } rpcSendRequest(pObj->pRpcObj->pDnodeConn, &pSql->epSet, &rpcMsg, &pSql->rpcRid); diff --git a/src/inc/taoserror.h b/src/inc/taoserror.h index 029d3bd40f..9f51952d28 100644 --- a/src/inc/taoserror.h +++ b/src/inc/taoserror.h @@ -60,6 +60,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_APP_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x0014) //"Database not ready" #define TSDB_CODE_RPC_FQDN_ERROR TAOS_DEF_ERROR_CODE(0, 0x0015) //"Unable to resolve FQDN" #define TSDB_CODE_RPC_INVALID_VERSION TAOS_DEF_ERROR_CODE(0, 0x0016) //"Invalid app version" +#define TSDB_CODE_RPC_SHORTCUT TAOS_DEF_ERROR_CODE(0, 0x0017) //"Shortcut" //common & util #define TSDB_CODE_COM_OPS_NOT_SUPPORT TAOS_DEF_ERROR_CODE(0, 0x0100) //"Operation not supported" diff --git a/src/util/src/terror.c b/src/util/src/terror.c index 0cc345d60a..640e842de3 100644 --- a/src/util/src/terror.c +++ b/src/util/src/terror.c @@ -68,6 +68,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RPC_INVALID_TIME_STAMP, "Client and server's t TAOS_DEFINE_ERROR(TSDB_CODE_APP_NOT_READY, "Database not ready") TAOS_DEFINE_ERROR(TSDB_CODE_RPC_FQDN_ERROR, "Unable to resolve FQDN") TAOS_DEFINE_ERROR(TSDB_CODE_RPC_INVALID_VERSION, "Invalid app version") +TAOS_DEFINE_ERROR(TSDB_CODE_RPC_SHORTCUT, "Shortcut") //common & util TAOS_DEFINE_ERROR(TSDB_CODE_COM_OPS_NOT_SUPPORT, "Operation not supported") -- GitLab