[TD-3963]fix alter vgroup bugs
This commit is contained in:
parent
0f4e6bba4c
commit
54a1cf26fc
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue