提交 e4e86609 编写于 作者: S Shengliang Guan

TD-1915

上级 4bc9284a
...@@ -128,7 +128,7 @@ void dnodeDispatchToMPeerQueue(SRpcMsg *pMsg) { ...@@ -128,7 +128,7 @@ void dnodeDispatchToMPeerQueue(SRpcMsg *pMsg) {
return; return;
} }
SMnodeMsg *pPeer = (SMnodeMsg *)taosAllocateQitem(sizeof(SMnodeMsg)); SMnodeMsg *pPeer = taosAllocateQitem(sizeof(SMnodeMsg));
mnodeCreateMsg(pPeer, pMsg); mnodeCreateMsg(pPeer, pMsg);
taosWriteQitem(tsMPeerQueue, TAOS_QTYPE_RPC, pPeer); taosWriteQitem(tsMPeerQueue, TAOS_QTYPE_RPC, pPeer);
} }
......
...@@ -129,7 +129,7 @@ void dnodeDispatchToMReadQueue(SRpcMsg *pMsg) { ...@@ -129,7 +129,7 @@ void dnodeDispatchToMReadQueue(SRpcMsg *pMsg) {
return; return;
} }
SMnodeMsg *pRead = (SMnodeMsg *)taosAllocateQitem(sizeof(SMnodeMsg)); SMnodeMsg *pRead = taosAllocateQitem(sizeof(SMnodeMsg));
mnodeCreateMsg(pRead, pMsg); mnodeCreateMsg(pRead, pMsg);
taosWriteQitem(tsMReadQueue, TAOS_QTYPE_RPC, pRead); taosWriteQitem(tsMReadQueue, TAOS_QTYPE_RPC, pRead);
} }
......
...@@ -129,7 +129,7 @@ void dnodeDispatchToMWriteQueue(SRpcMsg *pMsg) { ...@@ -129,7 +129,7 @@ void dnodeDispatchToMWriteQueue(SRpcMsg *pMsg) {
return; return;
} }
SMnodeMsg *pWrite = (SMnodeMsg *)taosAllocateQitem(sizeof(SMnodeMsg)); SMnodeMsg *pWrite = taosAllocateQitem(sizeof(SMnodeMsg));
mnodeCreateMsg(pWrite, pMsg); mnodeCreateMsg(pWrite, pMsg);
dDebug("app:%p:%p, msg:%s is put into mwrite queue:%p", pWrite->rpcMsg.ahandle, pWrite, dDebug("app:%p:%p, msg:%s is put into mwrite queue:%p", pWrite->rpcMsg.ahandle, pWrite,
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* to dnode. All theses messages are handled from here * to dnode. All theses messages are handled from here
*/ */
#define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "taosmsg.h" #include "taosmsg.h"
#include "tglobal.h" #include "tglobal.h"
......
...@@ -35,7 +35,13 @@ typedef struct { ...@@ -35,7 +35,13 @@ typedef struct {
} SMnodeRsp; } SMnodeRsp;
typedef struct SMnodeMsg { typedef struct SMnodeMsg {
SRpcMsg rpcMsg; struct SAcctObj * pAcct;
struct SDnodeObj *pDnode;
struct SUserObj * pUser;
struct SDbObj * pDb;
struct SVgObj * pVgroup;
struct STableObj *pTable;
struct SSTableObj*pSTable;
SMnodeRsp rpcRsp; SMnodeRsp rpcRsp;
int8_t received; int8_t received;
int8_t successed; int8_t successed;
...@@ -43,13 +49,7 @@ typedef struct SMnodeMsg { ...@@ -43,13 +49,7 @@ typedef struct SMnodeMsg {
int8_t retry; int8_t retry;
int32_t code; int32_t code;
void * pObj; void * pObj;
struct SAcctObj * pAcct; SRpcMsg rpcMsg;
struct SDnodeObj *pDnode;
struct SUserObj * pUser;
struct SDbObj * pDb;
struct SVgObj * pVgroup;
struct STableObj *pTable;
struct SSuperTableObj *pSTable;
} SMnodeMsg; } SMnodeMsg;
void mnodeCreateMsg(SMnodeMsg *pMsg, SRpcMsg *rpcMsg); void mnodeCreateMsg(SMnodeMsg *pMsg, SRpcMsg *rpcMsg);
......
...@@ -424,42 +424,43 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size, void* buf ...@@ -424,42 +424,43 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size, void* buf
#define TSDB_PORT_DNODEDNODE 5 #define TSDB_PORT_DNODEDNODE 5
#define TSDB_PORT_SYNC 10 #define TSDB_PORT_SYNC 10
#define TSDB_PORT_HTTP 11 #define TSDB_PORT_HTTP 11
#define TSDB_PORT_ARBITRATOR 12 #define TSDB_PORT_ARBITRATOR 12
#define TAOS_QTYPE_RPC 0 typedef enum {
#define TAOS_QTYPE_FWD 1 TAOS_QTYPE_RPC = 0,
#define TAOS_QTYPE_WAL 2 TAOS_QTYPE_FWD = 1,
#define TAOS_QTYPE_CQ 3 TAOS_QTYPE_WAL = 2,
#define TAOS_QTYPE_QUERY 4 TAOS_QTYPE_CQ = 3,
TAOS_QTYPE_QUERY = 4
} EQType;
typedef enum { typedef enum {
TSDB_SUPER_TABLE = 0, // super table TSDB_SUPER_TABLE = 0, // super table
TSDB_CHILD_TABLE = 1, // table created from super table TSDB_CHILD_TABLE = 1, // table created from super table
TSDB_NORMAL_TABLE = 2, // ordinary table TSDB_NORMAL_TABLE = 2, // ordinary table
TSDB_STREAM_TABLE = 3, // table created from stream computing TSDB_STREAM_TABLE = 3, // table created from stream computing
TSDB_TABLE_MAX = 4 TSDB_TABLE_MAX = 4
} ETableType; } ETableType;
typedef enum { typedef enum {
TSDB_MOD_MNODE, TSDB_MOD_MNODE = 0,
TSDB_MOD_HTTP, TSDB_MOD_HTTP = 1,
TSDB_MOD_MONITOR, TSDB_MOD_MONITOR = 2,
TSDB_MOD_MQTT, TSDB_MOD_MQTT = 3,
TSDB_MOD_MAX TSDB_MOD_MAX = 4
} EModuleType; } EModuleType;
typedef enum { typedef enum {
TSDB_CHECK_ITEM_NETWORK, TSDB_CHECK_ITEM_NETWORK,
TSDB_CHECK_ITEM_MEM, TSDB_CHECK_ITEM_MEM,
TSDB_CHECK_ITEM_CPU, TSDB_CHECK_ITEM_CPU,
TSDB_CHECK_ITEM_DISK, TSDB_CHECK_ITEM_DISK,
TSDB_CHECK_ITEM_OS, TSDB_CHECK_ITEM_OS,
TSDB_CHECK_ITEM_ACCESS, TSDB_CHECK_ITEM_ACCESS,
TSDB_CHECK_ITEM_VERSION, TSDB_CHECK_ITEM_VERSION,
TSDB_CHECK_ITEM_DATAFILE, TSDB_CHECK_ITEM_DATAFILE,
TSDB_CHECK_ITEM_MAX TSDB_CHECK_ITEM_MAX
} ECheckItemType; } ECheckItemType;
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -89,7 +89,7 @@ typedef struct STableObj { ...@@ -89,7 +89,7 @@ typedef struct STableObj {
int8_t type; int8_t type;
} STableObj; } STableObj;
typedef struct SSuperTableObj { typedef struct SSTableObj {
STableObj info; STableObj info;
int8_t reserved0[9]; // for fill struct STableObj to 4byte align int8_t reserved0[9]; // for fill struct STableObj to 4byte align
int16_t nextColId; int16_t nextColId;
...@@ -104,7 +104,7 @@ typedef struct SSuperTableObj { ...@@ -104,7 +104,7 @@ typedef struct SSuperTableObj {
int32_t numOfTables; int32_t numOfTables;
SSchema * schema; SSchema * schema;
void * vgHash; void * vgHash;
} SSuperTableObj; } SSTableObj;
typedef struct { typedef struct {
STableObj info; STableObj info;
...@@ -122,8 +122,8 @@ typedef struct { ...@@ -122,8 +122,8 @@ typedef struct {
int32_t refCount; int32_t refCount;
char* sql; //used by normal table char* sql; //used by normal table
SSchema* schema; //used by normal table SSchema* schema; //used by normal table
SSuperTableObj *superTable; SSTableObj*superTable;
} SChildTableObj; } SCTableObj;
typedef struct { typedef struct {
int32_t dnodeId; int32_t dnodeId;
......
...@@ -29,8 +29,8 @@ int64_t mnodeGetChildTableNum(); ...@@ -29,8 +29,8 @@ int64_t mnodeGetChildTableNum();
void * mnodeGetTable(char *tableId); void * mnodeGetTable(char *tableId);
void mnodeIncTableRef(void *pTable); void mnodeIncTableRef(void *pTable);
void mnodeDecTableRef(void *pTable); void mnodeDecTableRef(void *pTable);
void * mnodeGetNextChildTable(void *pIter, SChildTableObj **pTable); void * mnodeGetNextChildTable(void *pIter, SCTableObj **pTable);
void * mnodeGetNextSuperTable(void *pIter, SSuperTableObj **pTable); void * mnodeGetNextSuperTable(void *pIter, SSTableObj **pTable);
void mnodeDropAllChildTables(SDbObj *pDropDb); void mnodeDropAllChildTables(SDbObj *pDropDb);
void mnodeDropAllSuperTables(SDbObj *pDropDb); void mnodeDropAllSuperTables(SDbObj *pDropDb);
void mnodeDropAllChildTablesInVgroups(SVgObj *pVgroup); void mnodeDropAllChildTablesInVgroups(SVgObj *pVgroup);
......
...@@ -43,8 +43,8 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle); ...@@ -43,8 +43,8 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle);
void mnodeAlterVgroup(SVgObj *pVgroup, void *ahandle); void mnodeAlterVgroup(SVgObj *pVgroup, void *ahandle);
int32_t mnodeGetAvailableVgroup(struct SMnodeMsg *pMsg, SVgObj **pVgroup, int32_t *sid); int32_t mnodeGetAvailableVgroup(struct SMnodeMsg *pMsg, SVgObj **pVgroup, int32_t *sid);
void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SChildTableObj *pTable); void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SCTableObj *pTable);
void mnodeRemoveTableFromVgroup(SVgObj *pVgroup, SChildTableObj *pTable); void mnodeRemoveTableFromVgroup(SVgObj *pVgroup, SCTableObj *pTable);
void mnodeSendDropVnodeMsg(int32_t vgId, SRpcEpSet *epSet, void *ahandle); void mnodeSendDropVnodeMsg(int32_t vgId, SRpcEpSet *epSet, void *ahandle);
void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle); void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle);
void mnodeSendAlterVgroupMsg(SVgObj *pVgroup); void mnodeSendAlterVgroupMsg(SVgObj *pVgroup);
......
...@@ -1043,7 +1043,7 @@ void sdbFreeWritequeue() { ...@@ -1043,7 +1043,7 @@ void sdbFreeWritequeue() {
int32_t sdbWriteToQueue(void *param, void *data, int32_t qtype, void *pMsg) { int32_t sdbWriteToQueue(void *param, void *data, int32_t qtype, void *pMsg) {
SWalHead *pHead = data; SWalHead *pHead = data;
int32_t size = sizeof(SWalHead) + pHead->len; int32_t size = sizeof(SWalHead) + pHead->len;
SWalHead *pWal = (SWalHead *)taosAllocateQitem(size); SWalHead *pWal = taosAllocateQitem(size);
memcpy(pWal, pHead, size); memcpy(pWal, pHead, size);
taosWriteQitem(tsSdbWriteQueue, qtype, pWal); taosWriteQitem(tsSdbWriteQueue, qtype, pWal);
......
此差异已折叠。
...@@ -694,7 +694,7 @@ static bool mnodeFilterVgroups(SVgObj *pVgroup, STableObj *pTable) { ...@@ -694,7 +694,7 @@ static bool mnodeFilterVgroups(SVgObj *pVgroup, STableObj *pTable) {
return true; return true;
} }
SChildTableObj *pCTable = (SChildTableObj *)pTable; SCTableObj *pCTable = (SCTableObj *)pTable;
if (pVgroup->vgId == pCTable->vgId) { if (pVgroup->vgId == pCTable->vgId) {
return true; return true;
} else { } else {
...@@ -791,7 +791,7 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v ...@@ -791,7 +791,7 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v
return numOfRows; return numOfRows;
} }
void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SChildTableObj *pTable) { void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SCTableObj *pTable) {
int32_t idPoolSize = taosIdPoolMaxSize(pVgroup->idPool); int32_t idPoolSize = taosIdPoolMaxSize(pVgroup->idPool);
if (pTable->tid > idPoolSize) { if (pTable->tid > idPoolSize) {
mnodeAllocVgroupIdPool(pVgroup); mnodeAllocVgroupIdPool(pVgroup);
...@@ -807,7 +807,7 @@ void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SChildTableObj *pTable) { ...@@ -807,7 +807,7 @@ void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SChildTableObj *pTable) {
} }
} }
void mnodeRemoveTableFromVgroup(SVgObj *pVgroup, SChildTableObj *pTable) { void mnodeRemoveTableFromVgroup(SVgObj *pVgroup, SCTableObj *pTable) {
if (pTable->tid >= 1) { if (pTable->tid >= 1) {
taosFreeId(pVgroup->idPool, pTable->tid); taosFreeId(pVgroup->idPool, pTable->tid);
pVgroup->numOfTables--; pVgroup->numOfTables--;
......
...@@ -49,7 +49,7 @@ static taos_queue tsHttpQueue; ...@@ -49,7 +49,7 @@ static taos_queue tsHttpQueue;
void httpDispatchToResultQueue(void *param, TAOS_RES *result, int32_t numOfRows, void (*fp)(void *param, void *result, int32_t numOfRows)) { void httpDispatchToResultQueue(void *param, TAOS_RES *result, int32_t numOfRows, void (*fp)(void *param, void *result, int32_t numOfRows)) {
if (tsHttpQueue != NULL) { if (tsHttpQueue != NULL) {
SHttpResult *pMsg = (SHttpResult *)taosAllocateQitem(sizeof(SHttpResult)); SHttpResult *pMsg = taosAllocateQitem(sizeof(SHttpResult));
pMsg->param = param; pMsg->param = param;
pMsg->result = result; pMsg->result = result;
pMsg->numOfRows = numOfRows; pMsg->numOfRows = numOfRows;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册