diff --git a/src/mnode/inc/mgmtVgroup.h b/src/mnode/inc/mgmtVgroup.h index 3f8dc35a00eb27f37714b3895fe28db6abf4fd99..21a2c9b8963d2cb60d96ce8372bc1c0876a84ce0 100644 --- a/src/mnode/inc/mgmtVgroup.h +++ b/src/mnode/inc/mgmtVgroup.h @@ -32,7 +32,7 @@ void mgmtCleanUpVgroups(); SVgObj *mgmtGetVgroup(int32_t vgId); void mgmtIncVgroupRef(SVgObj *pVgroup); void mgmtDecVgroupRef(SVgObj *pVgroup); -void mgmtDropAllDbVgroups(SDbObj *pDropDb); +void mgmtDropAllDbVgroups(SDbObj *pDropDb, bool sendMsg); void mgmtDropAllDnodeVgroups(SDnodeObj *pDropDnode); void * mgmtGetNextVgroup(void *pNode, SVgObj **pVgroup); diff --git a/src/mnode/src/mgmtDb.c b/src/mnode/src/mgmtDb.c index 3e7577af0696ef591217224d3e08403f16fd5097..4d8bce2a677a507f5cf94d0982dde1d7cb863fb2 100644 --- a/src/mnode/src/mgmtDb.c +++ b/src/mnode/src/mgmtDb.c @@ -82,7 +82,7 @@ static int32_t mgmtDbActionDelete(SSdbOper *pOper) { mgmtDropDbFromAcct(pAcct, pDb); mgmtDropAllChildTables(pDb); mgmtDropAllSuperTables(pDb); - mgmtDropAllDbVgroups(pDb); + mgmtDropAllDbVgroups(pDb, false); mgmtDecAcctRef(pAcct); return TSDB_CODE_SUCCESS; @@ -932,7 +932,9 @@ static void mgmtProcessDropDbMsg(SQueuedMsg *pMsg) { return; } -#if 0 +#if 1 + mgmtDropAllDbVgroups(pMsg->pDb, true); +#else SVgObj *pVgroup = pMsg->pDb->pHead; if (pVgroup != NULL) { mPrint("vgId:%d, will be dropped", pVgroup->vgId); diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index b3260850ad03e8d7c111c96a9526f013988df0ee..ae2d2dcb08e3badaa103035245b380de86f7672a 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -773,7 +773,7 @@ void mgmtDropAllDnodeVgroups(SDnodeObj *pDropDnode) { } } -void mgmtDropAllDbVgroups(SDbObj *pDropDb) { +void mgmtDropAllDbVgroups(SDbObj *pDropDb, bool sendMsg) { void *pNode = NULL; void *pLastNode = NULL; int32_t numOfVgroups = 0; @@ -794,7 +794,10 @@ void mgmtDropAllDbVgroups(SDbObj *pDropDb) { sdbDeleteRow(&oper); pNode = pLastNode; numOfVgroups++; - mgmtSendDropVgroupMsg(pVgroup, NULL); + + if (sendMsg) { + mgmtSendDropVgroupMsg(pVgroup, NULL); + } } mgmtDecVgroupRef(pVgroup);