提交 54a1cf26 编写于 作者: L lichuang

[TD-3963]fix alter vgroup bugs

上级 0f4e6bba
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册