diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index 4f959605c0ce770d4844bb23870e9b7d2365c664..bf58adf594dccee98d37e45add5d5f4062fff8b1 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -39,6 +39,7 @@ void *tsDnodeSdb = NULL; int32_t tsDnodeUpdateSize = 0; int32_t tsAccessSquence = 0; +extern void * tsMnodeSdb; extern void * tsVgroupSdb; static int32_t mgmtCreateDnode(uint32_t ip); @@ -101,7 +102,13 @@ static int32_t mgmtDnodeActionDelete(SSdbOper *pOper) { } } - mgmtDropMnode(pDnode->dnodeId); + SMnodeObj *pMnode = mgmtGetMnode(pDnode->dnodeId); + if (pMnode != NULL) { + SSdbOper oper = {.type = SDB_OPER_LOCAL, .table = tsMnodeSdb, .pObj = pMnode}; + sdbDeleteRow(&oper); + mgmtReleaseMnode(pMnode); + } + balanceNotify(); mTrace("dnode:%d, all vgroups:%d is dropped from sdb", pDnode->dnodeId, numOfVgroups); diff --git a/src/mnode/src/mgmtMnode.c b/src/mnode/src/mgmtMnode.c index 3eae218660713bacd03086a50c064889182f3957..922788749e925d185895b6d027f9f65384c55b46 100644 --- a/src/mnode/src/mgmtMnode.c +++ b/src/mnode/src/mgmtMnode.c @@ -30,7 +30,7 @@ #include "mgmtShell.h" #include "mgmtUser.h" -static void * tsMnodeSdb = NULL; +void * tsMnodeSdb = NULL; static int32_t tsMnodeUpdateSize = 0; static int32_t mgmtGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn); static int32_t mgmtRetrieveMnodes(SShowObj *pShow, char *data, int32_t rows, void *pConn); diff --git a/src/plugins/monitor/src/monitorSystem.c b/src/plugins/monitor/src/monitorSystem.c index 1811733790fac80f69e3cd5df9fdf34768c884af..776fdca986080c462564bfc7afe5736a8564e1da 100644 --- a/src/plugins/monitor/src/monitorSystem.c +++ b/src/plugins/monitor/src/monitorSystem.c @@ -397,6 +397,7 @@ void monitorSaveAcctLog(char *acctId, int64_t currentPointsPerSecond, int64_t ma int64_t totalOutbound, int64_t maxOutbound, int64_t totalDbs, int64_t maxDbs, int64_t totalUsers, int64_t maxUsers, int64_t totalStreams, int64_t maxStreams, int64_t totalConns, int64_t maxConns, int8_t accessState) { + if (monitor == NULL) return; if (monitor->state != MONITOR_STATE_INITIALIZED) return; char sql[1024] = {0};