From 806a9310e31886bc7fa27a60b2306bc7cb15a6f5 Mon Sep 17 00:00:00 2001 From: slguan Date: Tue, 24 Sep 2019 14:32:12 +0800 Subject: [PATCH] fix issue #552 --- packaging/cfg/taos.cfg | 2 +- src/client/src/tscSQLParser.c | 2 +- src/inc/tglobalcfg.h | 2 +- src/inc/tlog.h | 16 ++++++++-------- src/inc/trpc.h | 2 +- src/rpc/src/trpc.c | 10 +++++----- src/util/src/tglobalcfg.c | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packaging/cfg/taos.cfg b/packaging/cfg/taos.cfg index ae205ca19d..d9a9ce32a2 100644 --- a/packaging/cfg/taos.cfg +++ b/packaging/cfg/taos.cfg @@ -181,7 +181,7 @@ # sdbDebugFlag 135 # debug flag for RPC -# taosDebugFlag 131 +# rpcDebugFlag 131 # debug flag for basic utils # debugFlag 131 diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 6f229a5d77..f811d62610 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -3856,7 +3856,7 @@ int32_t validateDNodeConfig(tDCLSQL* pOptions) { } SDNodeDynConfOption DNODE_DYNAMIC_CFG_OPTIONS[13] = { - {"resetLog", 8}, {"resetQueryCache", 15}, {"dDebugFlag", 10}, {"taosDebugFlag", 13}, + {"resetLog", 8}, {"resetQueryCache", 15}, {"dDebugFlag", 10}, {"rpcDebugFlag", 12}, {"tmrDebugFlag", 12}, {"cDebugFlag", 10}, {"uDebugFlag", 10}, {"mDebugFlag", 10}, {"sdbDebugFlag", 12}, {"httpDebugFlag", 13}, {"monitorDebugFlag", 16}, {"qDebugflag", 10}, {"debugFlag", 9}}; diff --git a/src/inc/tglobalcfg.h b/src/inc/tglobalcfg.h index 222fbccb55..4bdbe2ad00 100644 --- a/src/inc/tglobalcfg.h +++ b/src/inc/tglobalcfg.h @@ -155,7 +155,7 @@ extern int sdbDebugFlag; extern int httpDebugFlag; extern int monitorDebugFlag; extern int uDebugFlag; -extern int taosDebugFlag; +extern int rpcDebugFlag; extern int debugFlag; extern int odbcdebugFlag; extern int qdebugFlag; diff --git a/src/inc/tlog.h b/src/inc/tlog.h index 550f5fb418..c6e4c82ca1 100644 --- a/src/inc/tlog.h +++ b/src/inc/tlog.h @@ -132,23 +132,23 @@ extern int cdebugFlag; { tprintf("JNI ", 255, __VA_ARGS__); } // rpc log function -extern int taosDebugFlag; +extern int rpcDebugFlag; #define tError(...) \ - if (taosDebugFlag & DEBUG_ERROR) { \ - tprintf("ERROR RPC ", taosDebugFlag, __VA_ARGS__); \ + if (rpcDebugFlag & DEBUG_ERROR) { \ + tprintf("ERROR RPC ", rpcDebugFlag, __VA_ARGS__); \ } #define tWarn(...) \ - if (taosDebugFlag & DEBUG_WARN) { \ - tprintf("WARN RPC ", taosDebugFlag, __VA_ARGS__); \ + if (rpcDebugFlag & DEBUG_WARN) { \ + tprintf("WARN RPC ", rpcDebugFlag, __VA_ARGS__); \ } #define tTrace(...) \ - if (taosDebugFlag & DEBUG_TRACE) { \ - tprintf("RPC ", taosDebugFlag, __VA_ARGS__); \ + if (rpcDebugFlag & DEBUG_TRACE) { \ + tprintf("RPC ", rpcDebugFlag, __VA_ARGS__); \ } #define tPrint(...) \ { tprintf("RPC ", 255, __VA_ARGS__); } #define tDump(x, y) \ - if (taosDebugFlag & DEBUG_DUMP) { \ + if (rpcDebugFlag & DEBUG_DUMP) { \ taosDumpData((unsigned char *)x, y); \ } diff --git a/src/inc/trpc.h b/src/inc/trpc.h index 56982e8a47..991ea08d92 100644 --- a/src/inc/trpc.h +++ b/src/inc/trpc.h @@ -73,7 +73,7 @@ typedef struct { char * ckey; // ciphering key } SRpcConnInit; -extern int taosDebugFlag; +extern int rpcDebugFlag; extern int tsRpcHeadSize; void *taosOpenRpc(SRpcInit *pRpc); diff --git a/src/rpc/src/trpc.c b/src/rpc/src/trpc.c index 4204db394a..d3d467afd1 100644 --- a/src/rpc/src/trpc.c +++ b/src/rpc/src/trpc.c @@ -116,7 +116,7 @@ typedef struct rpc_server { } STaosRpc; // configurable -int taosDebugFlag = 131; +int rpcDebugFlag = 131; int tsRpcTimer = 300; int tsRpcMaxTime = 600; // seconds; int tsRpcProgressTime = 10; // milliseocnds @@ -628,14 +628,14 @@ int taosSendDataToPeer(SRpcConn *pConn, char *data, int dataLen) { if (pConn->signature != pConn || pServer == NULL) return -1; if (pHeader->msgType & 1) { - if (pHeader->msgType < TSDB_MSG_TYPE_HEARTBEAT || (taosDebugFlag & 16)) + if (pHeader->msgType < TSDB_MSG_TYPE_HEARTBEAT || (rpcDebugFlag & 16)) tTrace( "%s cid:%d sid:%d id:%s, %s is sent to %s:%hu, len:%d tranId:%d " "pConn:%p", pServer->label, pConn->chann, pConn->sid, pConn->meterId, taosMsg[pHeader->msgType], pConn->peerIpstr, pConn->peerPort, dataLen, pHeader->tranId, pConn); } else { - if (pHeader->msgType < TSDB_MSG_TYPE_HEARTBEAT || (taosDebugFlag & 16)) + if (pHeader->msgType < TSDB_MSG_TYPE_HEARTBEAT || (rpcDebugFlag & 16)) tTrace( "%s cid:%d sid:%d id:%s, %s is sent to %s:%hu, code:%u len:%d " "tranId:%d pConn:%p", @@ -1050,7 +1050,7 @@ void *taosProcessDataFromPeer(char *data, int dataLen, uint32_t ip, short port, return pConn; } - if (pHeader->msgType < TSDB_MSG_TYPE_HEARTBEAT || (taosDebugFlag & 16)) { + if (pHeader->msgType < TSDB_MSG_TYPE_HEARTBEAT || (rpcDebugFlag & 16)) { tTrace("%s cid:%d sid:%d id:%s, %s received from 0x%x:%hu, parse code:%u, first:%u len:%d tranId:%d pConn:%p", pServer->label, chann, sid, pHeader->meterId, taosMsg[pHeader->msgType], ip, port, code, pHeader->content[0], dataLen, pHeader->tranId, pConn); @@ -1084,7 +1084,7 @@ void *taosProcessDataFromPeer(char *data, int dataLen, uint32_t ip, short port, // memcpy(schedMsg.msg, (char *)(&(pHeader->destId)), pHeader->msgLen); } - if (pHeader->msgType < TSDB_MSG_TYPE_HEARTBEAT || (taosDebugFlag & 16)) { + if (pHeader->msgType < TSDB_MSG_TYPE_HEARTBEAT || (rpcDebugFlag & 16)) { tTrace("%s cid:%d sid:%d id:%s, %s is put into queue, msgLen:%d pConn:%p pTimer:%p", pServer->label, chann, sid, pHeader->meterId, taosMsg[pHeader->msgType], pHeader->msgLen, pConn, pConn->pTimer); diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index 007777a2fd..acc2486a23 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -556,7 +556,7 @@ void tsInitGlobalConfig() { TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG, 0, 255, 0, TSDB_CFG_UTYPE_NONE); tsInitConfigOption(cfg++, "sdbDebugFlag", &sdbDebugFlag, TSDB_CFG_VTYPE_INT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG, 0, 255, 0, TSDB_CFG_UTYPE_NONE); - tsInitConfigOption(cfg++, "taosDebugFlag", &taosDebugFlag, TSDB_CFG_VTYPE_INT, + tsInitConfigOption(cfg++, "rpcDebugFlag", &rpcDebugFlag, TSDB_CFG_VTYPE_INT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT, 0, 255, 0, TSDB_CFG_UTYPE_NONE); tsInitConfigOption(cfg++, "tmrDebugFlag", &tmrDebugFlag, TSDB_CFG_VTYPE_INT, @@ -821,7 +821,7 @@ void tsSetAllDebugFlag() { if (mdebugFlag != debugFlag) mdebugFlag = debugFlag; if (ddebugFlag != debugFlag) ddebugFlag = debugFlag; if (sdbDebugFlag != debugFlag) sdbDebugFlag = debugFlag; - if (taosDebugFlag != debugFlag) taosDebugFlag = debugFlag; + if (rpcDebugFlag != debugFlag) rpcDebugFlag = debugFlag; if (cdebugFlag != debugFlag) cdebugFlag = debugFlag; if (jnidebugFlag != debugFlag) jnidebugFlag = debugFlag; if (uDebugFlag != debugFlag) uDebugFlag = debugFlag; -- GitLab