take a commit
This commit is contained in:
parent
85218348ab
commit
9acdf1e975
|
@ -17,7 +17,7 @@
|
|||
#define TDENGINE_COMMON_H
|
||||
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tarray.h"
|
||||
#include "tvariant.h"
|
||||
//typedef struct STimeWindow {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define TDENGINE_TEP_H
|
||||
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
typedef struct SCorEpSet {
|
||||
int32_t version;
|
||||
|
|
|
@ -24,125 +24,30 @@ extern "C" {
|
|||
#include "taoserror.h"
|
||||
#include "tdataformat.h"
|
||||
|
||||
// message type
|
||||
#define TD_MSG_NUMBER_
|
||||
#undef TD_MSG_DICT_
|
||||
#undef TD_MSG_INFO_
|
||||
#undef TD_MSG_SEG_CODE_
|
||||
#include "tmsgdef.h"
|
||||
|
||||
#ifdef TAOS_MESSAGE_C
|
||||
#define TAOS_DEFINE_MESSAGE_TYPE( name, msg ) msg, msg "-rsp",
|
||||
char *taosMsg[] = {
|
||||
"null",
|
||||
#else
|
||||
#define TAOS_DEFINE_MESSAGE_TYPE( name, msg ) name, name##_RSP,
|
||||
enum {
|
||||
TSDB_MESSAGE_NULL = 0,
|
||||
#endif
|
||||
#undef TD_MSG_NUMBER_
|
||||
#undef TD_MSG_DICT_
|
||||
#undef TD_MSG_INFO_
|
||||
#define TD_MSG_SEG_CODE_
|
||||
#include "tmsgdef.h"
|
||||
|
||||
// message from client to vnode
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SUBMIT, "submit" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_QUERY, "query" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_FETCH, "fetch" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_TABLE, "create-table" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_TABLE, "drop-table" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_ALTER_TABLE, "alter-table" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_UPDATE_TAG_VAL, "update-tag-val" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_TABLE_META, "table-meta" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_TABLES_META, "tables-meta" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MQ_CONSUME, "mq-consume" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MQ_QUERY, "mq-query" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MQ_CONNECT, "mq-connect" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MQ_DISCONNECT, "mq-disconnect" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MQ_SET_CUR, "mq-set-cur" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_RES_READY, "res-ready" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_TASKS_STATUS, "tasks-status" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CANCEL_TASK, "cancel-task" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_TASK, "drop-task" )
|
||||
#undef TD_MSG_NUMBER_
|
||||
#undef TD_MSG_DICT_
|
||||
#undef TD_MSG_INFO_
|
||||
#undef TD_MSG_SEG_CODE_
|
||||
#include "tmsgdef.h"
|
||||
|
||||
// message from client to mnode
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CONNECT, "connect" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_ACCT, "create-acct" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_ALTER_ACCT, "alter-acct" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_ACCT, "drop-acct" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_USER, "create-user" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_ALTER_USER, "alter-user" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_USER, "drop-user" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_DNODE, "create-dnode" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CONFIG_DNODE, "config-dnode" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_DNODE, "drop-dnode" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_MNODE, "create-mnode" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_MNODE, "drop-mnode" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_DB, "create-db" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_DB, "drop-db" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_USE_DB, "use-db" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_ALTER_DB, "alter-db" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SYNC_DB, "sync-db" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_COMPACT_DB, "compact-db" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_FUNCTION, "create-function" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_RETRIEVE_FUNCTION, "retrieve-function" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_FUNCTION, "drop-function" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_STB, "create-stb" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_ALTER_STB, "alter-stb" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_STB, "drop-stb" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_VGROUP_LIST, "vgroup-list" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_KILL_QUERY, "kill-query" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_KILL_CONN, "kill-conn" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_HEARTBEAT, "heartbeat" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SHOW, "show" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SHOW_RETRIEVE, "retrieve" )
|
||||
// message from client to qnode
|
||||
// message from client to dnode
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_NETWORK_TEST, "nettest" )
|
||||
extern char *tMsgInfo[];
|
||||
extern int tMsgDict[];
|
||||
|
||||
// message from vnode to vnode
|
||||
// message from vnode to mnode
|
||||
// message from vnode to qnode
|
||||
// message from vnode to dnode
|
||||
|
||||
// message from mnode to vnode
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_STB_IN, "create-stb-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_ALTER_STB_IN, "alter-stb-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_STB_IN, "drop-stb-internal" )
|
||||
// message from mnode to mnode
|
||||
// message from mnode to qnode
|
||||
// message from mnode to dnode
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_VNODE_IN, "create-vnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_ALTER_VNODE_IN, "alter-vnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_VNODE_IN, "drop-vnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_AUTH_VNODE_IN, "auth-vnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SYNC_VNODE_IN, "sync-vnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_COMPACT_VNODE_IN, "compact-vnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CREATE_MNODE_IN, "create-mnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_ALTER_MNODE_IN, "alter-mnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DROP_MNODE_IN, "drop-mnode-internal" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CONFIG_DNODE_IN, "config-dnode-internal" )
|
||||
|
||||
// message from qnode to vnode
|
||||
// message from qnode to mnode
|
||||
// message from qnode to qnode
|
||||
// message from qnode to dnode
|
||||
|
||||
// message from dnode to vnode
|
||||
// message from dnode to mnode
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_STATUS, "status" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_GRANT, "grant" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_AUTH, "auth" )
|
||||
// message from dnode to qnode
|
||||
// message from dnode to dnode
|
||||
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY0, "dummy0" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY1, "dummy1" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY2, "dummy2" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY3, "dummy3" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY4, "dummy4" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY5, "dummy5" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY6, "dummy6" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY7, "dummy7" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY8, "dummy8" )
|
||||
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY9, "dummy9" )
|
||||
|
||||
#ifndef TAOS_MESSAGE_C
|
||||
TSDB_MSG_TYPE_MAX // 147
|
||||
#endif
|
||||
|
||||
};
|
||||
#define TMSG_SEG_CODE(TYPE) (((TYPE)&0xff00) >> 8)
|
||||
#define TMSG_SEG_SEQ(TYPE) ((TYPE)&0xff)
|
||||
#define TMSG_INFO(TYPE) tMsgInfo[tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE)]
|
||||
|
||||
// IE type
|
||||
#define TSDB_IE_TYPE_SEC 1
|
||||
|
@ -178,48 +83,46 @@ typedef enum _mgmt_table {
|
|||
TSDB_MGMT_TABLE_MAX,
|
||||
} EShowType;
|
||||
|
||||
#define TSDB_ALTER_TABLE_ADD_TAG_COLUMN 1
|
||||
#define TSDB_ALTER_TABLE_DROP_TAG_COLUMN 2
|
||||
#define TSDB_ALTER_TABLE_ADD_TAG_COLUMN 1
|
||||
#define TSDB_ALTER_TABLE_DROP_TAG_COLUMN 2
|
||||
#define TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN 3
|
||||
#define TSDB_ALTER_TABLE_UPDATE_TAG_VAL 4
|
||||
#define TSDB_ALTER_TABLE_UPDATE_TAG_VAL 4
|
||||
|
||||
#define TSDB_ALTER_TABLE_ADD_COLUMN 5
|
||||
#define TSDB_ALTER_TABLE_DROP_COLUMN 6
|
||||
#define TSDB_ALTER_TABLE_CHANGE_COLUMN 7
|
||||
#define TSDB_ALTER_TABLE_ADD_COLUMN 5
|
||||
#define TSDB_ALTER_TABLE_DROP_COLUMN 6
|
||||
#define TSDB_ALTER_TABLE_CHANGE_COLUMN 7
|
||||
#define TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN 8
|
||||
|
||||
#define TSDB_FILL_NONE 0
|
||||
#define TSDB_FILL_NULL 1
|
||||
#define TSDB_FILL_SET_VALUE 2
|
||||
#define TSDB_FILL_LINEAR 3
|
||||
#define TSDB_FILL_PREV 4
|
||||
#define TSDB_FILL_NEXT 5
|
||||
#define TSDB_FILL_NONE 0
|
||||
#define TSDB_FILL_NULL 1
|
||||
#define TSDB_FILL_SET_VALUE 2
|
||||
#define TSDB_FILL_LINEAR 3
|
||||
#define TSDB_FILL_PREV 4
|
||||
#define TSDB_FILL_NEXT 5
|
||||
|
||||
#define TSDB_ALTER_USER_PASSWD 0x1
|
||||
#define TSDB_ALTER_USER_PASSWD 0x1
|
||||
#define TSDB_ALTER_USER_PRIVILEGES 0x2
|
||||
|
||||
#define TSDB_KILL_MSG_LEN 30
|
||||
#define TSDB_KILL_MSG_LEN 30
|
||||
|
||||
#define TSDB_VN_READ_ACCCESS ((char)0x1)
|
||||
#define TSDB_VN_WRITE_ACCCESS ((char)0x2)
|
||||
#define TSDB_VN_READ_ACCCESS ((char)0x1)
|
||||
#define TSDB_VN_WRITE_ACCCESS ((char)0x2)
|
||||
#define TSDB_VN_ALL_ACCCESS (TSDB_VN_READ_ACCCESS | TSDB_VN_WRITE_ACCCESS)
|
||||
|
||||
#define TSDB_COL_NORMAL 0x0u // the normal column of the table
|
||||
#define TSDB_COL_TAG 0x1u // the tag column type
|
||||
#define TSDB_COL_UDC 0x2u // the user specified normal string column, it is a dummy column
|
||||
#define TSDB_COL_TMP 0x4u // internal column generated by the previous operators
|
||||
#define TSDB_COL_NULL 0x8u // the column filter NULL or not
|
||||
#define TSDB_COL_NORMAL 0x0u // the normal column of the table
|
||||
#define TSDB_COL_TAG 0x1u // the tag column type
|
||||
#define TSDB_COL_UDC 0x2u // the user specified normal string column, it is a dummy column
|
||||
#define TSDB_COL_TMP 0x4u // internal column generated by the previous operators
|
||||
#define TSDB_COL_NULL 0x8u // the column filter NULL or not
|
||||
|
||||
#define TSDB_COL_IS_TAG(f) (((f&(~(TSDB_COL_NULL)))&TSDB_COL_TAG) != 0)
|
||||
#define TSDB_COL_IS_NORMAL_COL(f) ((f&(~(TSDB_COL_NULL))) == TSDB_COL_NORMAL)
|
||||
#define TSDB_COL_IS_UD_COL(f) ((f&(~(TSDB_COL_NULL))) == TSDB_COL_UDC)
|
||||
#define TSDB_COL_REQ_NULL(f) (((f)&TSDB_COL_NULL) != 0)
|
||||
|
||||
extern char *taosMsg[];
|
||||
#define TSDB_COL_IS_TAG(f) (((f & (~(TSDB_COL_NULL))) & TSDB_COL_TAG) != 0)
|
||||
#define TSDB_COL_IS_NORMAL_COL(f) ((f & (~(TSDB_COL_NULL))) == TSDB_COL_NORMAL)
|
||||
#define TSDB_COL_IS_UD_COL(f) ((f & (~(TSDB_COL_NULL))) == TSDB_COL_UDC)
|
||||
#define TSDB_COL_REQ_NULL(f) (((f)&TSDB_COL_NULL) != 0)
|
||||
|
||||
typedef struct SBuildTableMetaInput {
|
||||
int32_t vgId;
|
||||
char *tableFullName;
|
||||
char * tableFullName;
|
||||
} SBuildTableMetaInput;
|
||||
|
||||
typedef struct SBuildUseDBInput {
|
||||
|
@ -227,7 +130,6 @@ typedef struct SBuildUseDBInput {
|
|||
int32_t vgVersion;
|
||||
} SBuildUseDBInput;
|
||||
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
// null-terminated string instead of char array to avoid too many memory consumption in case of more than 1M tableMeta
|
||||
|
@ -312,7 +214,7 @@ typedef struct {
|
|||
char data[];
|
||||
} SMDCreateTableMsg;
|
||||
|
||||
//typedef struct {
|
||||
// typedef struct {
|
||||
// int32_t len; // one create table message
|
||||
// char tableName[TSDB_TABLE_FNAME_LEN];
|
||||
// int16_t numOfColumns;
|
||||
|
@ -442,7 +344,7 @@ typedef struct {
|
|||
int8_t type;
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_PASSWORD_LEN];
|
||||
int8_t superUser; // denote if it is a super user or not
|
||||
int8_t superUser; // denote if it is a super user or not
|
||||
int32_t reserve[8];
|
||||
} SCreateUserMsg, SAlterUserMsg;
|
||||
|
||||
|
@ -578,8 +480,8 @@ typedef struct {
|
|||
int32_t sqlstrLen; // sql query string
|
||||
int32_t prevResultLen; // previous result length
|
||||
int32_t numOfOperator;
|
||||
int32_t tableScanOperator;// table scan operator. -1 means no scan operator
|
||||
int32_t udfNum; // number of udf function
|
||||
int32_t tableScanOperator; // table scan operator. -1 means no scan operator
|
||||
int32_t udfNum; // number of udf function
|
||||
int32_t udfContentOffset;
|
||||
int32_t udfContentLen;
|
||||
SColumnInfo tableCols[];
|
||||
|
@ -882,7 +784,7 @@ typedef struct SMultiTableMeta {
|
|||
typedef struct {
|
||||
int32_t dataLen;
|
||||
char name[TSDB_TABLE_FNAME_LEN];
|
||||
char *data;
|
||||
char * data;
|
||||
} STagData;
|
||||
|
||||
typedef struct {
|
||||
|
@ -917,7 +819,7 @@ typedef struct SShowRsp {
|
|||
} SShowRsp;
|
||||
|
||||
typedef struct {
|
||||
char ep[TSDB_EP_LEN]; // end point, hostname:port
|
||||
char ep[TSDB_EP_LEN]; // end point, hostname:port
|
||||
} SCreateDnodeMsg;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1019,35 +921,27 @@ typedef struct {
|
|||
|
||||
// mq related
|
||||
typedef struct {
|
||||
|
||||
} SMqConnectReq;
|
||||
|
||||
typedef struct {
|
||||
|
||||
} SMqConnectRsp;
|
||||
|
||||
typedef struct {
|
||||
|
||||
} SMqDisconnectReq;
|
||||
|
||||
typedef struct {
|
||||
|
||||
} SMqDisconnectRsp;
|
||||
|
||||
typedef struct {
|
||||
|
||||
} SMqAckReq;
|
||||
|
||||
typedef struct {
|
||||
|
||||
} SMqAckRsp;
|
||||
|
||||
typedef struct {
|
||||
|
||||
} SMqResetReq;
|
||||
|
||||
typedef struct {
|
||||
|
||||
} SMqResetRsp;
|
||||
// mq related end
|
||||
|
||||
|
@ -1104,17 +998,17 @@ typedef struct {
|
|||
} SUpdateTagValRsp;
|
||||
|
||||
typedef struct SSubQueryMsg {
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
uint32_t contentLen;
|
||||
char msg[];
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
uint32_t contentLen;
|
||||
char msg[];
|
||||
} SSubQueryMsg;
|
||||
|
||||
typedef struct SResReadyMsg {
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
} SResReadyMsg;
|
||||
|
||||
typedef struct SResReadyRsp {
|
||||
|
@ -1122,19 +1016,19 @@ typedef struct SResReadyRsp {
|
|||
} SResReadyRsp;
|
||||
|
||||
typedef struct SResFetchMsg {
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
} SResFetchMsg;
|
||||
|
||||
typedef struct SSchTasksStatusMsg {
|
||||
uint64_t schedulerId;
|
||||
uint64_t schedulerId;
|
||||
} SSchTasksStatusMsg;
|
||||
|
||||
typedef struct STaskStatus {
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
int8_t status;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
int8_t status;
|
||||
} STaskStatus;
|
||||
|
||||
typedef struct SSchedulerStatusRsp {
|
||||
|
@ -1142,11 +1036,10 @@ typedef struct SSchedulerStatusRsp {
|
|||
STaskStatus status[];
|
||||
} SSchedulerStatusRsp;
|
||||
|
||||
|
||||
typedef struct STaskCancelMsg {
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
} STaskCancelMsg;
|
||||
|
||||
typedef struct STaskCancelRsp {
|
||||
|
@ -1154,16 +1047,15 @@ typedef struct STaskCancelRsp {
|
|||
} STaskCancelRsp;
|
||||
|
||||
typedef struct STaskDropMsg {
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
uint64_t schedulerId;
|
||||
uint64_t queryId;
|
||||
uint64_t taskId;
|
||||
} STaskDropMsg;
|
||||
|
||||
typedef struct STaskDropRsp {
|
||||
int32_t code;
|
||||
} STaskDropRsp;
|
||||
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
||||
*
|
||||
* This program is free software: you can use, redistribute, and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3
|
||||
* or later ("AGPL"), as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#undef TD_MSG_INFO_
|
||||
#undef TD_MSG_NUMBER_
|
||||
#undef TD_MSG_DICT_
|
||||
#undef TD_MSG_SEG_CODE_
|
||||
#endif
|
||||
|
||||
#if defined(TD_MSG_INFO_)
|
||||
|
||||
#define TD_NEW_MSG_SEG(TYPE) "null",
|
||||
#define TD_DEF_MSG_TYPE(TYPE, MSG, REQ, RSP) MSG, MSG "-rsp",
|
||||
|
||||
char *tMsgInfo[] = {
|
||||
|
||||
#elif defined(TD_MSG_NUMBER_)
|
||||
|
||||
#define TD_NEW_MSG_SEG(TYPE) TYPE##_NUM,
|
||||
#define TD_DEF_MSG_TYPE(TYPE, MSG, REQ, RSP) TYPE##_NUM, TYPE##_RSP_NUM,
|
||||
|
||||
enum {
|
||||
|
||||
#elif defined(TD_MSG_DICT_)
|
||||
|
||||
#define TD_NEW_MSG_SEG(TYPE) TYPE##_NUM,
|
||||
#define TD_DEF_MSG_TYPE(TYPE, MSG, REQ, RSP)
|
||||
|
||||
int tMsgDict[] = {
|
||||
|
||||
#elif defined(TD_MSG_SEG_CODE_)
|
||||
|
||||
#define TD_NEW_MSG_SEG(TYPE) TYPE##_SEG_CODE,
|
||||
#define TD_DEF_MSG_TYPE(TYPE, MSG, REQ, RSP)
|
||||
|
||||
enum {
|
||||
|
||||
#else
|
||||
|
||||
#define TD_NEW_MSG_SEG(TYPE) TYPE = ((TYPE##_SEG_CODE) << 8),
|
||||
#define TD_DEF_MSG_TYPE(TYPE, MSG, REQ, RSP) TYPE, TYPE##_RSP,
|
||||
|
||||
enum {
|
||||
#endif
|
||||
// Requests handled by DNODE
|
||||
TD_NEW_MSG_SEG(TDMT_DND_MSG)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_NETWORK_TEST, "dnode-nettest", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_CREATE_VNODE, "dnode-create-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_ALTER_VNODE, "dnode-alter-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_DROP_VNODE, "dnode-drop-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_AUTH_VNODE, "dnode-auth-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_SYNC_VNODE, "dnode-sync-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_COMPACT_VNODE, "dnode-compact-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_CREATE_MNODE, "dnode-create-mnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_ALTER_MNODE, "dnode-alter-mnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_DROP_MNODE, "dnode-drop-mnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_CONFIG_DNODE, "dnode-config-dnode", NULL, NULL)
|
||||
|
||||
// Requests handled by MNODE
|
||||
TD_NEW_MSG_SEG(TDMT_MND_MSG)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CONNECT, "mnode-connect", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CREATE_TABLE, "mnode-create-table", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_DROP_TABLE, "mnode-drop-table", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CREATE_ACCT, "mnode-create-acct", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_ALTER_ACCT, "mnode-alter-acct", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_DROP_ACCT, "mnode-drop-acct", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CREATE_USER, "mnode-create-user", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_ALTER_USER, "mnode-alter-user", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_DROP_USER, "mnode-drop-user", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CREATE_DNODE, "mnode-create-dnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CONFIG_DNODE, "mnode-config-dnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_DROP_DNODE, "mnode-drop-dnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CREATE_MNODE, "mnode-create-mnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_DROP_MNODE, "mnode-drop-mnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CREATE_DB, "mnode-create-db", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_DROP_DB, "mnode-drop-db", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_USE_DB, "mnode-use-db", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_ALTER_DB, "mnode-alter-db", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_SYNC_DB, "mnode-sync-db", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_COMPACT_DB, "mnode-compact-db", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CREATE_FUNCTION, "mnode-create-function", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_RETRIEVE_FUNCTION, "mnode-retrieve-function", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_DROP_FUNCTION, "mnode-drop-function", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_CREATE_STB, "mnode-create-stb", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_ALTER_STB, "mnode-alter-stb", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_DROP_STB, "mnode-drop-stb", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_VGROUP_LIST, "mnode-vgroup-list", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_KILL_QUERY, "mnode-kill-query", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_KILL_CONN, "mnode-kill-conn", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_HEARTBEAT, "mnode-heartbeat", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_SHOW, "mnode-show", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_MND_SHOW_RETRIEVE, "mnode-retrieve", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TSDB_MSG_TYPE_STATUS, "mnode-status", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TSDB_MSG_TYPE_GRANT, "mnode-grant", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TSDB_MSG_TYPE_AUTH, "mnode-auth", NULL, NULL)
|
||||
|
||||
// Requests handled by VNODE
|
||||
TD_NEW_MSG_SEG(TDMT_VND_MSG)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_SUBMIT, "vnode-submit", SSubmitReq, SSubmitRsp)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_QUERY, "vnode-query", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_FETCH, "vnode-fetch", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_ALTER_TABLE, "vnode-alter-table", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_UPDATE_TAG_VAL, "vnode-update-tag-val", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_TABLE_META, "vnode-table-meta", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_TABLES_META, "vnode-tables-meta", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_MQ_CONSUME, "vnode-mq-consume", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_MQ_QUERY, "vnode-mq-query", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_MQ_CONNECT, "vnode-mq-connect", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_MQ_DISCONNECT, "vnode-mq-disconnect", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_MQ_SET_CUR, "vnode-mq-set-cur", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_RES_READY, "vnode-res-ready", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_TASKS_STATUS, "vnode-tasks-status", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_CANCEL_TASK, "vnode-cancel-task", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_DROP_TASK, "vnode-drop-task", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_CREATE_STB, "vnode-create-stb", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_ALTER_STB, "vnode-alter-stb", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_VND_DROP_STB, "vnode-drop-stb", NULL, NULL)
|
||||
|
||||
// Requests handled by QNODE
|
||||
TD_NEW_MSG_SEG(TDMT_QND_MSG)
|
||||
|
||||
// Requests handled by SNODE
|
||||
TD_NEW_MSG_SEG(TDMT_SND_MSG)
|
||||
|
||||
#if defined(TD_MSG_NUMBER_)
|
||||
TDMT_MAX
|
||||
#endif
|
||||
};
|
|
@ -21,7 +21,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#define TIME_IS_VAR_DURATION(_t) ((_t) == 'n' || (_t) == 'y' || (_t) == 'N' || (_t) == 'Y')
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "mallocator.h"
|
||||
#include "os.h"
|
||||
#include "taoserror.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tlist.h"
|
||||
#include "trpc.h"
|
||||
#include "ttimer.h"
|
||||
|
|
|
@ -26,7 +26,7 @@ extern "C" {
|
|||
#include "taosdef.h"
|
||||
#include "transport.h"
|
||||
#include "common.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "query.h"
|
||||
|
||||
struct SCatalog;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#define QUERY_TYPE_MERGE 1
|
||||
#define QUERY_TYPE_PARTIAL 2
|
||||
|
|
|
@ -112,8 +112,8 @@ int32_t taosAsyncExec(__async_exec_fn_t execFn, void* execParam, int32_t* code);
|
|||
SSchema* tGetTbnameColumnSchema();
|
||||
void initQueryModuleMsgHandle();
|
||||
|
||||
extern int32_t (*queryBuildMsg[TSDB_MSG_TYPE_MAX])(void* input, char **msg, int32_t msgSize, int32_t *msgLen);
|
||||
extern int32_t (*queryProcessMsgRsp[TSDB_MSG_TYPE_MAX])(void* output, char *msg, int32_t msgSize);
|
||||
extern int32_t (*queryBuildMsg[TDMT_MAX])(void* input, char **msg, int32_t msgSize, int32_t *msgLen);
|
||||
extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char *msg, int32_t msgSize);
|
||||
|
||||
#define qFatal(...) do { if (qDebugFlag & DEBUG_FATAL) { taosPrintLog("QRY FATAL ", qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
#define qError(...) do { if (qDebugFlag & DEBUG_ERROR) { taosPrintLog("QRY ERROR ", qDebugFlag, __VA_ARGS__); }} while(0)
|
||||
|
|
|
@ -22,7 +22,7 @@ extern "C" {
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#define TAOS_CONN_SERVER 0
|
||||
#define TAOS_CONN_CLIENT 1
|
||||
|
|
|
@ -22,7 +22,7 @@ extern "C" {
|
|||
|
||||
#include "taos.h"
|
||||
#include "common.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tdef.h"
|
||||
#include "tep.h"
|
||||
#include "thash.h"
|
||||
|
@ -140,7 +140,7 @@ extern int32_t tscReqRef;
|
|||
extern int32_t tscConnRef;
|
||||
|
||||
SRequestMsgBody buildRequestMsgImpl(SRequestObj *pRequest);
|
||||
extern int (*handleRequestRspFp[TSDB_MSG_TYPE_MAX])(SRequestObj *pRequest, const char* pMsg, int32_t msgLen);
|
||||
extern int (*handleRequestRspFp[TDMT_MAX])(SRequestObj *pRequest, const char* pMsg, int32_t msgLen);
|
||||
|
||||
int taos_init();
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "clientLog.h"
|
||||
#include "os.h"
|
||||
#include "query.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tcache.h"
|
||||
#include "tconfig.h"
|
||||
#include "tglobal.h"
|
||||
|
|
|
@ -114,10 +114,10 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass,
|
|||
}
|
||||
|
||||
static bool supportedQueryType(int32_t type) {
|
||||
return (type == TSDB_MSG_TYPE_CREATE_USER || type == TSDB_MSG_TYPE_SHOW || type == TSDB_MSG_TYPE_DROP_USER ||
|
||||
type == TSDB_MSG_TYPE_DROP_ACCT || type == TSDB_MSG_TYPE_CREATE_DB || type == TSDB_MSG_TYPE_CREATE_ACCT ||
|
||||
type == TSDB_MSG_TYPE_CREATE_TABLE || type == TSDB_MSG_TYPE_CREATE_STB || type == TSDB_MSG_TYPE_USE_DB ||
|
||||
type == TSDB_MSG_TYPE_DROP_DB || type == TSDB_MSG_TYPE_DROP_STB);
|
||||
return (type == TDMT_MND_CREATE_USER || type == TDMT_MND_SHOW || type == TDMT_MND_DROP_USER ||
|
||||
type == TDMT_MND_DROP_ACCT || type == TDMT_MND_CREATE_DB || type == TDMT_MND_CREATE_ACCT ||
|
||||
type == TDMT_MND_CREATE_TABLE || type == TDMT_MND_CREATE_STB || type == TDMT_MND_USE_DB ||
|
||||
type == TDMT_MND_DROP_DB || type == TDMT_MND_DROP_STB);
|
||||
}
|
||||
|
||||
TAOS_RES *taos_query_l(TAOS *taos, const char *sql, int sqlLen) {
|
||||
|
@ -169,7 +169,7 @@ TAOS_RES *taos_query_l(TAOS *taos, const char *sql, int sqlLen) {
|
|||
SRequestMsgBody body = buildRequestMsgImpl(pRequest);
|
||||
SEpSet* pEpSet = &pTscObj->pAppInfo->mgmtEp.epSet;
|
||||
|
||||
if (pDcl->msgType == TSDB_MSG_TYPE_CREATE_TABLE) {
|
||||
if (pDcl->msgType == TDMT_MND_CREATE_TABLE) {
|
||||
struct SCatalog* pCatalog = NULL;
|
||||
|
||||
char buf[12] = {0};
|
||||
|
@ -263,7 +263,7 @@ STscObj* taosConnectImpl(const char *ip, const char *user, const char *auth, con
|
|||
return pTscObj;
|
||||
}
|
||||
|
||||
SRequestObj *pRequest = createRequest(pTscObj, fp, param, TSDB_MSG_TYPE_CONNECT);
|
||||
SRequestObj *pRequest = createRequest(pTscObj, fp, param, TDMT_MND_CONNECT);
|
||||
if (pRequest == NULL) {
|
||||
destroyTscObj(pTscObj);
|
||||
terrno = TSDB_CODE_TSC_OUT_OF_MEMORY;
|
||||
|
@ -295,7 +295,7 @@ STscObj* taosConnectImpl(const char *ip, const char *user, const char *auth, con
|
|||
}
|
||||
|
||||
static int32_t buildConnectMsg(SRequestObj *pRequest, SRequestMsgBody* pMsgBody) {
|
||||
pMsgBody->msgType = TSDB_MSG_TYPE_CONNECT;
|
||||
pMsgBody->msgType = TDMT_MND_CONNECT;
|
||||
pMsgBody->msgInfo.len = sizeof(SConnectMsg);
|
||||
pMsgBody->requestObjRefId = pRequest->self;
|
||||
|
||||
|
@ -327,7 +327,7 @@ static void destroyRequestMsgBody(SRequestMsgBody* pMsgBody) {
|
|||
int32_t sendMsgToServer(void *pTransporter, SEpSet* epSet, const SRequestMsgBody *pBody, int64_t* pTransporterId) {
|
||||
char *pMsg = rpcMallocCont(pBody->msgInfo.len);
|
||||
if (NULL == pMsg) {
|
||||
tscError("0x%"PRIx64" msg:%s malloc failed", pBody->requestId, taosMsg[pBody->msgType]);
|
||||
tscError("0x%"PRIx64" msg:%s malloc failed", pBody->requestId, TMSG_INFO(pBody->msgType));
|
||||
terrno = TSDB_CODE_TSC_OUT_OF_MEMORY;
|
||||
return -1;
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
|
|||
* The actual inserted number of points is the first number.
|
||||
*/
|
||||
if (pMsg->code == TSDB_CODE_SUCCESS) {
|
||||
tscDebug("0x%" PRIx64 " message:%s, code:%s rspLen:%d, elapsed:%"PRId64 " ms", pRequest->requestId, taosMsg[pMsg->msgType],
|
||||
tscDebug("0x%" PRIx64 " message:%s, code:%s rspLen:%d, elapsed:%"PRId64 " ms", pRequest->requestId, TMSG_INFO(pMsg->msgType),
|
||||
tstrerror(pMsg->code), pMsg->contLen, pRequest->metric.rsp - pRequest->metric.start);
|
||||
if (handleRequestRspFp[pRequest->type]) {
|
||||
char *p = malloc(pMsg->contLen);
|
||||
|
@ -385,7 +385,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
tscError("0x%" PRIx64 " SQL cmd:%s, code:%s rspLen:%d, elapsed time:%"PRId64" ms", pRequest->requestId, taosMsg[pMsg->msgType],
|
||||
tscError("0x%" PRIx64 " SQL cmd:%s, code:%s rspLen:%d, elapsed time:%"PRId64" ms", pRequest->requestId, TMSG_INFO(pMsg->msgType),
|
||||
tstrerror(pMsg->code), pMsg->contLen, pRequest->metric.rsp - pRequest->metric.start);
|
||||
}
|
||||
|
||||
|
@ -427,7 +427,7 @@ void* doFetchRow(SRequestObj* pRequest) {
|
|||
SReqResultInfo* pResultInfo = &pRequest->body.resInfo;
|
||||
|
||||
if (pResultInfo->pData == NULL || pResultInfo->current >= pResultInfo->numOfRows) {
|
||||
pRequest->type = TSDB_MSG_TYPE_SHOW_RETRIEVE;
|
||||
pRequest->type = TDMT_MND_SHOW_RETRIEVE;
|
||||
|
||||
SRequestMsgBody body = buildRequestMsgImpl(pRequest);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "clientInt.h"
|
||||
#include "clientLog.h"
|
||||
#include "query.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tglobal.h"
|
||||
#include "tref.h"
|
||||
#include "trpc.h"
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
#include "tmsgtype.h"
|
||||
#include "trpc.h"
|
||||
|
||||
int (*handleRequestRspFp[TSDB_MSG_TYPE_MAX])(SRequestObj *pRequest, const char* pMsg, int32_t msgLen);
|
||||
int (*handleRequestRspFp[TDMT_MAX])(SRequestObj *pRequest, const char* pMsg, int32_t msgLen);
|
||||
|
||||
int32_t buildConnectMsg(SRequestObj *pRequest, SRequestMsgBody* pMsgBody) {
|
||||
pMsgBody->msgType = TSDB_MSG_TYPE_CONNECT;
|
||||
pMsgBody->msgType = TDMT_MND_CONNECT;
|
||||
pMsgBody->msgInfo.len = sizeof(SConnectMsg);
|
||||
pMsgBody->requestObjRefId = pRequest->self;
|
||||
|
||||
|
@ -87,7 +87,7 @@ int processConnectRsp(SRequestObj *pRequest, const char* pMsg, int32_t msgLen) {
|
|||
}
|
||||
|
||||
static int32_t buildRetrieveMnodeMsg(SRequestObj *pRequest, SRequestMsgBody* pMsgBody) {
|
||||
pMsgBody->msgType = TSDB_MSG_TYPE_SHOW_RETRIEVE;
|
||||
pMsgBody->msgType = TDMT_MND_SHOW_RETRIEVE;
|
||||
pMsgBody->msgInfo.len = sizeof(SRetrieveTableMsg);
|
||||
pMsgBody->requestObjRefId = pRequest->self;
|
||||
|
||||
|
@ -102,7 +102,7 @@ static int32_t buildRetrieveMnodeMsg(SRequestObj *pRequest, SRequestMsgBody* pMs
|
|||
}
|
||||
|
||||
SRequestMsgBody buildRequestMsgImpl(SRequestObj *pRequest) {
|
||||
if (pRequest->type == TSDB_MSG_TYPE_SHOW_RETRIEVE) {
|
||||
if (pRequest->type == TDMT_MND_SHOW_RETRIEVE) {
|
||||
SRequestMsgBody body = {0};
|
||||
buildRetrieveMnodeMsg(pRequest, &body);
|
||||
return body;
|
||||
|
@ -273,11 +273,11 @@ void initMsgHandleFp() {
|
|||
tscProcessMsgRsp[TSDB_SQL_SHOW_CREATE_DATABASE] = tscProcessShowCreateRsp;
|
||||
#endif
|
||||
|
||||
handleRequestRspFp[TSDB_MSG_TYPE_CONNECT] = processConnectRsp;
|
||||
handleRequestRspFp[TSDB_MSG_TYPE_SHOW] = processShowRsp;
|
||||
handleRequestRspFp[TSDB_MSG_TYPE_SHOW_RETRIEVE] = processRetrieveMnodeRsp;
|
||||
handleRequestRspFp[TSDB_MSG_TYPE_CREATE_DB] = processCreateDbRsp;
|
||||
handleRequestRspFp[TSDB_MSG_TYPE_USE_DB] = processUseDbRsp;
|
||||
handleRequestRspFp[TSDB_MSG_TYPE_CREATE_TABLE] = processCreateTableRsp;
|
||||
handleRequestRspFp[TSDB_MSG_TYPE_DROP_DB] = processDropDbRsp;
|
||||
handleRequestRspFp[TDMT_MND_CONNECT] = processConnectRsp;
|
||||
handleRequestRspFp[TDMT_MND_SHOW] = processShowRsp;
|
||||
handleRequestRspFp[TDMT_MND_SHOW_RETRIEVE] = processRetrieveMnodeRsp;
|
||||
handleRequestRspFp[TDMT_MND_CREATE_DB] = processCreateDbRsp;
|
||||
handleRequestRspFp[TDMT_MND_USE_DB] = processUseDbRsp;
|
||||
handleRequestRspFp[TDMT_MND_CREATE_TABLE] = processCreateTableRsp;
|
||||
handleRequestRspFp[TDMT_MND_DROP_DB] = processDropDbRsp;
|
||||
}
|
|
@ -13,8 +13,16 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define TAOS_MESSAGE_C
|
||||
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#undef TD_MSG_NUMBER_
|
||||
#undef TD_MSG_DICT_
|
||||
#define TD_MSG_INFO_
|
||||
#undef TD_MSG_SEG_CODE_
|
||||
#include "tmsgdef.h"
|
||||
|
||||
#undef TD_MSG_NUMBER_
|
||||
#undef TD_MSG_INFO_
|
||||
#define TD_MSG_DICT_
|
||||
#undef TD_MSG_SEG_CODE_
|
||||
#include "tmsgdef.h"
|
|
@ -2,7 +2,7 @@
|
|||
#include "tutil.h"
|
||||
|
||||
#include "tname.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#define VALID_NAME_TYPE(x) ((x) == TSDB_DB_NAME_T || (x) == TSDB_TABLE_NAME_T)
|
||||
|
||||
|
|
|
@ -16,3 +16,13 @@ TARGET_INCLUDE_DIRECTORIES(
|
|||
PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/common/"
|
||||
PRIVATE "${CMAKE_SOURCE_DIR}/source/libs/common/inc"
|
||||
)
|
||||
|
||||
# tmsg test
|
||||
add_executable(tmsgTest "")
|
||||
target_sources(tmsgTest
|
||||
PRIVATE
|
||||
"tmsgTest.cpp"
|
||||
"../src/taosmsg.c"
|
||||
)
|
||||
target_include_directories(tmsgTest PUBLIC "${CMAKE_SOURCE_DIR}/include/common/")
|
||||
target_link_libraries(tmsgTest PUBLIC os util gtest gtest_main)
|
|
@ -0,0 +1,11 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "tmsg.h"
|
||||
|
||||
TEST(td_msg_test, simple_msg_test) {
|
||||
// std::cout << TMSG_INFO(TDMT_VND_DROP_TABLE) << std::endl;
|
||||
// std::cout << TMSG_INFO(TDMT_MND_DROP_SUPER_TABLE) << std::endl;
|
||||
// std::cout << TMSG_INFO(TDMT_MND_CREATE_SUPER_TABLE) << std::endl;
|
||||
}
|
|
@ -22,7 +22,7 @@ extern "C" {
|
|||
|
||||
#include "cJSON.h"
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "thash.h"
|
||||
#include "tlockfree.h"
|
||||
#include "tlog.h"
|
||||
|
@ -105,7 +105,7 @@ typedef struct {
|
|||
typedef struct {
|
||||
void *serverRpc;
|
||||
void *clientRpc;
|
||||
DndMsgFp msgFp[TSDB_MSG_TYPE_MAX];
|
||||
DndMsgFp msgFp[TDMT_MAX];
|
||||
} STransMgmt;
|
||||
|
||||
typedef struct SDnode {
|
||||
|
|
|
@ -68,7 +68,7 @@ void dndSendRedirectMsg(SDnode *pDnode, SRpcMsg *pMsg) {
|
|||
SEpSet epSet = {0};
|
||||
dndGetMnodeEpSet(pDnode, &epSet);
|
||||
|
||||
dDebug("RPC %p, msg:%s is redirected, num:%d inUse:%d", pMsg->handle, taosMsg[msgType], epSet.numOfEps, epSet.inUse);
|
||||
dDebug("RPC %p, msg:%s is redirected, num:%d inUse:%d", pMsg->handle, TMSG_INFO(msgType), epSet.numOfEps, epSet.inUse);
|
||||
for (int32_t i = 0; i < epSet.numOfEps; ++i) {
|
||||
dDebug("mnode index:%d %s:%u", i, epSet.fqdn[i], epSet.port[i]);
|
||||
if (strcmp(epSet.fqdn[i], pDnode->opt.localFqdn) == 0 && epSet.port[i] == pDnode->opt.serverPort) {
|
||||
|
@ -369,7 +369,7 @@ void dndSendStatusMsg(SDnode *pDnode) {
|
|||
dndGetVnodeLoads(pDnode, &pStatus->vnodeLoads);
|
||||
contLen = sizeof(SStatusMsg) + pStatus->vnodeLoads.num * sizeof(SVnodeLoad);
|
||||
|
||||
SRpcMsg rpcMsg = {.pCont = pStatus, .contLen = contLen, .msgType = TSDB_MSG_TYPE_STATUS};
|
||||
SRpcMsg rpcMsg = {.pCont = pStatus, .contLen = contLen, .msgType = TDMT_MND_STATUS};
|
||||
pMgmt->statusSent = 1;
|
||||
|
||||
dTrace("pDnode:%p, send status msg to mnode", pDnode);
|
||||
|
@ -556,14 +556,14 @@ void dndCleanupDnode(SDnode *pDnode) {
|
|||
|
||||
void dndProcessDnodeReq(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
||||
switch (pMsg->msgType) {
|
||||
case TSDB_MSG_TYPE_NETWORK_TEST:
|
||||
case TDMT_DND_NETWORK_TEST:
|
||||
dndProcessStartupReq(pDnode, pMsg);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_CONFIG_DNODE_IN:
|
||||
case TDMT_DND_CONFIG_DNODE:
|
||||
dndProcessConfigDnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
default:
|
||||
dError("RPC %p, dnode req:%s not processed", pMsg->handle, taosMsg[pMsg->msgType]);
|
||||
dError("RPC %p, dnode req:%s not processed", pMsg->handle, TMSG_INFO(pMsg->msgType));
|
||||
SRpcMsg rspMsg = {.handle = pMsg->handle, .code = TSDB_CODE_MSG_NOT_PROCESSED};
|
||||
rpcSendResponse(&rspMsg);
|
||||
}
|
||||
|
@ -574,17 +574,17 @@ void dndProcessDnodeReq(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
|||
|
||||
void dndProcessDnodeRsp(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
||||
switch (pMsg->msgType) {
|
||||
case TSDB_MSG_TYPE_STATUS_RSP:
|
||||
case TDMT_MND_STATUS_RSP:
|
||||
dndProcessStatusRsp(pDnode, pMsg, pEpSet);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_AUTH_RSP:
|
||||
case TDMT_MND_AUTH_RSP:
|
||||
dndProcessAuthRsp(pDnode, pMsg, pEpSet);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_GRANT_RSP:
|
||||
case TDMT_MND_GRANT_RSP:
|
||||
dndProcessGrantRsp(pDnode, pMsg, pEpSet);
|
||||
break;
|
||||
default:
|
||||
dError("RPC %p, dnode rsp:%s not processed", pMsg->handle, taosMsg[pMsg->msgType]);
|
||||
dError("RPC %p, dnode rsp:%s not processed", pMsg->handle, TMSG_INFO(pMsg->msgType));
|
||||
}
|
||||
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
|
|
|
@ -552,13 +552,13 @@ static void dndProcessMnodeMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) {
|
|||
int32_t code = 0;
|
||||
|
||||
switch (pMsg->msgType) {
|
||||
case TSDB_MSG_TYPE_CREATE_MNODE_IN:
|
||||
case TDMT_DND_CREATE_MNODE:
|
||||
code = dndProcessCreateMnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_ALTER_MNODE_IN:
|
||||
case TDMT_DND_ALTER_MNODE:
|
||||
code = dndProcessAlterMnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_DROP_MNODE_IN:
|
||||
case TDMT_DND_DROP_MNODE:
|
||||
code = dndProcessDropMnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -31,97 +31,97 @@
|
|||
|
||||
static void dndInitMsgFp(STransMgmt *pMgmt) {
|
||||
// msg from client to dnode
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_SUBMIT] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_QUERY] = dndProcessVnodeQueryMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_FETCH] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_TABLE] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_TABLE] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_TABLE] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_UPDATE_TAG_VAL] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_TABLE_META] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_TABLES_META] = dndProcessVnodeQueryMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_MQ_QUERY] = dndProcessVnodeQueryMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_MQ_CONSUME] = dndProcessVnodeQueryMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_MQ_CONNECT] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_MQ_DISCONNECT] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_MQ_SET_CUR] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_RES_READY] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_TASKS_STATUS] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CANCEL_TASK] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_TASK] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TDMT_VND_SUBMIT] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_QUERY] = dndProcessVnodeQueryMsg;
|
||||
pMgmt->msgFp[TDMT_VND_FETCH] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CREATE_TABLE] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_DROP_TABLE] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_ALTER_TABLE] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_UPDATE_TAG_VAL] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_TABLE_META] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TDMT_VND_TABLES_META] = dndProcessVnodeQueryMsg;
|
||||
pMgmt->msgFp[TDMT_VND_MQ_QUERY] = dndProcessVnodeQueryMsg;
|
||||
pMgmt->msgFp[TDMT_VND_MQ_CONSUME] = dndProcessVnodeQueryMsg;
|
||||
pMgmt->msgFp[TDMT_VND_MQ_CONNECT] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_MQ_DISCONNECT] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_MQ_SET_CUR] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_RES_READY] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TDMT_VND_TASKS_STATUS] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TDMT_VND_CANCEL_TASK] = dndProcessVnodeFetchMsg;
|
||||
pMgmt->msgFp[TDMT_VND_DROP_TASK] = dndProcessVnodeFetchMsg;
|
||||
|
||||
// msg from client to mnode
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CONNECT] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_ACCT] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_ACCT] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_ACCT] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_USER] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_USER] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_USER] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_DNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CONFIG_DNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_DNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_MNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_MNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_USE_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_SYNC_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_COMPACT_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_FUNCTION] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_RETRIEVE_FUNCTION] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_FUNCTION] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_STB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_STB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_STB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_VGROUP_LIST] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_KILL_QUERY] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_KILL_CONN] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_HEARTBEAT] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_SHOW] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_SHOW_RETRIEVE] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CONNECT] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CREATE_ACCT] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_ALTER_ACCT] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_DROP_ACCT] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CREATE_USER] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_ALTER_USER] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_DROP_USER] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CREATE_DNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CONFIG_DNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_DROP_DNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CREATE_MNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_DROP_MNODE] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CREATE_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_DROP_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_USE_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_ALTER_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_SYNC_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_COMPACT_DB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CREATE_FUNCTION] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_RETRIEVE_FUNCTION] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_DROP_FUNCTION] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_CREATE_STB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_ALTER_STB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_DROP_STB] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_VGROUP_LIST] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TDMT_MND_KILL_QUERY] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_KILL_CONN] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_HEARTBEAT] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TDMT_MND_SHOW] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TDMT_MND_SHOW_RETRIEVE] = dndProcessMnodeReadMsg;
|
||||
|
||||
// message from client to dnode
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_NETWORK_TEST] = dndProcessDnodeReq;
|
||||
pMgmt->msgFp[TDMT_DND_NETWORK_TEST] = dndProcessDnodeReq;
|
||||
|
||||
// message from mnode to vnode
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_STB_IN] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_STB_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_STB_IN] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_STB_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_STB_IN] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_STB_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_CREATE_STB] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_CREATE_STB_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_ALTER_STB] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_ALTER_STB_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_DROP_STB] = dndProcessVnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_VND_DROP_STB_RSP] = dndProcessMnodeWriteMsg;
|
||||
|
||||
// message from mnode to dnode
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_VNODE_IN] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_VNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_VNODE_IN] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_VNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_VNODE_IN] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_VNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_SYNC_VNODE_IN] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_SYNC_VNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_AUTH_VNODE_IN] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_AUTH_VNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_COMPACT_VNODE_IN] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_COMPACT_VNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_MNODE_IN] = dndProcessMnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CREATE_MNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_MNODE_IN] = dndProcessMnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_ALTER_MNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_MNODE_IN] = dndProcessMnodeMgmtMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_DROP_MNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CONFIG_DNODE_IN] = dndProcessDnodeReq;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_CONFIG_DNODE_IN_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_CREATE_VNODE] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_CREATE_VNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_ALTER_VNODE] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_ALTER_VNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_DROP_VNODE] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_DROP_VNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_SYNC_VNODE] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_SYNC_VNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_AUTH_VNODE] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_AUTH_VNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_COMPACT_VNODE] = dndProcessVnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_COMPACT_VNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_CREATE_MNODE] = dndProcessMnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_CREATE_MNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_ALTER_MNODE] = dndProcessMnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_ALTER_MNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_DROP_MNODE] = dndProcessMnodeMgmtMsg;
|
||||
pMgmt->msgFp[TDMT_DND_DROP_MNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_DND_CONFIG_DNODE] = dndProcessDnodeReq;
|
||||
pMgmt->msgFp[TDMT_DND_CONFIG_DNODE_RSP] = dndProcessMnodeWriteMsg;
|
||||
|
||||
// message from dnode to mnode
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_GRANT] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_GRANT_RSP] = dndProcessDnodeRsp;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_STATUS] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_STATUS_RSP] = dndProcessDnodeRsp;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_AUTH] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TSDB_MSG_TYPE_AUTH_RSP] = dndProcessDnodeRsp;
|
||||
pMgmt->msgFp[TDMT_MND_GRANT] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_GRANT_RSP] = dndProcessDnodeRsp;
|
||||
pMgmt->msgFp[TDMT_MND_STATUS] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TDMT_MND_STATUS_RSP] = dndProcessDnodeRsp;
|
||||
pMgmt->msgFp[TDMT_MND_AUTH] = dndProcessMnodeReadMsg;
|
||||
pMgmt->msgFp[TDMT_MND_AUTH_RSP] = dndProcessDnodeRsp;
|
||||
}
|
||||
|
||||
static void dndProcessResponse(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
||||
|
@ -132,7 +132,7 @@ static void dndProcessResponse(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
|||
|
||||
if (dndGetStat(pDnode) == DND_STAT_STOPPED) {
|
||||
if (pMsg == NULL || pMsg->pCont == NULL) return;
|
||||
dTrace("RPC %p, rsp:%s is ignored since dnode is stopping", pMsg->handle, taosMsg[msgType]);
|
||||
dTrace("RPC %p, rsp:%s is ignored since dnode is stopping", pMsg->handle, TMSG_INFO(msgType));
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
return;
|
||||
}
|
||||
|
@ -140,9 +140,9 @@ static void dndProcessResponse(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
|||
DndMsgFp fp = pMgmt->msgFp[msgType];
|
||||
if (fp != NULL) {
|
||||
(*fp)(pDnode, pMsg, pEpSet);
|
||||
dTrace("RPC %p, rsp:%s is processed, code:0x%x", pMsg->handle, taosMsg[msgType], pMsg->code & 0XFFFF);
|
||||
dTrace("RPC %p, rsp:%s is processed, code:0x%x", pMsg->handle, TMSG_INFO(msgType), pMsg->code & 0XFFFF);
|
||||
} else {
|
||||
dError("RPC %p, rsp:%s not processed", pMsg->handle, taosMsg[msgType]);
|
||||
dError("RPC %p, rsp:%s not processed", pMsg->handle, TMSG_INFO(msgType));
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
}
|
||||
}
|
||||
|
@ -187,20 +187,20 @@ static void dndProcessRequest(void *param, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
|||
STransMgmt *pMgmt = &pDnode->tmgmt;
|
||||
|
||||
int32_t msgType = pMsg->msgType;
|
||||
if (msgType == TSDB_MSG_TYPE_NETWORK_TEST) {
|
||||
if (msgType == TDMT_DND_NETWORK_TEST) {
|
||||
dTrace("RPC %p, network test req, app:%p will be processed, code:0x%x", pMsg->handle, pMsg->ahandle, pMsg->code);
|
||||
dndProcessDnodeReq(pDnode, pMsg, pEpSet);
|
||||
return;
|
||||
}
|
||||
|
||||
if (dndGetStat(pDnode) == DND_STAT_STOPPED) {
|
||||
dError("RPC %p, req:%s app:%p is ignored since dnode exiting", pMsg->handle, taosMsg[msgType], pMsg->ahandle);
|
||||
dError("RPC %p, req:%s app:%p is ignored since dnode exiting", pMsg->handle, TMSG_INFO(msgType), pMsg->ahandle);
|
||||
SRpcMsg rspMsg = {.handle = pMsg->handle, .code = TSDB_CODE_DND_EXITING};
|
||||
rpcSendResponse(&rspMsg);
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
return;
|
||||
} else if (dndGetStat(pDnode) != DND_STAT_RUNNING) {
|
||||
dError("RPC %p, req:%s app:%p is ignored since dnode not running", pMsg->handle, taosMsg[msgType], pMsg->ahandle);
|
||||
dError("RPC %p, req:%s app:%p is ignored since dnode not running", pMsg->handle, TMSG_INFO(msgType), pMsg->ahandle);
|
||||
SRpcMsg rspMsg = {.handle = pMsg->handle, .code = TSDB_CODE_APP_NOT_READY};
|
||||
rpcSendResponse(&rspMsg);
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
|
@ -208,7 +208,7 @@ static void dndProcessRequest(void *param, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
|||
}
|
||||
|
||||
if (pMsg->pCont == NULL) {
|
||||
dTrace("RPC %p, req:%s app:%p not processed since content is null", pMsg->handle, taosMsg[msgType], pMsg->ahandle);
|
||||
dTrace("RPC %p, req:%s app:%p not processed since content is null", pMsg->handle, TMSG_INFO(msgType), pMsg->ahandle);
|
||||
SRpcMsg rspMsg = {.handle = pMsg->handle, .code = TSDB_CODE_DND_INVALID_MSG_LEN};
|
||||
rpcSendResponse(&rspMsg);
|
||||
return;
|
||||
|
@ -216,10 +216,10 @@ static void dndProcessRequest(void *param, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
|||
|
||||
DndMsgFp fp = pMgmt->msgFp[msgType];
|
||||
if (fp != NULL) {
|
||||
dTrace("RPC %p, req:%s app:%p will be processed", pMsg->handle, taosMsg[msgType], pMsg->ahandle);
|
||||
dTrace("RPC %p, req:%s app:%p will be processed", pMsg->handle, TMSG_INFO(msgType), pMsg->ahandle);
|
||||
(*fp)(pDnode, pMsg, pEpSet);
|
||||
} else {
|
||||
dError("RPC %p, req:%s app:%p is not processed since no handle", pMsg->handle, taosMsg[msgType], pMsg->ahandle);
|
||||
dError("RPC %p, req:%s app:%p is not processed since no handle", pMsg->handle, TMSG_INFO(msgType), pMsg->ahandle);
|
||||
SRpcMsg rspMsg = {.handle = pMsg->handle, .code = TSDB_CODE_MSG_NOT_PROCESSED};
|
||||
rpcSendResponse(&rspMsg);
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
|
@ -281,7 +281,7 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
|
|||
SAuthMsg *pMsg = rpcMallocCont(sizeof(SAuthMsg));
|
||||
tstrncpy(pMsg->user, user, TSDB_USER_LEN);
|
||||
|
||||
SRpcMsg rpcMsg = {.pCont = pMsg, .contLen = sizeof(SAuthMsg), .msgType = TSDB_MSG_TYPE_AUTH};
|
||||
SRpcMsg rpcMsg = {.pCont = pMsg, .contLen = sizeof(SAuthMsg), .msgType = TDMT_MND_AUTH};
|
||||
SRpcMsg rpcRsp = {0};
|
||||
dndSendMsgToMnodeRecv(pDnode, &rpcMsg, &rpcRsp);
|
||||
|
||||
|
|
|
@ -773,22 +773,22 @@ static void dndProcessVnodeMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) {
|
|||
int32_t code = 0;
|
||||
|
||||
switch (pMsg->msgType) {
|
||||
case TSDB_MSG_TYPE_CREATE_VNODE_IN:
|
||||
case TDMT_DND_CREATE_VNODE:
|
||||
code = dndProcessCreateVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_ALTER_VNODE_IN:
|
||||
case TDMT_DND_ALTER_VNODE:
|
||||
code = dndProcessAlterVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_DROP_VNODE_IN:
|
||||
case TDMT_DND_DROP_VNODE:
|
||||
code = dndProcessDropVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_AUTH_VNODE_IN:
|
||||
case TDMT_DND_AUTH_VNODE:
|
||||
code = dndProcessAuthVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_SYNC_VNODE_IN:
|
||||
case TDMT_DND_SYNC_VNODE:
|
||||
code = dndProcessSyncVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TSDB_MSG_TYPE_COMPACT_VNODE_IN:
|
||||
case TDMT_DND_COMPACT_VNODE:
|
||||
code = dndProcessCompactVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -30,7 +30,7 @@ TEST_F(DndTestAcct, 01_CreateAcct) {
|
|||
|
||||
SCreateAcctMsg* pReq = (SCreateAcctMsg*)rpcMallocCont(contLen);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_ACCT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_ACCT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_MSG_NOT_PROCESSED);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ TEST_F(DndTestAcct, 02_AlterAcct) {
|
|||
|
||||
SAlterAcctMsg* pReq = (SAlterAcctMsg*)rpcMallocCont(contLen);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_ALTER_ACCT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_ALTER_ACCT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_MSG_NOT_PROCESSED);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ TEST_F(DndTestAcct, 03_DropAcct) {
|
|||
|
||||
SDropAcctMsg* pReq = (SDropAcctMsg*)rpcMallocCont(contLen);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_DROP_ACCT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_DROP_ACCT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_MSG_NOT_PROCESSED);
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ TEST_F(DndTestAcct, 04_ShowAcct) {
|
|||
SShowMsg* pReq = (SShowMsg*)rpcMallocCont(contLen);
|
||||
pReq->type = TSDB_MGMT_TABLE_ACCT;
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_SHOW, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_SHOW, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_INVALID_MSG_TYPE);
|
||||
}
|
|
@ -77,7 +77,7 @@ TEST_F(DndTestDb, 02_Create_Alter_Drop_Db) {
|
|||
pReq->cacheLastRow = 0;
|
||||
pReq->ignoreExist = 1;
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DB, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DB, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ TEST_F(DndTestDb, 02_Create_Alter_Drop_Db) {
|
|||
pReq->quorum = 2;
|
||||
pReq->cacheLastRow = 1;
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_ALTER_DB, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_ALTER_DB, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ TEST_F(DndTestDb, 02_Create_Alter_Drop_Db) {
|
|||
SDropDbMsg* pReq = (SDropDbMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->db, "1.d1");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_DROP_DB, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_DROP_DB, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ TEST_F(DndTestDb, 03_Create_Use_Restart_Use_Db) {
|
|||
pReq->cacheLastRow = 0;
|
||||
pReq->ignoreExist = 1;
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DB, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DB, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ TEST_F(DndTestDb, 03_Create_Use_Restart_Use_Db) {
|
|||
strcpy(pReq->db, "1.d2");
|
||||
pReq->vgVersion = htonl(-1);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_USE_DB, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_USE_DB, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ TEST_F(DndTestDnode, 02_ConfigDnode) {
|
|||
pReq->dnodeId = htonl(1);
|
||||
strcpy(pReq->config, "ddebugflag 131");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CONFIG_DNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CONFIG_DNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
|
|||
SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->ep, "localhost:9042");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
|
|||
SDropDnodeMsg* pReq = (SDropDnodeMsg*)rpcMallocCont(contLen);
|
||||
pReq->dnodeId = htonl(2);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_DROP_DNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_DROP_DNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
|
|||
SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->ep, "localhost:9043");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
|
|||
SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->ep, "localhost:9044");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
|
|||
SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->ep, "localhost:9045");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ TEST_F(DndTestMnode, 02_Create_Mnode_Invalid_Id) {
|
|||
SCreateMnodeMsg* pReq = (SCreateMnodeMsg*)rpcMallocCont(contLen);
|
||||
pReq->dnodeId = htonl(1);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_MNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_MNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_MNODE_ALREADY_EXIST);
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ TEST_F(DndTestMnode, 03_Create_Mnode_Invalid_Id) {
|
|||
SCreateMnodeMsg* pReq = (SCreateMnodeMsg*)rpcMallocCont(contLen);
|
||||
pReq->dnodeId = htonl(2);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_MNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_MNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_DNODE_NOT_EXIST);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
|
|||
SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->ep, "localhost:9062");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
@ -121,7 +121,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
|
|||
SCreateMnodeMsg* pReq = (SCreateMnodeMsg*)rpcMallocCont(contLen);
|
||||
pReq->dnodeId = htonl(2);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_MNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_MNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
@ -148,7 +148,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
|
|||
SDropMnodeMsg* pReq = (SDropMnodeMsg*)rpcMallocCont(contLen);
|
||||
pReq->dnodeId = htonl(2);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_DROP_MNODE, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_DROP_MNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
@ -169,7 +169,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
|
|||
// SDropDnodeMsg* pReq = (SDropDnodeMsg*)rpcMallocCont(contLen);
|
||||
// pReq->dnodeId = htonl(2);
|
||||
|
||||
// SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_DROP_DNODE, pReq, contLen);
|
||||
// SRpcMsg* pMsg = test.SendMsg(TDMT_MND_DROP_DNODE, pReq, contLen);
|
||||
// ASSERT_NE(pMsg, nullptr);
|
||||
// ASSERT_EQ(pMsg->code, 0);
|
||||
// }
|
||||
|
@ -193,7 +193,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
|
|||
// SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen);
|
||||
// strcpy(pReq->ep, "localhost:9063");
|
||||
|
||||
// SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DNODE, pReq, contLen);
|
||||
// SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen);
|
||||
// ASSERT_NE(pMsg, nullptr);
|
||||
// ASSERT_EQ(pMsg->code, 0);
|
||||
// }
|
||||
|
@ -204,7 +204,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
|
|||
// SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen);
|
||||
// strcpy(pReq->ep, "localhost:9064");
|
||||
|
||||
// SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DNODE, pReq, contLen);
|
||||
// SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen);
|
||||
// ASSERT_NE(pMsg, nullptr);
|
||||
// ASSERT_EQ(pMsg->code, 0);
|
||||
// }
|
||||
|
@ -215,7 +215,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
|
|||
// SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen);
|
||||
// strcpy(pReq->ep, "localhost:9065");
|
||||
|
||||
// SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DNODE, pReq, contLen);
|
||||
// SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen);
|
||||
// ASSERT_NE(pMsg, nullptr);
|
||||
// ASSERT_EQ(pMsg->code, 0);
|
||||
// }
|
||||
|
|
|
@ -35,7 +35,7 @@ TEST_F(DndTestProfile, 01_ConnectMsg) {
|
|||
strcpy(pReq->app, "dnode_test_profile");
|
||||
strcpy(pReq->db, "");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CONNECT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CONNECT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
@ -67,7 +67,7 @@ TEST_F(DndTestProfile, 02_ConnectMsg_InvalidDB) {
|
|||
strcpy(pReq->app, "dnode_test_profile");
|
||||
strcpy(pReq->db, "invalid_db");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CONNECT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CONNECT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_INVALID_DB);
|
||||
ASSERT_EQ(pMsg->contLen, 0);
|
||||
|
@ -105,7 +105,7 @@ TEST_F(DndTestProfile, 04_HeartBeatMsg) {
|
|||
pReq->numOfStreams = htonl(0);
|
||||
strcpy(pReq->app, "dnode_test_profile");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_HEARTBEAT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_HEARTBEAT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
@ -138,7 +138,7 @@ TEST_F(DndTestProfile, 05_KillConnMsg) {
|
|||
SKillConnMsg* pReq = (SKillConnMsg*)rpcMallocCont(contLen);
|
||||
pReq->connId = htonl(connId);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_KILL_CONN, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_KILL_CONN, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ TEST_F(DndTestProfile, 05_KillConnMsg) {
|
|||
pReq->numOfStreams = htonl(0);
|
||||
strcpy(pReq->app, "dnode_test_profile");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_HEARTBEAT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_HEARTBEAT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_INVALID_CONNECTION);
|
||||
ASSERT_EQ(pMsg->contLen, 0);
|
||||
|
@ -167,7 +167,7 @@ TEST_F(DndTestProfile, 05_KillConnMsg) {
|
|||
strcpy(pReq->app, "dnode_test_profile");
|
||||
strcpy(pReq->db, "");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CONNECT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CONNECT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
@ -198,7 +198,7 @@ TEST_F(DndTestProfile, 06_KillConnMsg_InvalidConn) {
|
|||
SKillConnMsg* pReq = (SKillConnMsg*)rpcMallocCont(contLen);
|
||||
pReq->connId = htonl(2345);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_KILL_CONN, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_KILL_CONN, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_INVALID_CONN_ID);
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ TEST_F(DndTestProfile, 07_KillQueryMsg) {
|
|||
pReq->connId = htonl(connId);
|
||||
pReq->queryId = htonl(1234);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_KILL_QUERY, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_KILL_QUERY, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
ASSERT_EQ(pMsg->contLen, 0);
|
||||
|
@ -227,7 +227,7 @@ TEST_F(DndTestProfile, 07_KillQueryMsg) {
|
|||
pReq->numOfStreams = htonl(0);
|
||||
strcpy(pReq->app, "dnode_test_profile");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_HEARTBEAT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_HEARTBEAT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
@ -261,7 +261,7 @@ TEST_F(DndTestProfile, 08_KillQueryMsg_InvalidConn) {
|
|||
pReq->connId = htonl(2345);
|
||||
pReq->queryId = htonl(1234);
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_KILL_QUERY, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_KILL_QUERY, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_INVALID_CONN_ID);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ TEST_F(DndTestShow, 01_ShowMsg_InvalidMsgMax) {
|
|||
pReq->type = TSDB_MGMT_TABLE_MAX;
|
||||
strcpy(pReq->db, "");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_SHOW, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_SHOW, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_INVALID_MSG_TYPE);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ TEST_F(DndTestShow, 02_ShowMsg_InvalidMsgStart) {
|
|||
pReq->type = TSDB_MGMT_TABLE_START;
|
||||
strcpy(pReq->db, "");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_SHOW, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_SHOW, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, TSDB_CODE_MND_INVALID_MSG_TYPE);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ TEST_F(DndTestShow, 02_ShowMsg_Conn) {
|
|||
strcpy(pReq->app, "dnode_test_show");
|
||||
strcpy(pReq->db, "");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CONNECT, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CONNECT, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
|
|||
pReq->cacheLastRow = 0;
|
||||
pReq->ignoreExist = 1;
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_DB, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DB, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
|
|||
strcpy(pSchema->name, "tag3");
|
||||
}
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_STB, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_STB, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
|
|||
STableInfoMsg* pReq = (STableInfoMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->tableFname, "1.d1.stb");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_TABLE_META, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_VND_TABLE_META, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
|
||||
|
@ -192,7 +192,7 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
|
|||
SDropStbMsg* pReq = (SDropStbMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->name, "1.d1.stb");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_DROP_STB, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_DROP_STB, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "os.h"
|
||||
|
||||
#include "dnode.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tconfig.h"
|
||||
#include "tdataformat.h"
|
||||
#include "tglobal.h"
|
||||
|
|
|
@ -75,7 +75,7 @@ void Testbase::SendShowMetaMsg(int8_t showType, const char* db) {
|
|||
pShow->type = showType;
|
||||
strcpy(pShow->db, db);
|
||||
|
||||
SRpcMsg* pMsg = SendMsg(TSDB_MSG_TYPE_SHOW, pShow, contLen);
|
||||
SRpcMsg* pMsg = SendMsg(TDMT_MND_SHOW, pShow, contLen);
|
||||
SShowRsp* pShowRsp = (SShowRsp*)pMsg->pCont;
|
||||
|
||||
ASSERT(pShowRsp != nullptr);
|
||||
|
@ -124,7 +124,7 @@ void Testbase::SendShowRetrieveMsg() {
|
|||
pRetrieve->showId = htonl(showId);
|
||||
pRetrieve->free = 0;
|
||||
|
||||
SRpcMsg* pMsg = SendMsg(TSDB_MSG_TYPE_SHOW_RETRIEVE, pRetrieve, contLen);
|
||||
SRpcMsg* pMsg = SendMsg(TDMT_MND_SHOW_RETRIEVE, pRetrieve, contLen);
|
||||
pRetrieveRsp = (SRetrieveTableRsp*)pMsg->pCont;
|
||||
pRetrieveRsp->numOfRows = htonl(pRetrieveRsp->numOfRows);
|
||||
pRetrieveRsp->useconds = htobe64(pRetrieveRsp->useconds);
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
static void processClientRsp(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
|
||||
TestClient* client = (TestClient*)parent;
|
||||
client->SetRpcRsp(pMsg);
|
||||
uInfo("response:%s from dnode, code:0x%x", taosMsg[pMsg->msgType], pMsg->code);
|
||||
uInfo("response:%s from dnode, code:0x%x", TMSG_INFO(pMsg->msgType), pMsg->code);
|
||||
tsem_post(client->GetSem());
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ TEST_F(DndTestUser, 02_Create_Drop_Alter_User) {
|
|||
strcpy(pReq->user, "u1");
|
||||
strcpy(pReq->pass, "p1");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_USER, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_USER, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ TEST_F(DndTestUser, 02_Create_Drop_Alter_User) {
|
|||
strcpy(pReq->user, "u2");
|
||||
strcpy(pReq->pass, "p2");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_USER, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_USER, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ TEST_F(DndTestUser, 02_Create_Drop_Alter_User) {
|
|||
strcpy(pReq->user, "u1");
|
||||
strcpy(pReq->pass, "p2");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_ALTER_USER, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_ALTER_USER, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ TEST_F(DndTestUser, 02_Create_Drop_Alter_User) {
|
|||
SDropUserMsg* pReq = (SDropUserMsg*)rpcMallocCont(contLen);
|
||||
strcpy(pReq->user, "u1");
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_DROP_USER, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_MND_DROP_USER, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ TEST_F(DndTestVgroup, 01_Create_Restart_Drop_Vnode) {
|
|||
pReplica->port = htons(9150);
|
||||
}
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_CREATE_VNODE_IN, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_DND_CREATE_VNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ TEST_F(DndTestVgroup, 01_Create_Restart_Drop_Vnode) {
|
|||
pReplica->port = htons(9150);
|
||||
}
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_ALTER_VNODE_IN, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_DND_ALTER_VNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
@ -119,9 +119,9 @@ TEST_F(DndTestVgroup, 01_Create_Restart_Drop_Vnode) {
|
|||
SRpcMsg rpcMsg = {0};
|
||||
rpcMsg.pCont = pReq;
|
||||
rpcMsg.contLen = sizeof(SDropVnodeMsg);
|
||||
rpcMsg.msgType = TSDB_MSG_TYPE_DROP_VNODE_IN;
|
||||
rpcMsg.msgType = TDMT_DND_DROP_VNODE;
|
||||
|
||||
SRpcMsg* pMsg = test.SendMsg(TSDB_MSG_TYPE_DROP_VNODE_IN, pReq, contLen);
|
||||
SRpcMsg* pMsg = test.SendMsg(TDMT_DND_DROP_VNODE, pReq, contLen);
|
||||
ASSERT_NE(pMsg, nullptr);
|
||||
ASSERT_EQ(pMsg->code, 0);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "cJSON.h"
|
||||
#include "sync.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "thash.h"
|
||||
#include "tlog.h"
|
||||
#include "trpc.h"
|
||||
|
|
|
@ -77,7 +77,7 @@ typedef struct SMnode {
|
|||
SShowMgmt showMgmt;
|
||||
SProfileMgmt profileMgmt;
|
||||
STelemMgmt telemMgmt;
|
||||
MndMsgFp msgFp[TSDB_MSG_TYPE_MAX];
|
||||
MndMsgFp msgFp[TDMT_MAX];
|
||||
SendMsgToDnodeFp sendMsgToDnodeFp;
|
||||
SendMsgToMnodeFp sendMsgToMnodeFp;
|
||||
SendRedirectMsgFp sendRedirectMsgFp;
|
||||
|
|
|
@ -40,9 +40,9 @@ int32_t mndInitAcct(SMnode *pMnode) {
|
|||
.updateFp = (SdbUpdateFp)mndAcctActionUpdate,
|
||||
.deleteFp = (SdbDeleteFp)mndAcctActionDelete};
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_ACCT, mndProcessCreateAcctMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_ALTER_ACCT, mndProcessAlterAcctMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_ACCT, mndProcessDropAcctMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CREATE_ACCT, mndProcessCreateAcctMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_ALTER_ACCT, mndProcessAlterAcctMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_DROP_ACCT, mndProcessDropAcctMsg);
|
||||
|
||||
return sdbSetTable(pMnode->pSdb, table);
|
||||
}
|
||||
|
|
|
@ -48,12 +48,12 @@ int32_t mndInitDb(SMnode *pMnode) {
|
|||
.updateFp = (SdbUpdateFp)mndDbActionUpdate,
|
||||
.deleteFp = (SdbDeleteFp)mndDbActionDelete};
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_DB, mndProcessCreateDbMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_ALTER_DB, mndProcessAlterDbMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_DB, mndProcessDropDbMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_USE_DB, mndProcessUseDbMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_SYNC_DB, mndProcessSyncDbMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_COMPACT_DB, mndProcessCompactDbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CREATE_DB, mndProcessCreateDbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_ALTER_DB, mndProcessAlterDbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_DROP_DB, mndProcessDropDbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_USE_DB, mndProcessUseDbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_SYNC_DB, mndProcessSyncDbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_COMPACT_DB, mndProcessCompactDbMsg);
|
||||
|
||||
mndAddShowMetaHandle(pMnode, TSDB_MGMT_TABLE_DB, mndGetDbMeta);
|
||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_DB, mndRetrieveDbs);
|
||||
|
@ -311,7 +311,7 @@ static int32_t mndSetCreateDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
|
|||
|
||||
action.pCont = pMsg;
|
||||
action.contLen = sizeof(SCreateVnodeMsg);
|
||||
action.msgType = TSDB_MSG_TYPE_CREATE_VNODE_IN;
|
||||
action.msgType = TDMT_DND_CREATE_VNODE;
|
||||
if (mndTransAppendRedoAction(pTrans, &action) != 0) {
|
||||
free(pMsg);
|
||||
return -1;
|
||||
|
@ -340,7 +340,7 @@ static int32_t mndSetCreateDbUndoActions(SMnode *pMnode, STrans *pTrans, SDbObj
|
|||
|
||||
action.pCont = pMsg;
|
||||
action.contLen = sizeof(SDropVnodeMsg);
|
||||
action.msgType = TSDB_MSG_TYPE_DROP_VNODE_IN;
|
||||
action.msgType = TDMT_DND_DROP_VNODE;
|
||||
if (mndTransAppendUndoAction(pTrans, &action) != 0) {
|
||||
free(pMsg);
|
||||
return -1;
|
||||
|
|
|
@ -73,11 +73,11 @@ int32_t mndInitDnode(SMnode *pMnode) {
|
|||
.updateFp = (SdbUpdateFp)mndDnodeActionUpdate,
|
||||
.deleteFp = (SdbDeleteFp)mndDnodeActionDelete};
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_DNODE, mndProcessCreateDnodeMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_DNODE, mndProcessDropDnodeMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CONFIG_DNODE, mndProcessConfigDnodeMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CONFIG_DNODE_IN_RSP, mndProcessConfigDnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_STATUS, mndProcessStatusMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CREATE_DNODE, mndProcessCreateDnodeMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_DROP_DNODE, mndProcessDropDnodeMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CONFIG_DNODE, mndProcessConfigDnodeMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_CONFIG_DNODE_RSP, mndProcessConfigDnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_STATUS, mndProcessStatusMsg);
|
||||
|
||||
mndAddShowMetaHandle(pMnode, TSDB_MGMT_TABLE_VARIABLES, mndGetConfigMeta);
|
||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_VARIABLES, mndRetrieveConfigs);
|
||||
|
@ -527,7 +527,7 @@ static int32_t mndProcessConfigDnodeMsg(SMnodeMsg *pMsg) {
|
|||
pCfgDnode->dnodeId = htonl(pCfg->dnodeId);
|
||||
memcpy(pCfgDnode->config, pCfg->config, TSDB_DNODE_CONFIG_LEN);
|
||||
|
||||
SRpcMsg rpcMsg = {.msgType = TSDB_MSG_TYPE_CONFIG_DNODE_IN,
|
||||
SRpcMsg rpcMsg = {.msgType = TDMT_DND_CONFIG_DNODE,
|
||||
.pCont = pCfgDnode,
|
||||
.contLen = sizeof(SCfgDnodeMsg),
|
||||
.ahandle = pMsg->rpcMsg.ahandle};
|
||||
|
|
|
@ -44,9 +44,9 @@ int32_t mndInitFunc(SMnode *pMnode) {
|
|||
.updateFp = (SdbUpdateFp)mndFuncActionUpdate,
|
||||
.deleteFp = (SdbDeleteFp)mndFuncActionDelete};
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_FUNCTION, mndProcessCreateFuncMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_FUNCTION, mndProcessDropFuncMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_RETRIEVE_FUNCTION, mndProcessRetrieveFuncMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CREATE_FUNCTION, mndProcessCreateFuncMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_DROP_FUNCTION, mndProcessDropFuncMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_RETRIEVE_FUNCTION, mndProcessRetrieveFuncMsg);
|
||||
|
||||
mndAddShowMetaHandle(pMnode, TSDB_MGMT_TABLE_FUNCTION, mndGetFuncMeta);
|
||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_FUNCTION, mndRetrieveFuncs);
|
||||
|
|
|
@ -47,11 +47,11 @@ int32_t mndInitMnode(SMnode *pMnode) {
|
|||
.updateFp = (SdbUpdateFp)mndMnodeActionUpdate,
|
||||
.deleteFp = (SdbDeleteFp)mndMnodeActionDelete};
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_MNODE, mndProcessCreateMnodeReq);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_MNODE, mndProcessDropMnodeReq);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_MNODE_IN_RSP, mndProcessCreateMnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_ALTER_MNODE_IN_RSP, mndProcessAlterMnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_MNODE_IN_RSP, mndProcessDropMnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CREATE_MNODE, mndProcessCreateMnodeReq);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_DROP_MNODE, mndProcessDropMnodeReq);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_CREATE_MNODE_RSP, mndProcessCreateMnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_ALTER_MNODE_RSP, mndProcessAlterMnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_DROP_MNODE_RSP, mndProcessDropMnodeRsp);
|
||||
|
||||
mndAddShowMetaHandle(pMnode, TSDB_MGMT_TABLE_MNODE, mndGetMnodeMeta);
|
||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_MNODE, mndRetrieveMnodes);
|
||||
|
@ -293,7 +293,7 @@ static int32_t mndSetCreateMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDno
|
|||
action.epSet = mndGetDnodeEpset(pMObj->pDnode);
|
||||
action.pCont = pMsg;
|
||||
action.contLen = sizeof(SAlterMnodeInMsg);
|
||||
action.msgType = TSDB_MSG_TYPE_ALTER_MNODE_IN;
|
||||
action.msgType = TDMT_DND_ALTER_MNODE;
|
||||
|
||||
if (mndTransAppendRedoAction(pTrans, &action) != 0) {
|
||||
free(pMsg);
|
||||
|
@ -317,7 +317,7 @@ static int32_t mndSetCreateMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDno
|
|||
action.epSet = mndGetDnodeEpset(pDnode);
|
||||
action.pCont = pMsg;
|
||||
action.contLen = sizeof(SCreateMnodeInMsg);
|
||||
action.msgType = TSDB_MSG_TYPE_CREATE_MNODE_IN;
|
||||
action.msgType = TDMT_DND_CREATE_MNODE;
|
||||
if (mndTransAppendRedoAction(pTrans, &action) != 0) {
|
||||
free(pMsg);
|
||||
return -1;
|
||||
|
@ -461,7 +461,7 @@ static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnode
|
|||
action.epSet = mndGetDnodeEpset(pMObj->pDnode);
|
||||
action.pCont = pMsg;
|
||||
action.contLen = sizeof(SAlterMnodeInMsg);
|
||||
action.msgType = TSDB_MSG_TYPE_ALTER_MNODE_IN;
|
||||
action.msgType = TDMT_DND_ALTER_MNODE;
|
||||
|
||||
if (mndTransAppendRedoAction(pTrans, &action) != 0) {
|
||||
free(pMsg);
|
||||
|
@ -488,7 +488,7 @@ static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnode
|
|||
action.epSet = mndGetDnodeEpset(pDnode);
|
||||
action.pCont = pMsg;
|
||||
action.contLen = sizeof(SDropMnodeInMsg);
|
||||
action.msgType = TSDB_MSG_TYPE_DROP_MNODE_IN;
|
||||
action.msgType = TDMT_DND_DROP_MNODE;
|
||||
if (mndTransAppendRedoAction(pTrans, &action) != 0) {
|
||||
free(pMsg);
|
||||
return -1;
|
||||
|
|
|
@ -68,10 +68,10 @@ int32_t mndInitProfile(SMnode *pMnode) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_HEARTBEAT, mndProcessHeartBeatMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CONNECT, mndProcessConnectMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_KILL_QUERY, mndProcessKillQueryMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_KILL_CONN, mndProcessKillConnectionMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_HEARTBEAT, mndProcessHeartBeatMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CONNECT, mndProcessConnectMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_KILL_QUERY, mndProcessKillQueryMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_KILL_CONN, mndProcessKillConnectionMsg);
|
||||
|
||||
mndAddShowMetaHandle(pMnode, TSDB_MGMT_TABLE_CONNS, mndGetConnsMeta);
|
||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_CONNS, mndRetrieveConns);
|
||||
|
|
|
@ -36,8 +36,8 @@ int32_t mndInitShow(SMnode *pMnode) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_SHOW, mndProcessShowMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_SHOW_RETRIEVE, mndProcessRetrieveMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_SHOW, mndProcessShowMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_SHOW_RETRIEVE, mndProcessRetrieveMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,13 +52,13 @@ int32_t mndInitStb(SMnode *pMnode) {
|
|||
.updateFp = (SdbUpdateFp)mndStbActionUpdate,
|
||||
.deleteFp = (SdbDeleteFp)mndStbActionDelete};
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_STB, mndProcessCreateStbMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_ALTER_STB, mndProcessAlterStbMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_STB, mndProcessDropStbMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_STB_IN_RSP, mndProcessCreateStbInRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_ALTER_STB_IN_RSP, mndProcessAlterStbInRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_STB_IN_RSP, mndProcessDropStbInRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_TABLE_META, mndProcessStbMetaMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CREATE_STB, mndProcessCreateStbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_ALTER_STB, mndProcessAlterStbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_DROP_STB, mndProcessDropStbMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_VND_CREATE_STB_RSP, mndProcessCreateStbInRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_VND_ALTER_STB_RSP, mndProcessAlterStbInRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_VND_DROP_STB_RSP, mndProcessDropStbInRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_VND_TABLE_META, mndProcessStbMetaMsg);
|
||||
|
||||
mndAddShowMetaHandle(pMnode, TSDB_MGMT_TABLE_STB, mndGetStbMeta);
|
||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_STB, mndRetrieveStb);
|
||||
|
@ -345,7 +345,7 @@ static int32_t mndSetCreateStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
|
|||
action.epSet = mndGetVgroupEpset(pMnode, pVgroup);
|
||||
action.pCont = pMsg;
|
||||
action.contLen = htonl(pMsg->head.contLen);
|
||||
action.msgType = TSDB_MSG_TYPE_CREATE_STB_IN;
|
||||
action.msgType = TDMT_VND_CREATE_STB;
|
||||
if (mndTransAppendRedoAction(pTrans, &action) != 0) {
|
||||
free(pMsg);
|
||||
sdbCancelFetch(pSdb, pIter);
|
||||
|
@ -380,7 +380,7 @@ static int32_t mndSetCreateStbUndoActions(SMnode *pMnode, STrans *pTrans, SDbObj
|
|||
action.epSet = mndGetVgroupEpset(pMnode, pVgroup);
|
||||
action.pCont = pMsg;
|
||||
action.contLen = sizeof(SDropStbInternalMsg);
|
||||
action.msgType = TSDB_MSG_TYPE_DROP_STB_IN;
|
||||
action.msgType = TDMT_VND_DROP_STB;
|
||||
if (mndTransAppendUndoAction(pTrans, &action) != 0) {
|
||||
free(pMsg);
|
||||
sdbCancelFetch(pSdb, pIter);
|
||||
|
|
|
@ -466,13 +466,13 @@ static int32_t mndTransAppendAction(SArray *pArray, STransAction *pAction) {
|
|||
|
||||
int32_t mndTransAppendRedoAction(STrans *pTrans, STransAction *pAction) {
|
||||
int32_t code = mndTransAppendAction(pTrans->redoActions, pAction);
|
||||
mTrace("trans:%d, msg:%s append to redo actions, code:0x%x", pTrans->id, taosMsg[pAction->msgType], code);
|
||||
mTrace("trans:%d, msg:%s append to redo actions, code:0x%x", pTrans->id, TMSG_INFO(pAction->msgType), code);
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t mndTransAppendUndoAction(STrans *pTrans, STransAction *pAction) {
|
||||
int32_t code = mndTransAppendAction(pTrans->undoActions, pAction);
|
||||
mTrace("trans:%d, msg:%s append to undo actions, code:0x%x", pTrans->id, taosMsg[pAction->msgType], code);
|
||||
mTrace("trans:%d, msg:%s append to undo actions, code:0x%x", pTrans->id, TMSG_INFO(pAction->msgType), code);
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,9 +47,9 @@ int32_t mndInitUser(SMnode *pMnode) {
|
|||
.updateFp = (SdbUpdateFp)mndUserActionUpdate,
|
||||
.deleteFp = (SdbDeleteFp)mndUserActionDelete};
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_USER, mndProcessCreateUserMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_ALTER_USER, mndProcessAlterUserMsg);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_USER, mndProcessDropUserMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_CREATE_USER, mndProcessCreateUserMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_ALTER_USER, mndProcessAlterUserMsg);
|
||||
mndSetMsgHandle(pMnode, TDMT_MND_DROP_USER, mndProcessDropUserMsg);
|
||||
|
||||
mndAddShowMetaHandle(pMnode, TSDB_MGMT_TABLE_USER, mndGetUserMeta);
|
||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_USER, mndRetrieveUsers);
|
||||
|
|
|
@ -51,11 +51,11 @@ int32_t mndInitVgroup(SMnode *pMnode) {
|
|||
.updateFp = (SdbUpdateFp)mndVgroupActionDelete,
|
||||
.deleteFp = (SdbDeleteFp)mndVgroupActionUpdate};
|
||||
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_VNODE_IN_RSP, mndProcessCreateVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_ALTER_VNODE_IN_RSP, mndProcessAlterVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_DROP_VNODE_IN_RSP, mndProcessDropVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_SYNC_VNODE_IN_RSP, mndProcessSyncVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_COMPACT_VNODE_IN_RSP, mndProcessCompactVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_CREATE_VNODE_RSP, mndProcessCreateVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_ALTER_VNODE_RSP, mndProcessAlterVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_DROP_VNODE_RSP, mndProcessDropVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_SYNC_VNODE_RSP, mndProcessSyncVnodeRsp);
|
||||
mndSetMsgHandle(pMnode, TDMT_DND_COMPACT_VNODE_RSP, mndProcessCompactVnodeRsp);
|
||||
|
||||
mndAddShowMetaHandle(pMnode, TSDB_MGMT_TABLE_VGROUP, mndGetVgroupMeta);
|
||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_VGROUP, mndRetrieveVgroups);
|
||||
|
|
|
@ -376,7 +376,7 @@ static void mndProcessRpcMsg(SMnodeMsg *pMsg) {
|
|||
void *ahandle = pMsg->rpcMsg.ahandle;
|
||||
bool isReq = (msgType & 1U);
|
||||
|
||||
mTrace("msg:%p, app:%p type:%s will be processed", pMsg, ahandle, taosMsg[msgType]);
|
||||
mTrace("msg:%p, app:%p type:%s will be processed", pMsg, ahandle, TMSG_INFO(msgType));
|
||||
|
||||
if (isReq && !mndIsMaster(pMnode)) {
|
||||
code = TSDB_CODE_APP_NOT_READY;
|
||||
|
@ -424,7 +424,7 @@ PROCESS_RPC_END:
|
|||
}
|
||||
|
||||
void mndSetMsgHandle(SMnode *pMnode, int32_t msgType, MndMsgFp fp) {
|
||||
if (msgType >= 0 && msgType < TSDB_MSG_TYPE_MAX) {
|
||||
if (msgType >= 0 && msgType < TDMT_MAX) {
|
||||
pMnode->msgFp[msgType] = fp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "os.h"
|
||||
#include "sdb.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "thash.h"
|
||||
#include "tlockfree.h"
|
||||
#include "tlog.h"
|
||||
|
|
|
@ -23,10 +23,10 @@ int vnodeBuildReq(void **buf, const SVnodeReq *pReq, uint8_t type) {
|
|||
|
||||
tsize += taosEncodeFixedU64(buf, pReq->ver);
|
||||
switch (type) {
|
||||
case TSDB_MSG_TYPE_CREATE_TABLE:
|
||||
case TDMT_MND_CREATE_TABLE:
|
||||
tsize += vnodeBuildCreateTableReq(buf, &(pReq->ctReq));
|
||||
break;
|
||||
case TSDB_MSG_TYPE_SUBMIT:
|
||||
case TDMT_VND_SUBMIT:
|
||||
/* code */
|
||||
break;
|
||||
default:
|
||||
|
@ -40,7 +40,7 @@ void *vnodeParseReq(void *buf, SVnodeReq *pReq, uint8_t type) {
|
|||
buf = taosDecodeFixedU64(buf, &(pReq->ver));
|
||||
|
||||
switch (type) {
|
||||
case TSDB_MSG_TYPE_CREATE_TABLE:
|
||||
case TDMT_MND_CREATE_TABLE:
|
||||
buf = vnodeParseCreateTableReq(buf, &(pReq->ctReq));
|
||||
break;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
int vnodeProcessNoWalWMsgs(SVnode *pVnode, SRpcMsg *pMsg) {
|
||||
switch (pMsg->msgType) {
|
||||
case TSDB_MSG_TYPE_MQ_SET_CUR:
|
||||
case TDMT_VND_MQ_SET_CUR:
|
||||
if (tqSetCursor(pVnode->pTq, pMsg->pCont) < 0) {
|
||||
// TODO: handle error
|
||||
}
|
||||
|
@ -70,21 +70,21 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
|||
vnodeParseReq(pMsg->pCont, &vReq, pMsg->msgType);
|
||||
|
||||
switch (pMsg->msgType) {
|
||||
case TSDB_MSG_TYPE_CREATE_STB_IN:
|
||||
case TSDB_MSG_TYPE_CREATE_TABLE:
|
||||
case TDMT_VND_CREATE_STB:
|
||||
case TDMT_MND_CREATE_TABLE:
|
||||
if (metaCreateTable(pVnode->pMeta, &(vReq.ctReq)) < 0) {
|
||||
// TODO: handle error
|
||||
}
|
||||
|
||||
// TODO: maybe need to clear the requst struct
|
||||
break;
|
||||
case TSDB_MSG_TYPE_DROP_STB_IN:
|
||||
case TSDB_MSG_TYPE_DROP_TABLE:
|
||||
case TDMT_VND_DROP_STB:
|
||||
case TDMT_MND_DROP_TABLE:
|
||||
if (metaDropTable(pVnode->pMeta, vReq.dtReq.uid) < 0) {
|
||||
// TODO: handle error
|
||||
}
|
||||
break;
|
||||
case TSDB_MSG_TYPE_SUBMIT:
|
||||
case TDMT_VND_SUBMIT:
|
||||
if (tsdbInsertData(pVnode->pTsdb, (SSubmitMsg *)ptr) < 0) {
|
||||
// TODO: handle error
|
||||
}
|
||||
|
|
|
@ -84,14 +84,14 @@ static void vtBuildCreateStbReq(tb_uid_t suid, char *tbname, SRpcMsg **ppMsg) {
|
|||
SVnodeReq vCreateSTbReq;
|
||||
vnodeSetCreateStbReq(&vCreateSTbReq, tbname, UINT32_MAX, UINT32_MAX, suid, pSchema, pTagSchema);
|
||||
|
||||
zs = vnodeBuildReq(NULL, &vCreateSTbReq, TSDB_MSG_TYPE_CREATE_TABLE);
|
||||
zs = vnodeBuildReq(NULL, &vCreateSTbReq, TDMT_MND_CREATE_TABLE);
|
||||
pMsg = (SRpcMsg *)malloc(sizeof(SRpcMsg) + zs);
|
||||
pMsg->msgType = TSDB_MSG_TYPE_CREATE_TABLE;
|
||||
pMsg->msgType = TDMT_MND_CREATE_TABLE;
|
||||
pMsg->contLen = zs;
|
||||
pMsg->pCont = POINTER_SHIFT(pMsg, sizeof(SRpcMsg));
|
||||
|
||||
pBuf = pMsg->pCont;
|
||||
vnodeBuildReq(&pBuf, &vCreateSTbReq, TSDB_MSG_TYPE_CREATE_TABLE);
|
||||
vnodeBuildReq(&pBuf, &vCreateSTbReq, TDMT_MND_CREATE_TABLE);
|
||||
META_CLEAR_TB_CFG(&vCreateSTbReq);
|
||||
|
||||
tdFreeSchema(pSchema);
|
||||
|
@ -108,14 +108,14 @@ static void vtBuildCreateCtbReq(tb_uid_t suid, char *tbname, SRpcMsg **ppMsg) {
|
|||
SVnodeReq vCreateCTbReq;
|
||||
vnodeSetCreateCtbReq(&vCreateCTbReq, tbname, UINT32_MAX, UINT32_MAX, suid, pTag);
|
||||
|
||||
tz = vnodeBuildReq(NULL, &vCreateCTbReq, TSDB_MSG_TYPE_CREATE_TABLE);
|
||||
tz = vnodeBuildReq(NULL, &vCreateCTbReq, TDMT_MND_CREATE_TABLE);
|
||||
pMsg = (SRpcMsg *)malloc(sizeof(SRpcMsg) + tz);
|
||||
pMsg->msgType = TSDB_MSG_TYPE_CREATE_TABLE;
|
||||
pMsg->msgType = TDMT_MND_CREATE_TABLE;
|
||||
pMsg->contLen = tz;
|
||||
pMsg->pCont = POINTER_SHIFT(pMsg, sizeof(*pMsg));
|
||||
void *pBuf = pMsg->pCont;
|
||||
|
||||
vnodeBuildReq(&pBuf, &vCreateCTbReq, TSDB_MSG_TYPE_CREATE_TABLE);
|
||||
vnodeBuildReq(&pBuf, &vCreateCTbReq, TDMT_MND_CREATE_TABLE);
|
||||
META_CLEAR_TB_CFG(&vCreateCTbReq);
|
||||
free(pTag);
|
||||
|
||||
|
@ -133,7 +133,7 @@ static void vtBuildSubmitReq(SRpcMsg **ppMsg) {
|
|||
int tz = 1024; // TODO
|
||||
|
||||
pMsg = (SRpcMsg *)malloc(sizeof(*pMsg) + tz);
|
||||
pMsg->msgType = TSDB_MSG_TYPE_SUBMIT;
|
||||
pMsg->msgType = TDMT_VND_SUBMIT;
|
||||
pMsg->contLen = tz;
|
||||
pMsg->pCont = POINTER_SHIFT(pMsg, sizeof(*pMsg));
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#define _TD_TSDB_DEF_H_
|
||||
|
||||
#include "mallocator.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tlist.h"
|
||||
#include "thash.h"
|
||||
#include "tskiplist.h"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tarray.h"
|
||||
#include "query.h"
|
||||
#include "tglobal.h"
|
||||
|
|
|
@ -49,7 +49,7 @@ int32_t ctgGetDBVgroupFromMnode(struct SCatalog* pCatalog, void *pRpc, const SEp
|
|||
SEpSet *pVnodeEpSet = NULL;
|
||||
int32_t msgLen = 0;
|
||||
|
||||
CTG_ERR_RET(queryBuildMsg[TSDB_MSG_TYPE_USE_DB](input, &msg, 0, &msgLen));
|
||||
CTG_ERR_RET(queryBuildMsg[TDMT_MND_USE_DB](input, &msg, 0, &msgLen));
|
||||
|
||||
char *pMsg = rpcMallocCont(msgLen);
|
||||
if (NULL == pMsg) {
|
||||
|
@ -63,7 +63,7 @@ int32_t ctgGetDBVgroupFromMnode(struct SCatalog* pCatalog, void *pRpc, const SEp
|
|||
tfree(msg);
|
||||
|
||||
SRpcMsg rpcMsg = {
|
||||
.msgType = TSDB_MSG_TYPE_USE_DB,
|
||||
.msgType = TDMT_MND_USE_DB,
|
||||
.pCont = pMsg,
|
||||
.contLen = msgLen,
|
||||
};
|
||||
|
@ -76,7 +76,7 @@ int32_t ctgGetDBVgroupFromMnode(struct SCatalog* pCatalog, void *pRpc, const SEp
|
|||
CTG_ERR_RET(rpcRsp.code);
|
||||
}
|
||||
|
||||
CTG_ERR_RET(queryProcessMsgRsp[TSDB_MSG_TYPE_USE_DB](out, rpcRsp.pCont, rpcRsp.contLen));
|
||||
CTG_ERR_RET(queryProcessMsgRsp[TDMT_MND_USE_DB](out, rpcRsp.pCont, rpcRsp.contLen));
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -161,10 +161,10 @@ int32_t ctgGetTableMetaFromMnode(struct SCatalog* pCatalog, void *pRpc, const SE
|
|||
SEpSet *pVnodeEpSet = NULL;
|
||||
int32_t msgLen = 0;
|
||||
|
||||
CTG_ERR_RET(queryBuildMsg[TSDB_MSG_TYPE_TABLE_META](&bInput, &msg, 0, &msgLen));
|
||||
CTG_ERR_RET(queryBuildMsg[TDMT_VND_TABLE_META](&bInput, &msg, 0, &msgLen));
|
||||
|
||||
SRpcMsg rpcMsg = {
|
||||
.msgType = TSDB_MSG_TYPE_TABLE_META,
|
||||
.msgType = TDMT_VND_TABLE_META,
|
||||
.pCont = msg,
|
||||
.contLen = msgLen,
|
||||
};
|
||||
|
@ -181,7 +181,7 @@ int32_t ctgGetTableMetaFromMnode(struct SCatalog* pCatalog, void *pRpc, const SE
|
|||
CTG_ERR_RET(rpcRsp.code);
|
||||
}
|
||||
|
||||
CTG_ERR_RET(queryProcessMsgRsp[TSDB_MSG_TYPE_TABLE_META](output, rpcRsp.pCont, rpcRsp.contLen));
|
||||
CTG_ERR_RET(queryProcessMsgRsp[TDMT_VND_TABLE_META](output, rpcRsp.pCont, rpcRsp.contLen));
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
|
|||
SRpcMsg rpcMsg = {0};
|
||||
rpcMsg.pCont = pReq;
|
||||
rpcMsg.contLen = sizeof(SCreateDbMsg);
|
||||
rpcMsg.msgType = TSDB_MSG_TYPE_CREATE_DB;
|
||||
rpcMsg.msgType = TDMT_MND_CREATE_DB;
|
||||
|
||||
SRpcMsg rpcRsp = {0};
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "thash.h"
|
||||
|
||||
#include "executil.h"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
#include <function.h>
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tglobal.h"
|
||||
#include "ttime.h"
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ extern "C" {
|
|||
|
||||
#include "os.h"
|
||||
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "taosdef.h"
|
||||
#include "tskiplist.h"
|
||||
#include "function.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "tscalarfunction.h"
|
||||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tglobal.h"
|
||||
#include "thash.h"
|
||||
#include "ttypes.h"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "exception.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tarray.h"
|
||||
#include "tbuffer.h"
|
||||
#include "tcompare.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "os.h"
|
||||
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "ttypes.h"
|
||||
|
||||
#include "tfill.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "thistogram.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tlosertree.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define TDENGINE_ASTTOMSG_H
|
||||
|
||||
#include "parserInt.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
SCreateUserMsg* buildUserManipulationMsg(SSqlInfo* pInfo, int32_t* outputLen, int64_t id, char* msgBuf, int32_t msgLen);
|
||||
SCreateAcctMsg* buildAcctManipulationMsg(SSqlInfo* pInfo, int32_t* outputLen, int64_t id, char* msgBuf, int32_t msgLen);
|
||||
|
|
|
@ -4358,7 +4358,7 @@ int32_t qParserValidateDclSqlNode(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SDclStm
|
|||
}
|
||||
|
||||
pDcl->pMsg = (char*)buildUserManipulationMsg(pInfo, &pDcl->msgLen, pCtx->requestId, msgBuf, msgBufLen);
|
||||
pDcl->msgType = (pInfo->type == TSDB_SQL_CREATE_USER)? TSDB_MSG_TYPE_CREATE_USER:TSDB_MSG_TYPE_ALTER_USER;
|
||||
pDcl->msgType = (pInfo->type == TSDB_SQL_CREATE_USER)? TDMT_MND_CREATE_USER:TDMT_MND_ALTER_USER;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4395,20 +4395,20 @@ int32_t qParserValidateDclSqlNode(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SDclStm
|
|||
}
|
||||
|
||||
pDcl->pMsg = (char*)buildAcctManipulationMsg(pInfo, &pDcl->msgLen, pCtx->requestId, msgBuf, msgBufLen);
|
||||
pDcl->msgType = (pInfo->type == TSDB_SQL_CREATE_ACCT)? TSDB_MSG_TYPE_CREATE_ACCT:TSDB_MSG_TYPE_ALTER_ACCT;
|
||||
pDcl->msgType = (pInfo->type == TSDB_SQL_CREATE_ACCT)? TDMT_MND_CREATE_ACCT:TDMT_MND_ALTER_ACCT;
|
||||
break;
|
||||
}
|
||||
|
||||
case TSDB_SQL_DROP_ACCT:
|
||||
case TSDB_SQL_DROP_USER: {
|
||||
pDcl->pMsg = (char*)buildDropUserMsg(pInfo, &pDcl->msgLen, pCtx->requestId, msgBuf, msgBufLen);
|
||||
pDcl->msgType = (pInfo->type == TSDB_SQL_DROP_ACCT)? TSDB_MSG_TYPE_DROP_ACCT:TSDB_MSG_TYPE_DROP_USER;
|
||||
pDcl->msgType = (pInfo->type == TSDB_SQL_DROP_ACCT)? TDMT_MND_DROP_ACCT:TDMT_MND_DROP_USER;
|
||||
break;
|
||||
}
|
||||
|
||||
case TSDB_SQL_SHOW: {
|
||||
code = setShowInfo(&pInfo->pMiscInfo->showOpt, pCtx, (void**)&pDcl->pMsg, &pDcl->msgLen, pMsgBuf);
|
||||
pDcl->msgType = TSDB_MSG_TYPE_SHOW;
|
||||
pDcl->msgType = TDMT_MND_SHOW;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4431,7 +4431,7 @@ int32_t qParserValidateDclSqlNode(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SDclStm
|
|||
|
||||
pDcl->pMsg = (char*)pUseDbMsg;
|
||||
pDcl->msgLen = sizeof(SUseDbMsg);
|
||||
pDcl->msgType = TSDB_MSG_TYPE_USE_DB;
|
||||
pDcl->msgType = TDMT_MND_USE_DB;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4459,7 +4459,7 @@ int32_t qParserValidateDclSqlNode(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SDclStm
|
|||
|
||||
pDcl->pMsg = (char*)pCreateMsg;
|
||||
pDcl->msgLen = sizeof(SCreateDbMsg);
|
||||
pDcl->msgType = (pInfo->type == TSDB_SQL_CREATE_DB)? TSDB_MSG_TYPE_CREATE_DB:TSDB_MSG_TYPE_ALTER_DB;
|
||||
pDcl->msgType = (pInfo->type == TSDB_SQL_CREATE_DB)? TDMT_MND_CREATE_DB:TDMT_MND_ALTER_DB;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4481,7 +4481,7 @@ int32_t qParserValidateDclSqlNode(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SDclStm
|
|||
pDropDbMsg->ignoreNotExists = pInfo->pMiscInfo->existsCheck ? 1 : 0;
|
||||
assert(code == TSDB_CODE_SUCCESS && name.type == TSDB_DB_NAME_T);
|
||||
|
||||
pDcl->msgType = TSDB_MSG_TYPE_DROP_DB;
|
||||
pDcl->msgType = TDMT_MND_DROP_DB;
|
||||
pDcl->msgLen = sizeof(SDropDbMsg);
|
||||
pDcl->pMsg = (char*)pDropDbMsg;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -4495,7 +4495,7 @@ int32_t qParserValidateDclSqlNode(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SDclStm
|
|||
return code;
|
||||
}
|
||||
pDcl->pMsg = (char*)buildCreateTableMsg(pCreateTable, &pDcl->msgLen, pCtx, pMsgBuf);
|
||||
pDcl->msgType = (pCreateTable->type == TSQL_CREATE_TABLE)? TSDB_MSG_TYPE_CREATE_TABLE:TSDB_MSG_TYPE_CREATE_STB;
|
||||
pDcl->msgType = (pCreateTable->type == TSQL_CREATE_TABLE)? TDMT_MND_CREATE_TABLE:TDMT_MND_CREATE_STB;
|
||||
} else if (pCreateTable->type == TSQL_CREATE_CTABLE) {
|
||||
// if ((code = doCheckForCreateFromStable(pSql, pInfo)) != TSDB_CODE_SUCCESS) {
|
||||
// return code;
|
||||
|
@ -4515,7 +4515,7 @@ int32_t qParserValidateDclSqlNode(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SDclStm
|
|||
return terrno;
|
||||
}
|
||||
|
||||
pDcl->msgType = TSDB_MSG_TYPE_DROP_STB;
|
||||
pDcl->msgType = TDMT_MND_DROP_STB;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "catalog.h"
|
||||
#include "parserUtil.h"
|
||||
#include "queryInfoUtil.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#define IS_RAW_PAYLOAD(t) \
|
||||
(((int)(t)) == PAYLOAD_TYPE_RAW) // 0: K-V payload for non-prepare insert, 1: rawPayload for prepare insert
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "parser.h"
|
||||
#include "taoserror.h"
|
||||
#include "tutil.h"
|
||||
|
@ -1825,7 +1825,7 @@ int tscTransferTableNameList(SSqlObj *pSql, const char *pNameList, int32_t lengt
|
|||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
|
||||
pCmd->command = TSDB_SQL_MULTI_META;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_TABLES_META;
|
||||
pCmd->msgType = TDMT_VND_TABLES_META;
|
||||
|
||||
int code = TSDB_CODE_TSC_INVALID_TABLE_ID_LENGTH;
|
||||
char *str = (char *)pNameList;
|
||||
|
|
|
@ -24,7 +24,7 @@ extern "C" {
|
|||
#include "tarray.h"
|
||||
#include "planner.h"
|
||||
#include "parser.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#define QNODE_TAGSCAN 1
|
||||
#define QNODE_TABLESCAN 2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "query.h"
|
||||
#include "tglobal.h"
|
||||
#include "tsched.h"
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "queryInt.h"
|
||||
#include "query.h"
|
||||
|
||||
int32_t (*queryBuildMsg[TSDB_MSG_TYPE_MAX])(void* input, char **msg, int32_t msgSize, int32_t *msgLen) = {0};
|
||||
int32_t (*queryBuildMsg[TDMT_MAX])(void* input, char **msg, int32_t msgSize, int32_t *msgLen) = {0};
|
||||
|
||||
int32_t (*queryProcessMsgRsp[TSDB_MSG_TYPE_MAX])(void* output, char *msg, int32_t msgSize) = {0};
|
||||
int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char *msg, int32_t msgSize) = {0};
|
||||
|
||||
int32_t queryBuildTableMetaReqMsg(void* input, char **msg, int32_t msgSize, int32_t *msgLen) {
|
||||
if (NULL == input || NULL == msg || NULL == msgLen) {
|
||||
|
@ -264,11 +264,11 @@ int32_t queryProcessTableMetaRsp(void* output, char *msg, int32_t msgSize) {
|
|||
|
||||
|
||||
void initQueryModuleMsgHandle() {
|
||||
queryBuildMsg[TSDB_MSG_TYPE_TABLE_META] = queryBuildTableMetaReqMsg;
|
||||
queryBuildMsg[TSDB_MSG_TYPE_USE_DB] = queryBuildUseDbMsg;
|
||||
queryBuildMsg[TDMT_VND_TABLE_META] = queryBuildTableMetaReqMsg;
|
||||
queryBuildMsg[TDMT_MND_USE_DB] = queryBuildUseDbMsg;
|
||||
|
||||
queryProcessMsgRsp[TSDB_MSG_TYPE_TABLE_META] = queryProcessTableMetaRsp;
|
||||
queryProcessMsgRsp[TSDB_MSG_TYPE_USE_DB] = queryProcessUseDBRsp;
|
||||
queryProcessMsgRsp[TDMT_VND_TABLE_META] = queryProcessTableMetaRsp;
|
||||
queryProcessMsgRsp[TDMT_MND_USE_DB] = queryProcessUseDBRsp;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include <gtest/gtest.h>
|
||||
#include <iostream>
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "query.h"
|
||||
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "query.h"
|
||||
#include "qworker.h"
|
||||
#include "qworkerInt.h"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#include "schedulerInt.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "query.h"
|
||||
#include "catalog.h"
|
||||
|
||||
|
@ -310,7 +310,7 @@ int32_t schAsyncSendMsg(SQueryJob *job, SQueryTask *task, int32_t msgType) {
|
|||
void *msg = NULL;
|
||||
|
||||
switch (msgType) {
|
||||
case TSDB_MSG_TYPE_SUBMIT: {
|
||||
case TDMT_VND_SUBMIT: {
|
||||
if (NULL == task->msg || task->msgLen <= 0) {
|
||||
qError("submit msg is NULL");
|
||||
SCH_ERR_RET(TSDB_CODE_SCH_INTERNAL_ERROR);
|
||||
|
@ -320,7 +320,7 @@ int32_t schAsyncSendMsg(SQueryJob *job, SQueryTask *task, int32_t msgType) {
|
|||
msg = task->msg;
|
||||
break;
|
||||
}
|
||||
case TSDB_MSG_TYPE_QUERY: {
|
||||
case TDMT_VND_QUERY: {
|
||||
if (NULL == task->msg) {
|
||||
qError("query msg is NULL");
|
||||
SCH_ERR_RET(TSDB_CODE_SCH_INTERNAL_ERROR);
|
||||
|
@ -342,7 +342,7 @@ int32_t schAsyncSendMsg(SQueryJob *job, SQueryTask *task, int32_t msgType) {
|
|||
memcpy(pMsg->msg, task->msg, task->msgLen);
|
||||
break;
|
||||
}
|
||||
case TSDB_MSG_TYPE_RES_READY: {
|
||||
case TDMT_VND_RES_READY: {
|
||||
msgSize = sizeof(SResReadyMsg);
|
||||
msg = calloc(1, msgSize);
|
||||
if (NULL == msg) {
|
||||
|
@ -356,7 +356,7 @@ int32_t schAsyncSendMsg(SQueryJob *job, SQueryTask *task, int32_t msgType) {
|
|||
pMsg->taskId = htobe64(task->taskId);
|
||||
break;
|
||||
}
|
||||
case TSDB_MSG_TYPE_FETCH: {
|
||||
case TDMT_VND_FETCH: {
|
||||
msgSize = sizeof(SResFetchMsg);
|
||||
msg = calloc(1, msgSize);
|
||||
if (NULL == msg) {
|
||||
|
@ -370,7 +370,7 @@ int32_t schAsyncSendMsg(SQueryJob *job, SQueryTask *task, int32_t msgType) {
|
|||
pMsg->taskId = htobe64(task->taskId);
|
||||
break;
|
||||
}
|
||||
case TSDB_MSG_TYPE_DROP_TASK:{
|
||||
case TDMT_VND_DROP_TASK:{
|
||||
msgSize = sizeof(STaskDropMsg);
|
||||
msg = calloc(1, msgSize);
|
||||
if (NULL == msg) {
|
||||
|
@ -413,7 +413,7 @@ int32_t schFetchFromRemote(SQueryJob *job) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
SCH_ERR_JRET(schAsyncSendMsg(job, NULL, TSDB_MSG_TYPE_FETCH));
|
||||
SCH_ERR_JRET(schAsyncSendMsg(job, NULL, TDMT_VND_FETCH));
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
||||
|
@ -564,17 +564,17 @@ int32_t schHandleRspMsg(SQueryJob *job, SQueryTask *task, int32_t msgType, int32
|
|||
int32_t code = 0;
|
||||
|
||||
switch (msgType) {
|
||||
case TSDB_MSG_TYPE_QUERY:
|
||||
case TDMT_VND_QUERY:
|
||||
if (rspCode != TSDB_CODE_SUCCESS) {
|
||||
SCH_ERR_JRET(schProcessOnTaskFailure(job, task, rspCode));
|
||||
} else {
|
||||
code = schAsyncSendMsg(job, task, TSDB_MSG_TYPE_RES_READY);
|
||||
code = schAsyncSendMsg(job, task, TDMT_VND_RES_READY);
|
||||
if (code) {
|
||||
goto _task_error;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TSDB_MSG_TYPE_RES_READY:
|
||||
case TDMT_VND_RES_READY:
|
||||
if (rspCode != TSDB_CODE_SUCCESS) {
|
||||
SCH_ERR_JRET(schProcessOnTaskFailure(job, task, rspCode));
|
||||
} else {
|
||||
|
@ -584,7 +584,7 @@ int32_t schHandleRspMsg(SQueryJob *job, SQueryTask *task, int32_t msgType, int32
|
|||
}
|
||||
}
|
||||
break;
|
||||
case TSDB_MSG_TYPE_FETCH:
|
||||
case TDMT_VND_FETCH:
|
||||
SCH_ERR_JRET(rspCode);
|
||||
SCH_ERR_JRET(schProcessOnDataFetched(job));
|
||||
break;
|
||||
|
@ -619,7 +619,7 @@ int32_t schLaunchTask(SQueryJob *job, SQueryTask *task) {
|
|||
SCH_ERR_RET(TSDB_CODE_SCH_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
int32_t msgType = (plan->type == QUERY_TYPE_MODIFY) ? TSDB_MSG_TYPE_SUBMIT : TSDB_MSG_TYPE_QUERY;
|
||||
int32_t msgType = (plan->type == QUERY_TYPE_MODIFY) ? TDMT_VND_SUBMIT : TDMT_VND_QUERY;
|
||||
|
||||
SCH_ERR_RET(schAsyncSendMsg(job, task, msgType));
|
||||
|
||||
|
@ -647,7 +647,7 @@ void schDropJobAllTasks(SQueryJob *job) {
|
|||
while (pIter) {
|
||||
SQueryTask *task = *(SQueryTask **)pIter;
|
||||
|
||||
schAsyncSendMsg(job, task, TSDB_MSG_TYPE_DROP_TASK);
|
||||
schAsyncSendMsg(job, task, TDMT_VND_DROP_TASK);
|
||||
|
||||
pIter = taosHashIterate(job->succTasks, pIter);
|
||||
}
|
||||
|
@ -656,7 +656,7 @@ void schDropJobAllTasks(SQueryJob *job) {
|
|||
while (pIter) {
|
||||
SQueryTask *task = *(SQueryTask **)pIter;
|
||||
|
||||
schAsyncSendMsg(job, task, TSDB_MSG_TYPE_DROP_TASK);
|
||||
schAsyncSendMsg(job, task, TDMT_VND_DROP_TASK);
|
||||
|
||||
pIter = taosHashIterate(job->succTasks, pIter);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "tref.h"
|
||||
#include "taoserror.h"
|
||||
#include "tglobal.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "trpc.h"
|
||||
#include "thash.h"
|
||||
#include "rpcLog.h"
|
||||
|
@ -410,10 +410,10 @@ void rpcSendRequest(void *shandle, const SEpSet *pEpSet, SRpcMsg *pMsg, int64_t
|
|||
// connection type is application specific.
|
||||
// for TDengine, all the query, show commands shall have TCP connection
|
||||
char type = pMsg->msgType;
|
||||
if (type == TSDB_MSG_TYPE_QUERY || type == TSDB_MSG_TYPE_SHOW_RETRIEVE
|
||||
|| type == TSDB_MSG_TYPE_FETCH || type == TSDB_MSG_TYPE_VGROUP_LIST
|
||||
|| type == TSDB_MSG_TYPE_TABLES_META || type == TSDB_MSG_TYPE_TABLE_META
|
||||
|| type == TSDB_MSG_TYPE_SHOW || type == TSDB_MSG_TYPE_STATUS || type == TSDB_MSG_TYPE_ALTER_TABLE)
|
||||
if (type == TDMT_VND_QUERY || type == TDMT_MND_SHOW_RETRIEVE
|
||||
|| type == TDMT_VND_FETCH || type == TDMT_MND_VGROUP_LIST
|
||||
|| type == TDMT_VND_TABLES_META || type == TDMT_VND_TABLE_META
|
||||
|| type == TDMT_MND_SHOW || type == TDMT_MND_STATUS || type == TDMT_VND_ALTER_TABLE)
|
||||
pContext->connType = RPC_CONN_TCPC;
|
||||
|
||||
pContext->rid = taosAddRef(tsRpcRefId, pContext);
|
||||
|
@ -837,16 +837,16 @@ static int rpcProcessReqHead(SRpcConn *pConn, SRpcHead *pHead) {
|
|||
if (pConn->inTranId == pHead->tranId) {
|
||||
if (pConn->inType == pHead->msgType) {
|
||||
if (pHead->code == 0) {
|
||||
tDebug("%s, %s is retransmitted", pConn->info, taosMsg[pHead->msgType]);
|
||||
tDebug("%s, %s is retransmitted", pConn->info, TMSG_INFO(pHead->msgType));
|
||||
rpcSendQuickRsp(pConn, TSDB_CODE_RPC_ACTION_IN_PROGRESS);
|
||||
} else {
|
||||
// do nothing, it is heart beat from client
|
||||
}
|
||||
} else if (pConn->inType == 0) {
|
||||
tDebug("%s, %s is already processed, tranId:%d", pConn->info, taosMsg[pHead->msgType], pConn->inTranId);
|
||||
tDebug("%s, %s is already processed, tranId:%d", pConn->info, TMSG_INFO(pHead->msgType), pConn->inTranId);
|
||||
rpcSendMsgToPeer(pConn, pConn->pRspMsg, pConn->rspMsgLen); // resend the response
|
||||
} else {
|
||||
tDebug("%s, mismatched message %s and tranId", pConn->info, taosMsg[pHead->msgType]);
|
||||
tDebug("%s, mismatched message %s and tranId", pConn->info, TMSG_INFO(pHead->msgType));
|
||||
}
|
||||
|
||||
// do not reply any message
|
||||
|
@ -957,19 +957,19 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv, SRpcReqCont
|
|||
sid = htonl(pHead->destId);
|
||||
*ppContext = NULL;
|
||||
|
||||
if (pHead->msgType >= TSDB_MSG_TYPE_MAX || pHead->msgType <= 0) {
|
||||
if (pHead->msgType >= TDMT_MAX || pHead->msgType <= 0) {
|
||||
tDebug("%s sid:%d, invalid message type:%d", pRpc->label, sid, pHead->msgType);
|
||||
terrno = TSDB_CODE_RPC_INVALID_MSG_TYPE; return NULL;
|
||||
}
|
||||
|
||||
if (sid < 0 || sid >= pRpc->sessions) {
|
||||
tDebug("%s sid:%d, sid is out of range, max sid:%d, %s discarded", pRpc->label, sid,
|
||||
pRpc->sessions, taosMsg[pHead->msgType]);
|
||||
pRpc->sessions, TMSG_INFO(pHead->msgType));
|
||||
terrno = TSDB_CODE_RPC_INVALID_SESSION_ID; return NULL;
|
||||
}
|
||||
|
||||
if (rpcIsReq(pHead->msgType) && htonl(pHead->msgVer) != tsVersion >> 8) {
|
||||
tDebug("%s sid:%d, invalid client version:%x/%x %s", pRpc->label, sid, htonl(pHead->msgVer), tsVersion, taosMsg[pHead->msgType]);
|
||||
tDebug("%s sid:%d, invalid client version:%x/%x %s", pRpc->label, sid, htonl(pHead->msgVer), tsVersion, TMSG_INFO(pHead->msgType));
|
||||
terrno = TSDB_CODE_RPC_INVALID_VERSION; return NULL;
|
||||
}
|
||||
|
||||
|
@ -1094,9 +1094,9 @@ static void *rpcProcessMsgFromPeer(SRecvInfo *pRecv) {
|
|||
SRpcReqContext *pContext;
|
||||
pConn = rpcProcessMsgHead(pRpc, pRecv, &pContext);
|
||||
|
||||
if (pHead->msgType >= 1 && pHead->msgType < TSDB_MSG_TYPE_MAX) {
|
||||
if (pHead->msgType >= 1 && pHead->msgType < TDMT_MAX) {
|
||||
tDebug("%s %p %p, %s received from 0x%x:%hu, parse code:0x%x len:%d sig:0x%08x:0x%08x:%d code:0x%x", pRpc->label,
|
||||
pConn, (void *)pHead->ahandle, taosMsg[pHead->msgType], pRecv->ip, pRecv->port, terrno, pRecv->msgLen,
|
||||
pConn, (void *)pHead->ahandle, TMSG_INFO(pHead->msgType), pRecv->ip, pRecv->port, terrno, pRecv->msgLen,
|
||||
pHead->sourceId, pHead->destId, pHead->tranId, pHead->code);
|
||||
} else {
|
||||
tDebug("%s %p %p, %d received from 0x%x:%hu, parse code:0x%x len:%d sig:0x%08x:0x%08x:%d code:0x%x", pRpc->label,
|
||||
|
@ -1112,10 +1112,10 @@ static void *rpcProcessMsgFromPeer(SRecvInfo *pRecv) {
|
|||
if (code == TSDB_CODE_RPC_INVALID_TIME_STAMP || code == TSDB_CODE_RPC_AUTH_FAILURE) {
|
||||
rpcCloseConn(pConn);
|
||||
}
|
||||
if (pHead->msgType + 1 > 1 && pHead->msgType+1 < TSDB_MSG_TYPE_MAX) {
|
||||
tDebug("%s %p %p, %s is sent with error code:0x%x", pRpc->label, pConn, (void *)pHead->ahandle, taosMsg[pHead->msgType+1], code);
|
||||
if (pHead->msgType + 1 > 1 && pHead->msgType+1 < TDMT_MAX) {
|
||||
tDebug("%s %p %p, %s is sent with error code:0x%x", pRpc->label, pConn, (void *)pHead->ahandle, TMSG_INFO(pHead->msgType+1), code);
|
||||
} else {
|
||||
tError("%s %p %p, %s is sent with error code:0x%x", pRpc->label, pConn, (void *)pHead->ahandle, taosMsg[pHead->msgType], code);
|
||||
tError("%s %p %p, %s is sent with error code:0x%x", pRpc->label, pConn, (void *)pHead->ahandle, TMSG_INFO(pHead->msgType), code);
|
||||
}
|
||||
}
|
||||
} else { // msg is passed to app only parsing is ok
|
||||
|
@ -1343,12 +1343,12 @@ static void rpcSendMsgToPeer(SRpcConn *pConn, void *msg, int msgLen) {
|
|||
|
||||
if ( rpcIsReq(pHead->msgType)) {
|
||||
tDebug("%s, %s is sent to %s:%hu, len:%d sig:0x%08x:0x%08x:%d",
|
||||
pConn->info, taosMsg[pHead->msgType], pConn->peerFqdn, pConn->peerPort,
|
||||
pConn->info, TMSG_INFO(pHead->msgType), pConn->peerFqdn, pConn->peerPort,
|
||||
msgLen, pHead->sourceId, pHead->destId, pHead->tranId);
|
||||
} else {
|
||||
if (pHead->code == 0) pConn->secured = 1; // for success response, set link as secured
|
||||
tDebug("%s, %s is sent to 0x%x:%hu, code:0x%x len:%d sig:0x%08x:0x%08x:%d",
|
||||
pConn->info, taosMsg[pHead->msgType], pConn->peerIp, pConn->peerPort,
|
||||
pConn->info, TMSG_INFO(pHead->msgType), pConn->peerIp, pConn->peerPort,
|
||||
htonl(pHead->code), msgLen, pHead->sourceId, pHead->destId, pHead->tranId);
|
||||
}
|
||||
|
||||
|
@ -1373,7 +1373,7 @@ static void rpcProcessConnError(void *param, void *id) {
|
|||
|
||||
tDebug("%s %p, connection error happens", pRpc->label, pContext->ahandle);
|
||||
|
||||
if (pContext->numOfTry >= pContext->epSet.numOfEps || pContext->msgType == TSDB_MSG_TYPE_FETCH) {
|
||||
if (pContext->numOfTry >= pContext->epSet.numOfEps || pContext->msgType == TDMT_VND_FETCH) {
|
||||
rpcMsg.msgType = pContext->msgType+1;
|
||||
rpcMsg.ahandle = pContext->ahandle;
|
||||
rpcMsg.code = pContext->code;
|
||||
|
@ -1396,17 +1396,17 @@ static void rpcProcessRetryTimer(void *param, void *tmrId) {
|
|||
rpcLockConn(pConn);
|
||||
|
||||
if (pConn->outType && pConn->user[0]) {
|
||||
tDebug("%s, expected %s is not received", pConn->info, taosMsg[(int)pConn->outType + 1]);
|
||||
tDebug("%s, expected %s is not received", pConn->info, TMSG_INFO((int)pConn->outType + 1));
|
||||
pConn->pTimer = NULL;
|
||||
pConn->retry++;
|
||||
|
||||
if (pConn->retry < 4) {
|
||||
tDebug("%s, re-send msg:%s to %s:%hu", pConn->info, taosMsg[pConn->outType], pConn->peerFqdn, pConn->peerPort);
|
||||
tDebug("%s, re-send msg:%s to %s:%hu", pConn->info, TMSG_INFO(pConn->outType), pConn->peerFqdn, pConn->peerPort);
|
||||
rpcSendMsgToPeer(pConn, pConn->pReqMsg, pConn->reqMsgLen);
|
||||
pConn->pTimer = taosTmrStart(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl);
|
||||
} else {
|
||||
// close the connection
|
||||
tDebug("%s, failed to send msg:%s to %s:%hu", pConn->info, taosMsg[pConn->outType], pConn->peerFqdn, pConn->peerPort);
|
||||
tDebug("%s, failed to send msg:%s to %s:%hu", pConn->info, TMSG_INFO(pConn->outType), pConn->peerFqdn, pConn->peerPort);
|
||||
if (pConn->pContext) {
|
||||
pConn->pContext->code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
|
||||
pConn->pContext->pConn = NULL;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tskiplist.h"
|
||||
#include "tutil.h"
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ extern "C" {
|
|||
|
||||
#include "qExtbuffer.h"
|
||||
#include "qFill.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tlosertree.h"
|
||||
#include "qExecutor.h"
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ extern "C" {
|
|||
#include "../../../include/client/taos.h"
|
||||
#include "qAggMain.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tarray.h"
|
||||
#include "tcache.h"
|
||||
#include "tglobal.h"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#include "../../../include/client/taos.h"
|
||||
#include "qTableMeta.h"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "os.h"
|
||||
|
||||
#include "../../../include/client/taos.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tscLog.h"
|
||||
#include "tscSubquery.h"
|
||||
#include "tscUtil.h"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "tsclient.h"
|
||||
#include "tsocket.h"
|
||||
#include "ttimer.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tcq.h"
|
||||
|
||||
#include "../../../include/client/taos.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "qTableMeta.h"
|
||||
#include "qUtil.h"
|
||||
#include "regex.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tcompare.h"
|
||||
#include "texpr.h"
|
||||
#include "tfilter.h"
|
||||
|
|
|
@ -313,7 +313,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
|
|||
|
||||
char *pMsg = rpcMallocCont(pCmd->payloadLen);
|
||||
if (NULL == pMsg) {
|
||||
tscError("0x%"PRIx64" msg:%s malloc failed", pSql->self, taosMsg[pSql->cmd.msgType]);
|
||||
tscError("0x%"PRIx64" msg:%s malloc failed", pSql->self, TMSG_INFO(pSql->cmd.msgType));
|
||||
return TSDB_CODE_TSC_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -489,7 +489,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
|
|||
* There is not response callback function for submit response.
|
||||
* The actual inserted number of points is the first number.
|
||||
*/
|
||||
if (rpcMsg->msgType == TSDB_MSG_TYPE_SUBMIT_RSP && pRes->pRsp != NULL) {
|
||||
if (rpcMsg->msgType == TDMT_VND_SUBMIT_RSP && pRes->pRsp != NULL) {
|
||||
SShellSubmitRspMsg *pMsg = (SShellSubmitRspMsg*)pRes->pRsp;
|
||||
pMsg->code = htonl(pMsg->code);
|
||||
pMsg->numOfRows = htonl(pMsg->numOfRows);
|
||||
|
@ -639,7 +639,7 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
}
|
||||
|
||||
pSql->cmd.payloadLen = sizeof(SRetrieveTableMsg);
|
||||
pSql->cmd.msgType = TSDB_MSG_TYPE_FETCH;
|
||||
pSql->cmd.msgType = TDMT_VND_FETCH;
|
||||
|
||||
pRetrieveMsg->header.contLen = htonl(sizeof(SRetrieveTableMsg));
|
||||
|
||||
|
@ -651,7 +651,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
STableMeta* pTableMeta = tscGetMetaInfo(pQueryInfo, 0)->pTableMeta;
|
||||
|
||||
// pSql->cmd.payloadLen is set during copying data into payload
|
||||
pSql->cmd.msgType = TSDB_MSG_TYPE_SUBMIT;
|
||||
pSql->cmd.msgType = TDMT_VND_SUBMIT;
|
||||
|
||||
SNewVgroupInfo vgroupInfo = {0};
|
||||
taosHashGetClone(tscVgroupMap, &pTableMeta->vgId, sizeof(pTableMeta->vgId), NULL, &vgroupInfo);
|
||||
|
@ -1150,7 +1150,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
|
||||
tscDebug("0x%"PRIx64" msg built success, len:%d bytes", pSql->self, msgLen);
|
||||
pCmd->payloadLen = msgLen;
|
||||
pSql->cmd.msgType = TSDB_MSG_TYPE_QUERY;
|
||||
pSql->cmd.msgType = TDMT_VND_QUERY;
|
||||
|
||||
pQueryMsg->head.contLen = htonl(msgLen);
|
||||
assert(msgLen + minMsgSize() <= (int32_t)pCmd->allocSize);
|
||||
|
@ -1166,7 +1166,7 @@ int32_t tscBuildCreateDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
pCmd->payloadLen = sizeof(SCreateDbMsg);
|
||||
|
||||
pCmd->msgType = (pInfo->pMiscInfo->dbOpt.dbType == TSDB_DB_TYPE_DEFAULT) ? TSDB_MSG_TYPE_CREATE_DB : TSDB_MSG_TYPE_CREATE_TP;
|
||||
pCmd->msgType = (pInfo->pMiscInfo->dbOpt.dbType == TSDB_DB_TYPE_DEFAULT) ? TDMT_MND_CREATE_DB : TSDB_MSG_TYPE_CREATE_TP;
|
||||
|
||||
SCreateDbMsg *pCreateDbMsg = (SCreateDbMsg *)pCmd->payload;
|
||||
|
||||
|
@ -1182,7 +1182,7 @@ int32_t tscBuildCreateFuncMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
SCreateFuncMsg *pCreateFuncMsg = (SCreateFuncMsg *)pCmd->payload;
|
||||
|
||||
pCmd->msgType = TSDB_MSG_TYPE_CREATE_FUNCTION;
|
||||
pCmd->msgType = TDMT_MND_CREATE_FUNCTION;
|
||||
|
||||
pCmd->payloadLen = sizeof(SCreateFuncMsg) + htonl(pCreateFuncMsg->codeLen);
|
||||
|
||||
|
@ -1203,7 +1203,7 @@ int32_t tscBuildCreateDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
SStrToken* t0 = taosArrayGet(pInfo->pMiscInfo->a, 0);
|
||||
strncpy(pCreate->ep, t0->z, t0->n);
|
||||
|
||||
pCmd->msgType = TSDB_MSG_TYPE_CREATE_DNODE;
|
||||
pCmd->msgType = TDMT_MND_CREATE_DNODE;
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -1249,7 +1249,7 @@ int32_t tscBuildAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
}
|
||||
}
|
||||
|
||||
pCmd->msgType = TSDB_MSG_TYPE_CREATE_ACCT;
|
||||
pCmd->msgType = TDMT_MND_CREATE_ACCT;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1277,9 +1277,9 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
}
|
||||
|
||||
if (pUser->type == TSDB_ALTER_USER_PASSWD || pUser->type == TSDB_ALTER_USER_PRIVILEGES) {
|
||||
pCmd->msgType = TSDB_MSG_TYPE_ALTER_USER;
|
||||
pCmd->msgType = TDMT_MND_ALTER_USER;
|
||||
} else {
|
||||
pCmd->msgType = TSDB_MSG_TYPE_CREATE_USER;
|
||||
pCmd->msgType = TDMT_MND_CREATE_USER;
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -1288,7 +1288,7 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
int32_t tscBuildCfgDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
pCmd->payloadLen = sizeof(SCfgDnodeMsg);
|
||||
pCmd->msgType = TSDB_MSG_TYPE_CONFIG_DNODE;
|
||||
pCmd->msgType = TDMT_MND_CONFIG_DNODE;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1310,14 +1310,14 @@ int32_t tscBuildDropDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
|
||||
pDropDbMsg->ignoreNotExists = pInfo->pMiscInfo->existsCheck ? 1 : 0;
|
||||
|
||||
pCmd->msgType = (pInfo->pMiscInfo->dbType == TSDB_DB_TYPE_DEFAULT) ? TSDB_MSG_TYPE_DROP_DB : TSDB_MSG_TYPE_DROP_TP;
|
||||
pCmd->msgType = (pInfo->pMiscInfo->dbType == TSDB_DB_TYPE_DEFAULT) ? TDMT_MND_DROP_DB : TSDB_MSG_TYPE_DROP_TP;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t tscBuildDropFuncMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
|
||||
pCmd->msgType = TSDB_MSG_TYPE_DROP_FUNCTION;
|
||||
pCmd->msgType = TDMT_MND_DROP_FUNCTION;
|
||||
|
||||
pCmd->payloadLen = sizeof(SDropFuncMsg);
|
||||
|
||||
|
@ -1340,7 +1340,7 @@ int32_t tscBuildDropTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
|
||||
pDropTableMsg->supertable = (pInfo->pMiscInfo->tableType == TSDB_SUPER_TABLE)? 1:0;
|
||||
pDropTableMsg->igNotExists = pInfo->pMiscInfo->existsCheck ? 1 : 0;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_DROP_TABLE;
|
||||
pCmd->msgType = TDMT_MND_DROP_TABLE;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1358,7 +1358,7 @@ int32_t tscBuildDropDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
|
||||
SDropDnodeMsg * pDrop = (SDropDnodeMsg *)pCmd->payload;
|
||||
tstrncpy(pDrop->ep, dnodeEp, tListLen(pDrop->ep));
|
||||
pCmd->msgType = TSDB_MSG_TYPE_DROP_DNODE;
|
||||
pCmd->msgType = TDMT_MND_DROP_DNODE;
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -1370,7 +1370,7 @@ int32_t tscBuildDropUserAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
tstrncpy(user, pCmd->payload, TSDB_USER_LEN);
|
||||
|
||||
pCmd->payloadLen = sizeof(SDropUserMsg);
|
||||
pCmd->msgType = (pInfo->type == TSDB_SQL_DROP_USER)? TSDB_MSG_TYPE_DROP_USER:TSDB_MSG_TYPE_DROP_ACCT;
|
||||
pCmd->msgType = (pInfo->type == TSDB_SQL_DROP_USER)? TDMT_MND_DROP_USER:TDMT_MND_DROP_ACCT;
|
||||
|
||||
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) {
|
||||
tscError("0x%"PRIx64" failed to malloc for query msg", pSql->self);
|
||||
|
@ -1395,7 +1395,7 @@ int32_t tscBuildUseDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
SUseDbMsg *pUseDbMsg = (SUseDbMsg *)pCmd->payload;
|
||||
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, 0);
|
||||
tNameExtractFullName(&pTableMetaInfo->name, pUseDbMsg->db);
|
||||
pCmd->msgType = TSDB_MSG_TYPE_USE_DB;
|
||||
pCmd->msgType = TDMT_MND_USE_DB;
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -1412,14 +1412,14 @@ int32_t tscBuildSyncDbReplicaMsg(SSqlObj* pSql, SSqlInfo *pInfo) {
|
|||
SSyncDbMsg *pSyncMsg = (SSyncDbMsg *)pCmd->payload;
|
||||
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, 0);
|
||||
tNameExtractFullName(&pTableMetaInfo->name, pSyncMsg->db);
|
||||
pCmd->msgType = TSDB_MSG_TYPE_SYNC_DB;
|
||||
pCmd->msgType = TDMT_MND_SYNC_DB;
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t tscBuildShowMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_SHOW;
|
||||
pCmd->msgType = TDMT_MND_SHOW;
|
||||
pCmd->payloadLen = sizeof(SShowMsg) + 100;
|
||||
|
||||
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) {
|
||||
|
@ -1473,10 +1473,10 @@ int32_t tscBuildKillMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
|
||||
switch (pCmd->command) {
|
||||
case TSDB_SQL_KILL_QUERY:
|
||||
pCmd->msgType = TSDB_MSG_TYPE_KILL_QUERY;
|
||||
pCmd->msgType = TDMT_MND_KILL_QUERY;
|
||||
break;
|
||||
case TSDB_SQL_KILL_CONNECTION:
|
||||
pCmd->msgType = TSDB_MSG_TYPE_KILL_CONN;
|
||||
pCmd->msgType = TDMT_MND_KILL_CONN;
|
||||
break;
|
||||
case TSDB_SQL_KILL_STREAM:
|
||||
pCmd->msgType = TSDB_MSG_TYPE_KILL_STREAM;
|
||||
|
@ -1592,7 +1592,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
msgLen = (int32_t)(pMsg - (char*)pCreateTableMsg);
|
||||
pCreateTableMsg->contLen = htonl(msgLen);
|
||||
pCmd->payloadLen = msgLen;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_CREATE_TABLE;
|
||||
pCmd->msgType = TDMT_MND_CREATE_TABLE;
|
||||
|
||||
assert(msgLen + minMsgSize() <= size);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -1645,7 +1645,7 @@ int tscBuildAlterTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
msgLen = (int32_t)(pMsg - (char*)pAlterTableMsg);
|
||||
|
||||
pCmd->payloadLen = msgLen;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_ALTER_TABLE;
|
||||
pCmd->msgType = TDMT_VND_ALTER_TABLE;
|
||||
|
||||
assert(msgLen + minMsgSize() <= size);
|
||||
|
||||
|
@ -1654,7 +1654,7 @@ int tscBuildAlterTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
|
||||
int tscBuildUpdateTagMsg(SSqlObj* pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd* pCmd = &pSql->cmd;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_UPDATE_TAG_VAL;
|
||||
pCmd->msgType = TDMT_VND_UPDATE_TAG_VAL;
|
||||
|
||||
SUpdateTableTagValMsg* pUpdateMsg = (SUpdateTableTagValMsg*) pCmd->payload;
|
||||
pCmd->payloadLen = htonl(pUpdateMsg->head.contLen);
|
||||
|
@ -1674,7 +1674,7 @@ int tscBuildUpdateTagMsg(SSqlObj* pSql, SSqlInfo *pInfo) {
|
|||
int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
pCmd->payloadLen = sizeof(SAlterDbMsg);
|
||||
pCmd->msgType = (pInfo->pMiscInfo->dbOpt.dbType == TSDB_DB_TYPE_DEFAULT) ? TSDB_MSG_TYPE_ALTER_DB : TSDB_MSG_TYPE_ALTER_TP;
|
||||
pCmd->msgType = (pInfo->pMiscInfo->dbOpt.dbType == TSDB_DB_TYPE_DEFAULT) ? TDMT_MND_ALTER_DB : TSDB_MSG_TYPE_ALTER_TP;
|
||||
|
||||
SAlterDbMsg *pAlterDbMsg = (SAlterDbMsg* )pCmd->payload;
|
||||
pAlterDbMsg->dbType = -1;
|
||||
|
@ -1741,7 +1741,7 @@ int tscBuildCompactMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
|
||||
int tscBuildRetrieveFromMgmtMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_SHOW_RETRIEVE;
|
||||
pCmd->msgType = TDMT_MND_SHOW_RETRIEVE;
|
||||
pCmd->payloadLen = sizeof(SRetrieveTableMsg);
|
||||
|
||||
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) {
|
||||
|
@ -1861,7 +1861,7 @@ int tscProcessEmptyResultRsp(SSqlObj *pSql) { return tscLocalResultCommonBuilder
|
|||
int tscBuildConnectMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
STscObj *pObj = pSql->pTscObj;
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_CONNECT;
|
||||
pCmd->msgType = TDMT_MND_CONNECT;
|
||||
pCmd->payloadLen = sizeof(SConnectMsg);
|
||||
|
||||
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) {
|
||||
|
@ -1898,7 +1898,7 @@ int tscBuildConnectMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
int tscBuildMultiTableMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
|
||||
pCmd->msgType = TSDB_MSG_TYPE_TABLES_META;
|
||||
pCmd->msgType = TDMT_VND_TABLES_META;
|
||||
assert(pCmd->payloadLen + minMsgSize() <= pCmd->allocSize);
|
||||
|
||||
tscDebug("0x%"PRIx64" build load multi-tablemeta msg completed, numOfTables:%d, msg size:%d", pSql->self, pCmd->count,
|
||||
|
@ -1996,7 +1996,7 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
pthread_mutex_unlock(&pObj->mutex);
|
||||
|
||||
pCmd->payloadLen = msgLen;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_HEARTBEAT;
|
||||
pCmd->msgType = TDMT_MND_HEARTBEAT;
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -2838,7 +2838,7 @@ static int32_t getTableMetaFromMnode(SSqlObj *pSql, STableMetaInfo *pTableMetaIn
|
|||
}
|
||||
|
||||
pNew->cmd.payloadLen = (int32_t)(pMsg - (char*)pInfoMsg);
|
||||
pNew->cmd.msgType = TSDB_MSG_TYPE_TABLE_META;
|
||||
pNew->cmd.msgType = TDMT_VND_TABLE_META;
|
||||
}
|
||||
|
||||
int32_t code = tscBuildAndSendRequest(pNew, NULL);
|
||||
|
@ -2913,7 +2913,7 @@ int32_t getMultiTableMetaFromMnode(SSqlObj *pSql, SArray* pNameList, SArray* pVg
|
|||
}
|
||||
|
||||
pNew->cmd.payloadLen = (int32_t) ((start - pInfo->tableNames) + sizeof(SMultiTableInfoMsg));
|
||||
pNew->cmd.msgType = TSDB_MSG_TYPE_TABLES_META;
|
||||
pNew->cmd.msgType = TDMT_VND_TABLES_META;
|
||||
|
||||
registerSqlObj(pNew);
|
||||
tscDebug("0x%"PRIx64" new pSqlObj:0x%"PRIx64" to get %d tableMeta, vgroupInfo:%d, udf:%d, msg size:%d", pSql->self,
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tscLog.h"
|
||||
#include "tscUtil.h"
|
||||
#include "tsched.h"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tconfig.h"
|
||||
#include "tglobal.h"
|
||||
#include "tnote.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "tscUtil.h"
|
||||
#include "hash.h"
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "texpr.h"
|
||||
#include "tkey.h"
|
||||
#include "tmd5.h"
|
||||
|
@ -5011,7 +5011,7 @@ int tscTransferTableNameList(SSqlObj *pSql, const char *pNameList, int32_t lengt
|
|||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
|
||||
pCmd->command = TSDB_SQL_MULTI_META;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_TABLES_META;
|
||||
pCmd->msgType = TDMT_VND_TABLES_META;
|
||||
|
||||
int code = TSDB_CODE_TSC_INVALID_TABLE_ID_LENGTH;
|
||||
char *str = (char *)pNameList;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "../../../include/client/taos.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tcq.h"
|
||||
#include "tdataformat.h"
|
||||
#include "tglobal.h"
|
||||
|
@ -520,7 +520,7 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
|
|||
pMsg->length = pMsg->header.contLen;
|
||||
pMsg->numOfBlocks = htonl(1);
|
||||
|
||||
pHead->msgType = TSDB_MSG_TYPE_SUBMIT;
|
||||
pHead->msgType = TDMT_VND_SUBMIT;
|
||||
pHead->version = 0;
|
||||
|
||||
// write into vnode write queue
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
//#define _DEFAULT_SOURCE
|
||||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tglobal.h"
|
||||
#include "tlog.h"
|
||||
#include "tcq.h"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tarray.h"
|
||||
#include "tdataformat.h"
|
||||
#include "tname.h"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "../../../include/client/taos.h"
|
||||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tglobal.h"
|
||||
#include "tsclient.h"
|
||||
#include "tsdb.h"
|
||||
|
|
|
@ -20,7 +20,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
|
||||
#include "tarray.h"
|
||||
#include "tutil.h"
|
||||
|
|
|
@ -21,7 +21,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include "../../../include/client/taos.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tstrbuild.h"
|
||||
#include "ttoken.h"
|
||||
#include "tvariant.h"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "texpr.h"
|
||||
#include "ttype.h"
|
||||
#include "tsdb.h"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
#include "os.h"
|
||||
#include "qFill.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tglobal.h"
|
||||
|
||||
#include "exception.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "qExecutor.h"
|
||||
#include "queryLog.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tcompare.h"
|
||||
#include "tulog.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "qAggMain.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "ttype.h"
|
||||
|
||||
#include "qFill.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "os.h"
|
||||
|
||||
#include "qExecutor.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tcompare.h"
|
||||
#include "ttype.h"
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "qHistogram.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tlosertree.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "qSqlparser.h"
|
||||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tmsg.h"
|
||||
#include "tmsgtype.h"
|
||||
#include "tstrbuild.h"
|
||||
#include "ttoken.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue