should not send msg while sdb restore

This commit is contained in:
slguan 2020-05-02 15:39:10 +08:00
parent 294f8d0a6c
commit c3a19c9d66
3 changed files with 10 additions and 5 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);