fix debug info

This commit is contained in:
yihaoDeng 2023-03-05 11:36:01 +08:00
parent 7986e1fd49
commit e6ec795b4d
2 changed files with 16 additions and 11 deletions

View File

@ -66,6 +66,15 @@ extern int32_t tMsgDict[];
typedef uint16_t tmsg_t; typedef uint16_t tmsg_t;
static inline bool tmsgIsValid(tmsg_t type) {
if (type < TDMT_DND_MAX_MSG || type < TDMT_MND_MAX_MSG || type < TDMT_VND_MAX_MSG || type < TDMT_SCH_MAX_MSG ||
type < TDMT_STREAM_MAX_MSG || type < TDMT_MON_MAX_MSG || type < TDMT_SYNC_MAX_MSG || type < TDMT_VND_STREAM_MSG ||
type < TDMT_VND_TMQ_MSG || type < TDMT_VND_TMQ_MAX_MSG) {
return true;
} else {
return false;
}
}
static inline bool vnodeIsMsgBlock(tmsg_t type) { static inline bool vnodeIsMsgBlock(tmsg_t type) {
return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) ||
(type == TDMT_VND_UPDATE_TAG_VAL) || (type == TDMT_VND_ALTER_CONFIRM); (type == TDMT_VND_UPDATE_TAG_VAL) || (type == TDMT_VND_ALTER_CONFIRM);
@ -2691,7 +2700,7 @@ typedef struct {
char subKey[TSDB_SUBSCRIBE_KEY_LEN]; char subKey[TSDB_SUBSCRIBE_KEY_LEN];
int8_t subType; int8_t subType;
int8_t withMeta; int8_t withMeta;
char* qmsg; //SubPlanToString char* qmsg; // SubPlanToString
int64_t suid; int64_t suid;
} SMqRebVgReq; } SMqRebVgReq;

View File

@ -1116,9 +1116,7 @@ void cliSend(SCliConn* pConn) {
msgLen = (int32_t)ntohl((uint32_t)(pHead->msgLen)); msgLen = (int32_t)ntohl((uint32_t)(pHead->msgLen));
} }
if ((pHead->msgType > TDMT_VND_TMQ_MSG && pHead->msgType < TDMT_VND_TMQ_MAX_MSG) || if (tmsgIsValid(pHead->msgType)) {
(pHead->msgType > TDMT_MND_MSG && pHead->msgType < TDMT_MND_MAX_MSG) || pHead->msgType == TDMT_VND_SUBMIT ||
pHead->msgType == TDMT_MND_HEARTBEAT) {
char buf[128] = {0}; char buf[128] = {0};
sprintf(buf, "%s", TMSG_INFO(pHead->msgType)); sprintf(buf, "%s", TMSG_INFO(pHead->msgType));
int* count = taosHashGet(pThrd->msgCount, buf, sizeof(buf)); int* count = taosHashGet(pThrd->msgCount, buf, sizeof(buf));
@ -2367,9 +2365,7 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
} }
} }
if ((pResp->msgType - 1 > TDMT_VND_TMQ_MSG && pResp->msgType - 1 < TDMT_VND_TMQ_MAX_MSG) || if (tmsgIsValid(pResp->msgType - 1)) {
(pResp->msgType - 1 > TDMT_MND_MSG && pResp->msgType - 1 < TDMT_MND_MAX_MSG) ||
pResp->msgType - 1 == TDMT_VND_SUBMIT_RSP || pResp->msgType - 1 == TDMT_MND_HEARTBEAT_RSP) {
char buf[128] = {0}; char buf[128] = {0};
sprintf(buf, "%s", TMSG_INFO(pResp->msgType - 1)); sprintf(buf, "%s", TMSG_INFO(pResp->msgType - 1));
int* count = taosHashGet(pThrd->msgCount, buf, sizeof(buf)); int* count = taosHashGet(pThrd->msgCount, buf, sizeof(buf));