From cdee51f60c57af344781003bbddb14d8f0e1657c Mon Sep 17 00:00:00 2001 From: slguan Date: Sun, 23 Feb 2020 10:18:04 +0800 Subject: [PATCH] message of account --- src/client/src/tscServer.c | 32 ++++++++------------ src/client/src/tscSql.c | 1 + src/client/src/tscUtil.c | 3 ++ src/dnode/src/dnodeSystem.c | 27 +++++------------ src/inc/mnode.h | 16 +++++----- src/inc/taosmsg.h | 28 ++++++++--------- src/kit/shell/src/shellMain.c | 10 +++++- src/mnode/CMakeLists.txt | 6 ++-- src/mnode/inc/mgmtAcct.h | 3 +- src/mnode/src/mgmtAcct.c | 29 ++++++------------ src/mnode/src/mgmtShell.c | 57 +++++++++-------------------------- src/mnode/src/mgmtSystem.c | 2 -- src/mnode/src/mgmtUser.c | 5 +++ src/util/CMakeLists.txt | 6 ++-- 14 files changed, 91 insertions(+), 134 deletions(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 704842506b..24a6cb6178 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -196,7 +196,7 @@ int tscSendMsgToServer(SSqlObj *pSql) { } void tscProcessMsgFromServer(char type, void *pCont, int contLen, void *ahandle, int32_t code) { - tscPrint("response is received, pCont:%p, code:%d", pCont, code); + tscPrint("response:%d is received, pCont:%p, contLen:%d code:%d", type, pCont, contLen, code); SSqlObj *pSql = (SSqlObj *)ahandle; if (pSql == NULL || pSql->signature != pSql) { tscError("%p sql is already released, signature:%p", pSql, pSql->signature); @@ -1692,15 +1692,14 @@ int32_t tscBuildCreateDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) { } int32_t tscBuildAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) { - SCreateAcctMsg *pAlterMsg; - char * pMsg, *pStart; - int msgLen = 0; - SSqlCmd *pCmd = &pSql->cmd; + pCmd->payloadLen = sizeof(SCMCreateAcctMsg); + if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) { + tscError("%p failed to malloc for query msg", pSql); + return TSDB_CODE_CLI_OUT_OF_MEMORY; + } - pMsg = doBuildMsgHeader(pSql, &pStart); - - pAlterMsg = (SCreateAcctMsg *)pMsg; + SCMCreateAcctMsg *pAlterMsg = (SCMCreateAcctMsg *)pCmd->payload; SSQLToken *pName = &pInfo->pDCLInfo->user.user; SSQLToken *pPwd = &pInfo->pDCLInfo->user.passwd; @@ -1708,8 +1707,6 @@ int32_t tscBuildAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) { strncpy(pAlterMsg->user, pName->z, pName->n); strncpy(pAlterMsg->pass, pPwd->z, pPwd->n); - pMsg += sizeof(SCreateAcctMsg); - SCreateAcctSQL *pAcctOpt = &pInfo->pDCLInfo->acctOpt; pAlterMsg->cfg.maxUsers = htonl(pAcctOpt->maxUsers); @@ -1735,21 +1732,18 @@ int32_t tscBuildAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) { } } - msgLen = pMsg - pStart; - pCmd->payloadLen = msgLen; - pCmd->msgType = TSDB_MSG_TYPE_CREATE_ACCT; return TSDB_CODE_SUCCESS; } int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) { - SCreateUserMsg *pAlterMsg; + SCMCreateUserMsg *pAlterMsg; char * pMsg, *pStart; SSqlCmd *pCmd = &pSql->cmd; pMsg = doBuildMsgHeader(pSql, &pStart); - pAlterMsg = (SCreateUserMsg *)pMsg; + pAlterMsg = (SCMCreateUserMsg *)pMsg; SUserInfo *pUser = &pInfo->pDCLInfo->user; strncpy(pAlterMsg->user, pUser->user.z, pUser->user.n); @@ -1764,7 +1758,7 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) { strncpy(pAlterMsg->pass, pUser->passwd.z, pUser->passwd.n); } - pMsg += sizeof(SCreateUserMsg); + pMsg += sizeof(SCMCreateUserMsg); pCmd->payloadLen = pMsg - pStart; if (pUser->type == TSDB_ALTER_USER_PASSWD || pUser->type == TSDB_ALTER_USER_PRIVILEGES) { @@ -1877,18 +1871,18 @@ int32_t tscBuildDropDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) { } int32_t tscBuildDropAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) { - SDropUserMsg *pDropMsg; + SCMDropUserMsg *pDropMsg; char * pMsg, *pStart; SSqlCmd *pCmd = &pSql->cmd; pMsg = doBuildMsgHeader(pSql, &pStart); - pDropMsg = (SDropUserMsg *)pMsg; + pDropMsg = (SCMDropUserMsg *)pMsg; SMeterMetaInfo *pMeterMetaInfo = tscGetMeterMetaInfo(pCmd, pCmd->clauseIndex, 0); strcpy(pDropMsg->user, pMeterMetaInfo->name); - pMsg += sizeof(SDropUserMsg); + pMsg += sizeof(SCMDropUserMsg); pCmd->payloadLen = pMsg - pStart; pCmd->msgType = TSDB_MSG_TYPE_DROP_USER; diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 467a95a941..cec84450ff 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -34,6 +34,7 @@ TAOS *taos_connect_imp(const char *ip, const char *user, const char *pass, const void (*fp)(void *, TAOS_RES *, int), void *param, void **taos) { STscObj *pObj; + taos_init(); if (user == NULL) { diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 59e3283b14..4f747053ee 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -430,6 +430,9 @@ void tscFreeResData(SSqlObj* pSql) { } void tscFreeSqlResult(SSqlObj* pSql) { + //TODO not free + return; + tfree(pSql->res.pRsp); pSql->res.row = 0; pSql->res.numOfRows = 0; diff --git a/src/dnode/src/dnodeSystem.c b/src/dnode/src/dnodeSystem.c index 24eeddb1d1..71e8f47e12 100644 --- a/src/dnode/src/dnodeSystem.c +++ b/src/dnode/src/dnodeSystem.c @@ -33,16 +33,12 @@ #include "dnodeVnodeMgmt.h" #ifdef CLUSTER -#include "dnodeCluster.h" -#include "httpAdmin.h" -#include "mnodeAccount.h" -#include "mnodeBalance.h" -#include "mnodeCluster.h" -#include "sdbReplica.h" -#include "multilevelStorage.h" -#include "vnodeCluster.h" -#include "vnodeReplica.h" -#include "dnodeGrant.h" +#include "acct.h" +#include "admin.h" +#include "cluster.h" +#include "grant.h" +#include "replica.h" +#include "storage.h" #endif static pthread_mutex_t tsDnodeMutex; @@ -120,16 +116,7 @@ void dnodeCheckDataDirOpenned(const char *dir) { void dnodeInitPlugins() { #ifdef CLUSTER - dnodeClusterInit(); - httpAdminInit(); - mnodeAccountInit(); - mnodeBalanceInit(); - mnodeClusterInit(); - sdbReplicaInit(); - multilevelStorageInit(); - vnodeClusterInit(); - vnodeReplicaInit(); - dnodeGrantInit(); + acctInit(); #endif } diff --git a/src/inc/mnode.h b/src/inc/mnode.h index 682e82bcae..b4691de04e 100644 --- a/src/inc/mnode.h +++ b/src/inc/mnode.h @@ -247,7 +247,7 @@ typedef struct _db_obj { struct _acctObj; typedef struct _user_obj { - char user[TSDB_USER_LEN + 1]; + char user[TSDB_USER_LEN]; char pass[TSDB_KEY_LEN]; char acct[TSDB_USER_LEN]; int64_t createdTime; @@ -275,23 +275,21 @@ typedef struct { int64_t totalPoints; int64_t inblound; int64_t outbound; - TSKEY sKey; - char accessState; // Checked by mgmt heartbeat message + int64_t sKey; + int8_t accessState; // Checked by mgmt heartbeat message } SAcctInfo; typedef struct _acctObj { - char user[TSDB_USER_LEN + 1]; + char user[TSDB_USER_LEN]; char pass[TSDB_KEY_LEN]; - SAcctCfg cfg; + SCMAcctCfg cfg; int32_t acctId; int64_t createdTime; - char reserved[15]; - char updateEnd[1]; + int8_t reserved[15]; + int8_t updateEnd[1]; SAcctInfo acctInfo; - SDbObj * pHead; SUserObj * pUser; - struct _connObj *pConn; pthread_mutex_t mutex; } SAcctObj; diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 2f5ceb72d1..2138272fc7 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -280,10 +280,6 @@ typedef struct { uint8_t ignoreNotExists; } SDropDbMsg, SUseDbMsg; -typedef struct { - char user[TSDB_USER_LEN]; -} SDropUserMsg, SDropAcctMsg; - typedef struct { char db[TSDB_DB_NAME_LEN]; } SShowTableMsg; @@ -340,21 +336,25 @@ typedef struct { int64_t maxQueryTime; // In unit of hour int64_t maxInbound; int64_t maxOutbound; - char accessState; // Configured only by command -} SAcctCfg; + int8_t accessState; // Configured only by command +} SCMAcctCfg; typedef struct { - char user[TSDB_USER_LEN]; - char pass[TSDB_KEY_LEN]; - SAcctCfg cfg; -} SCreateAcctMsg, SAlterAcctMsg; + char user[TSDB_USER_LEN]; + char pass[TSDB_KEY_LEN]; + SCMAcctCfg cfg; +} SCMCreateAcctMsg, SCMAlterAcctMsg; typedef struct { char user[TSDB_USER_LEN]; - char pass[TSDB_KEY_LEN]; - char privilege; - char flag; -} SCreateUserMsg, SAlterUserMsg; +} SCMDropUserMsg, SCMDropAcctMsg; + +typedef struct { + char user[TSDB_USER_LEN]; + char pass[TSDB_KEY_LEN]; + int8_t privilege; + int8_t flag; +} SCMCreateUserMsg, SCMAlterUserMsg; typedef struct { char db[TSDB_TABLE_ID_LEN]; diff --git a/src/kit/shell/src/shellMain.c b/src/kit/shell/src/shellMain.c index 8c060295e1..de254246d2 100644 --- a/src/kit/shell/src/shellMain.c +++ b/src/kit/shell/src/shellMain.c @@ -81,7 +81,15 @@ struct arguments args = { */ int main(int argc, char* argv[]) { /*setlocale(LC_ALL, "en_US.UTF-8"); */ - + // + void *taos = taos_connect(NULL, "root", "taosdata", NULL, 0); + printf("ok\n"); + taos_query(taos, "create account a pass 'b'"); + while (1) { + sleep(1000); + } + // + if (!checkVersion()) { exit(EXIT_FAILURE); } diff --git a/src/mnode/CMakeLists.txt b/src/mnode/CMakeLists.txt index a8abf54dfd..6bf4ef34e0 100644 --- a/src/mnode/CMakeLists.txt +++ b/src/mnode/CMakeLists.txt @@ -13,9 +13,9 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) ADD_LIBRARY(mnode ${SRC}) TARGET_LINK_LIBRARIES(mnode trpc tutil sdb pthread) - #IF (TD_CLUSTER) - # TARGET_LINK_LIBRARIES(mnode mcluster) - #ENDIF () + IF (TD_CLUSTER) + TARGET_LINK_LIBRARIES(mnode acct) + ENDIF () ENDIF () diff --git a/src/mnode/inc/mgmtAcct.h b/src/mnode/inc/mgmtAcct.h index 8aef8cf658..f0788bf50d 100644 --- a/src/mnode/inc/mgmtAcct.h +++ b/src/mnode/inc/mgmtAcct.h @@ -28,12 +28,11 @@ int32_t mgmtAddUserIntoAcct(SAcctObj *pAcct, SUserObj *pUser); int32_t mgmtRemoveUserFromAcct(SAcctObj *pAcct, SUserObj *pUser); extern int32_t (*mgmtInitAccts)(); +extern void (*mgmtCleanUpAccts)(); extern SAcctObj* (*mgmtGetAcct)(char *acctName); extern int32_t (*mgmtCheckUserLimit)(SAcctObj *pAcct); extern int32_t (*mgmtCheckDbLimit)(SAcctObj *pAcct); extern int32_t (*mgmtCheckTableLimit)(SAcctObj *pAcct, SCreateTableMsg *pCreate); -extern void (*mgmtCheckAcct)(); -extern void (*mgmtCleanUpAccts)(); extern int32_t (*mgmtGetAcctMeta)(SMeterMeta *pMeta, SShowObj *pShow, void *pConn); extern int32_t (*mgmtRetrieveAccts)(SShowObj *pShow, char *data, int32_t rows, void *pConn); diff --git a/src/mnode/src/mgmtAcct.c b/src/mnode/src/mgmtAcct.c index 297898be24..a8eabb5ebe 100644 --- a/src/mnode/src/mgmtAcct.c +++ b/src/mnode/src/mgmtAcct.c @@ -97,18 +97,21 @@ int32_t mgmtRemoveUserFromAcct(SAcctObj *pAcct, SUserObj *pUser) { } int32_t mgmtInitAcctsImp() { + SAcctObj *pAcct = &tsAcctObj; + pAcct->acctId = 0; + strcpy(pAcct->user, "root"); return 0; } int32_t (*mgmtInitAccts)() = mgmtInitAcctsImp; -SAcctObj *mgmtGetAcctImp(char *acctName) { +static SAcctObj *mgmtGetAcctImp(char *acctName) { return &tsAcctObj; } SAcctObj *(*mgmtGetAcct)(char *acctName) = mgmtGetAcctImp; -int32_t mgmtCheckUserLimitImp(SAcctObj *pAcct) { +static int32_t mgmtCheckUserLimitImp(SAcctObj *pAcct) { int32_t numOfUsers = sdbGetNumOfRows(tsUserSdb); if (numOfUsers >= tsMaxUsers) { mWarn("numOfUsers:%d, exceed tsMaxUsers:%d", numOfUsers, tsMaxUsers); @@ -119,7 +122,7 @@ int32_t mgmtCheckUserLimitImp(SAcctObj *pAcct) { int32_t (*mgmtCheckUserLimit)(SAcctObj *pAcct) = mgmtCheckUserLimitImp; -int32_t mgmtCheckDbLimitImp(SAcctObj *pAcct) { +static int32_t mgmtCheckDbLimitImp(SAcctObj *pAcct) { int32_t numOfDbs = sdbGetNumOfRows(tsDbSdb); if (numOfDbs >= tsMaxDbs) { mWarn("numOfDbs:%d, exceed tsMaxDbs:%d", numOfDbs, tsMaxDbs); @@ -130,36 +133,24 @@ int32_t mgmtCheckDbLimitImp(SAcctObj *pAcct) { int32_t (*mgmtCheckDbLimit)(SAcctObj *pAcct) = mgmtCheckDbLimitImp; -int32_t mgmtCheckTableLimitImp(SAcctObj *pAcct, SCreateTableMsg *pCreate) { +static int32_t mgmtCheckTableLimitImp(SAcctObj *pAcct, SCreateTableMsg *pCreate) { return 0; } int32_t (*mgmtCheckTableLimit)(SAcctObj *pAcct, SCreateTableMsg *pCreate) = mgmtCheckTableLimitImp; -void mgmtCheckAcctImp() { - SAcctObj *pAcct = &tsAcctObj; - pAcct->acctId = 0; - strcpy(pAcct->user, "root"); - - mgmtCreateUser(pAcct, "root", "taosdata"); - mgmtCreateUser(pAcct, "monitor", tsInternalPass); - mgmtCreateUser(pAcct, "_root", tsInternalPass); -} - -void (*mgmtCheckAcct)() = mgmtCheckAcctImp; - -void mgmtCleanUpAcctsImp() { +static void mgmtCleanUpAcctsImp() { } void (*mgmtCleanUpAccts)() = mgmtCleanUpAcctsImp; -int32_t mgmtGetAcctMetaImp(SMeterMeta *pMeta, SShowObj *pShow, void *pConn) { +static int32_t mgmtGetAcctMetaImp(SMeterMeta *pMeta, SShowObj *pShow, void *pConn) { return TSDB_CODE_OPS_NOT_SUPPORT; } int32_t (*mgmtGetAcctMeta)(SMeterMeta *pMeta, SShowObj *pShow, void *pConn) = mgmtGetAcctMetaImp; -int32_t mgmtRetrieveAcctsImp(SShowObj *pShow, char *data, int32_t rows, void *pConn) { +static int32_t mgmtRetrieveAcctsImp(SShowObj *pShow, char *data, int32_t rows, void *pConn) { return 0; } diff --git a/src/mnode/src/mgmtShell.c b/src/mnode/src/mgmtShell.c index 1cc7892f38..40b839aa56 100644 --- a/src/mnode/src/mgmtShell.c +++ b/src/mnode/src/mgmtShell.c @@ -60,6 +60,8 @@ void mgmtProcessTranRequest(SSchedMsg *sched) { void *pConn = sched->thandle; (*mgmtProcessShellMsg[msgType])(pCont, contLen, pConn); + //rpcSendResponse(pConn, 12, NULL, 0); + if (sched->msg) { free(sched->msg); } @@ -73,7 +75,7 @@ void mgmtAddToTranRequest(int8_t type, void *pCont, int contLen, void *ahandle) schedMsg.thandle = ahandle; *(int8_t *) (schedMsg.msg) = type; *(int32_t *) (schedMsg.msg + sizeof(int8_t)) = contLen; - memcpy(schedMsg.msg, pCont + sizeof(int32_t) + sizeof(int8_t), contLen); + memcpy(schedMsg.msg + sizeof(int32_t) + sizeof(int8_t), pCont, contLen); taosScheduleTask(tsMgmtTranQhandle, &schedMsg); } @@ -632,7 +634,7 @@ int32_t mgmtProcessKillConnectionMsg(void *pCont, int32_t contLen, void *ahandle } int32_t mgmtProcessCreateUserMsg(void *pCont, int32_t contLen, void *ahandle) { -// SCreateUserMsg *pCreate = (SCreateUserMsg *)pMsg; +// SCMCreateUserMsg *pCreate = (SCMCreateUserMsg *)pMsg; // int32_t code = 0; // // if (mgmtCheckRedirectMsg(pConn, TSDB_MSG_TYPE_CREATE_USER_RSP) != 0) { @@ -654,7 +656,7 @@ int32_t mgmtProcessCreateUserMsg(void *pCont, int32_t contLen, void *ahandle) { } int32_t mgmtProcessAlterUserMsg(void *pCont, int32_t contLen, void *ahandle) { -// SAlterUserMsg *pAlter = (SAlterUserMsg *)pMsg; +// SCMAlterUserMsg *pAlter = (SCMAlterUserMsg *)pMsg; // int32_t code = 0; // SUserObj * pUser; // SUserObj * pOperUser; @@ -766,7 +768,7 @@ int32_t mgmtProcessAlterUserMsg(void *pCont, int32_t contLen, void *ahandle) { } int32_t mgmtProcessDropUserMsg(void *pCont, int32_t contLen, void *ahandle) { -// SDropUserMsg *pDrop = (SDropUserMsg *)pMsg; +// SCMDropUserMsg *pDrop = (SCMDropUserMsg *)pMsg; // int32_t code = 0; // SUserObj * pUser; // SUserObj * pOperUser; @@ -1407,44 +1409,15 @@ int32_t mgmtCheckRedirectMsgImp(void *pConn, int32_t msgType) { } int32_t (*mgmtCheckRedirectMsg)(void *pConn, int32_t msgType) = mgmtCheckRedirectMsgImp; -int32_t mgmtProcessAlterAcctMsgImp(void *pCont, int32_t contLen, void *ahandle) { - //return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_ALTER_ACCT_RSP, TSDB_CODE_OPS_NOT_SUPPORT); - return 0; -} -int32_t (*mgmtProcessAlterAcctMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessAlterAcctMsgImp; - -int32_t mgmtProcessCreateDnodeMsgImp(void *pCont, int32_t contLen, void *ahandle) { - //return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_CREATE_DNODE_RSP, TSDB_CODE_OPS_NOT_SUPPORT); - return 0; -} -int32_t (*mgmtProcessCreateDnodeMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessCreateDnodeMsgImp; - -int32_t mgmtProcessCfgMnodeMsgImp(void *pCont, int32_t contLen, void *ahandle) { - //return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_CFG_MNODE_RSP, TSDB_CODE_OPS_NOT_SUPPORT); - return 0; -} -int32_t (*mgmtProcessCfgMnodeMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessCfgMnodeMsgImp; - -int32_t mgmtProcessDropMnodeMsgImp(void *pCont, int32_t contLen, void *ahandle) { - //return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_DROP_MNODE_RSP, TSDB_CODE_OPS_NOT_SUPPORT); +static int32_t mgmtProcessUnSupportMsg(void *pCont, int32_t contLen, void *ahandle) { + rpcSendResponse(ahandle, TSDB_CODE_OPS_NOT_SUPPORT, NULL, 0); return 0; } -int32_t (*mgmtProcessDropMnodeMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessDropMnodeMsgImp; -int32_t mgmtProcessDropDnodeMsgImp(void *pCont, int32_t contLen, void *ahandle) { - //return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_DROP_DNODE_RSP, TSDB_CODE_OPS_NOT_SUPPORT); - return 0; -} -int32_t (*mgmtProcessDropDnodeMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessDropDnodeMsgImp; - -int32_t mgmtProcessDropAcctMsgImp(void *pCont, int32_t contLen, void *ahandle) { -// return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_DROP_ACCT_RSP, TSDB_CODE_OPS_NOT_SUPPORT); - return 0; -} -int32_t (*mgmtProcessDropAcctMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessDropAcctMsgImp; - -int32_t mgmtProcessCreateAcctMsgImp(void *pCont, int32_t contLen, void *ahandle) { -// return taosSendSimpleRsp(pConn->thandle, TSDB_MSG_TYPE_CREATE_ACCT_RSP, TSDB_CODE_OPS_NOT_SUPPORT); - return 0; -} -int32_t (*mgmtProcessCreateAcctMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessCreateAcctMsgImp; \ No newline at end of file +int32_t (*mgmtProcessAlterAcctMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessUnSupportMsg; +int32_t (*mgmtProcessCreateDnodeMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessUnSupportMsg; +int32_t (*mgmtProcessCfgMnodeMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessUnSupportMsg; +int32_t (*mgmtProcessDropMnodeMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessUnSupportMsg; +int32_t (*mgmtProcessDropDnodeMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessUnSupportMsg; +int32_t (*mgmtProcessDropAcctMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessUnSupportMsg; +int32_t (*mgmtProcessCreateAcctMsg)(void *pCont, int32_t contLen, void *ahandle) = mgmtProcessUnSupportMsg; \ No newline at end of file diff --git a/src/mnode/src/mgmtSystem.c b/src/mnode/src/mgmtSystem.c index ce03bc9f33..1eb114aa89 100644 --- a/src/mnode/src/mgmtSystem.c +++ b/src/mnode/src/mgmtSystem.c @@ -125,8 +125,6 @@ int32_t mgmtStartSystem() { mError("failed to init dnode balance") } - mgmtCheckAcct(); - taosTmrReset(mgmtDoStatistic, tsStatusInterval * 30000, NULL, tsMgmtTmr, &tsMgmtStatisTimer); mPrint("TDengine mgmt is initialized successfully"); diff --git a/src/mnode/src/mgmtUser.c b/src/mnode/src/mgmtUser.c index e03325a922..d57c2797ee 100644 --- a/src/mnode/src/mgmtUser.c +++ b/src/mnode/src/mgmtUser.c @@ -78,6 +78,11 @@ int32_t mgmtInitUsers() { numOfUsers++; } + pAcct = mgmtGetAcct("root"); + mgmtCreateUser(pAcct, "root", "taosdata"); + mgmtCreateUser(pAcct, "monitor", tsInternalPass); + mgmtCreateUser(pAcct, "_root", tsInternalPass); + mTrace("user data is initialized"); return 0; } diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index d39878cfcb..9cca2f2db1 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -108,9 +108,9 @@ ELSEIF(TD_DARWIN_64) TARGET_LINK_LIBRARIES(tutil iconv pthread os) ENDIF() -IF (TD_CLUSTER) - TARGET_LINK_LIBRARIES(tutil mstorage) -ENDIF () +#IF (TD_CLUSTER) +# TARGET_LINK_LIBRARIES(tutil mstorage) +#ENDIF () -- GitLab