[TD-3963]fix alter vgroup bugs

This commit is contained in:
lichuang 2021-06-08 23:14:58 +08:00
parent 0f4e6bba4c
commit 54a1cf26fc
3 changed files with 16 additions and 1 deletions

View File

@ -40,6 +40,7 @@ void mnodeIncDbRef(SDbObj *pDb);
void mnodeDecDbRef(SDbObj *pDb);
bool mnodeCheckIsMonitorDB(char *db, char *monitordb);
void mnodeDropAllDbs(SAcctObj *pAcct);
int mnodeInsertAlterRow(SDbObj *pDb, void *pMsg);
int32_t mnodeCompactDbs();

View File

@ -1102,6 +1102,17 @@ static int32_t mnodeAlterDbFp(SMnodeMsg *pMsg) {
return TSDB_CODE_MND_ACTION_IN_PROGRESS;
}
int mnodeInsertAlterRow(SDbObj *pDb, void *pMsg) {
SSdbRow desc = {
.type = SDB_OPER_GLOBAL,
.pTable = tsDbSdb,
.pObj = pDb,
.pMsg = pMsg,
};
return sdbInsertRowToQueue(&desc);
}
static int32_t mnodeAlterDb(SDbObj *pDb, SAlterDbMsg *pAlter, void *pMsg) {
mDebug("db:%s, type:%d do alter operation", pDb->name, pDb->cfg.dbType);

View File

@ -961,6 +961,7 @@ void mnodeSendAlterVgroupMsg(SVgObj *pVgroup,SMnodeMsg *pMsg) {
pVgroup->dbName);
if (pMsg) {
pMsg->pVgroup = pVgroup;
mnodeIncVgroupRef(pVgroup);
}
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
SRpcEpSet epSet = mnodeGetEpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp);
@ -1044,7 +1045,9 @@ static void mnodeProcessAlterVnodeRsp(SRpcMsg *rpcMsg) {
if (mnodeMsg->received != mnodeMsg->expected) return;
dnodeReprocessMWriteMsg(mnodeMsg);
mnodeInsertAlterRow(pVgroup->pDb, mnodeMsg);
dnodeSendRpcMWriteRsp(mnodeMsg, TSDB_CODE_SUCCESS);
}
static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg) {