enh: force drop dnode
This commit is contained in:
parent
1ad604a5f9
commit
26f1e64f2a
|
@ -472,7 +472,8 @@ static int32_t mndSetDropMnodeCommitLogs(SMnode *pMnode, STrans *pTrans, SMnodeO
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnodeObj *pDnode, SMnodeObj *pObj, bool force) {
|
static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnodeObj *pDnode, SMnodeObj *pObj,
|
||||||
|
bool force) {
|
||||||
SSdb *pSdb = pMnode->pSdb;
|
SSdb *pSdb = pMnode->pSdb;
|
||||||
void *pIter = NULL;
|
void *pIter = NULL;
|
||||||
SDDropMnodeReq dropReq = {0};
|
SDDropMnodeReq dropReq = {0};
|
||||||
|
@ -752,7 +753,7 @@ static void mndReloadSyncConfig(SMnode *pMnode) {
|
||||||
mInfo("vgId:1, mnode sync not reconfig since readyMnodes:%d updatingMnodes:%d", readyMnodes, updatingMnodes);
|
mInfo("vgId:1, mnode sync not reconfig since readyMnodes:%d updatingMnodes:%d", readyMnodes, updatingMnodes);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// ASSERT(0);
|
// ASSERT(0);
|
||||||
|
|
||||||
if (cfg.myIndex == -1) {
|
if (cfg.myIndex == -1) {
|
||||||
#if 1
|
#if 1
|
||||||
|
|
|
@ -388,9 +388,9 @@ _OVER:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t mndProcessDropSnodeReq(SRpcMsg *pReq) {
|
static int32_t mndProcessDropSnodeReq(SRpcMsg *pReq) {
|
||||||
SMnode *pMnode = pReq->info.node;
|
SMnode *pMnode = pReq->info.node;
|
||||||
int32_t code = -1;
|
int32_t code = -1;
|
||||||
SSnodeObj *pObj = NULL;
|
SSnodeObj *pObj = NULL;
|
||||||
SMDropSnodeReq dropReq = {0};
|
SMDropSnodeReq dropReq = {0};
|
||||||
|
|
||||||
if (tDeserializeSCreateDropMQSNodeReq(pReq->pCont, pReq->contLen, &dropReq) != 0) {
|
if (tDeserializeSCreateDropMQSNodeReq(pReq->pCont, pReq->contLen, &dropReq) != 0) {
|
||||||
|
|
|
@ -1116,7 +1116,7 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb,
|
||||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1;
|
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1;
|
||||||
|
|
||||||
if (newVg.replica == 1) {
|
if (newVg.replica == 1) {
|
||||||
mInfo("vgId:%d, all data is dropped since replica=1 and dnode force dropped, stable should be recreated in this vgroup, but we not support it yet", pVgroup->vgId);
|
mInfo("vgId:%d, all data is dropped since replica=1", pVgroup->vgId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,7 +284,8 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
vTrace("vgId:%d, process %s request, code:0x%x index:%" PRId64, TD_VID(pVnode), TMSG_INFO(pMsg->msgType), pRsp->code, version);
|
vTrace("vgId:%d, process %s request, code:0x%x index:%" PRId64, TD_VID(pVnode), TMSG_INFO(pMsg->msgType), pRsp->code,
|
||||||
|
version);
|
||||||
|
|
||||||
walApplyVer(pVnode->pWal, version);
|
walApplyVer(pVnode->pWal, version);
|
||||||
|
|
||||||
|
|
|
@ -1133,8 +1133,8 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) {
|
||||||
sError("vgId:%d, failed to open raft cfg file at %s", pSyncNode->vgId, pSyncNode->configPath);
|
sError("vgId:%d, failed to open raft cfg file at %s", pSyncNode->vgId, pSyncNode->configPath);
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (syncIsConfigChanged(&pSyncNode->pRaftCfg->cfg, &pSyncInfo->syncCfg)) {
|
if (pSyncInfo->syncCfg.replicaNum > 0 && syncIsConfigChanged(&pSyncNode->pRaftCfg->cfg, &pSyncInfo->syncCfg)) {
|
||||||
sInfo("vgId:%d, use sync config from input options and write to cfg file", pSyncNode->vgId);
|
sInfo("vgId:%d, use sync config from input options and write to cfg file", pSyncNode->vgId);
|
||||||
pSyncNode->pRaftCfg->cfg = pSyncInfo->syncCfg;
|
pSyncNode->pRaftCfg->cfg = pSyncInfo->syncCfg;
|
||||||
if (raftCfgPersist(pSyncNode->pRaftCfg) != 0) {
|
if (raftCfgPersist(pSyncNode->pRaftCfg) != 0) {
|
||||||
|
@ -3380,7 +3380,7 @@ int32_t syncNodeDoCommit(SSyncNode* ths, SyncIndex beginIndex, SyncIndex endInde
|
||||||
// ASSERT(code == 0);
|
// ASSERT(code == 0);
|
||||||
// ASSERT(pEntry != NULL);
|
// ASSERT(pEntry != NULL);
|
||||||
if (code != 0 || pEntry == NULL) {
|
if (code != 0 || pEntry == NULL) {
|
||||||
syncNodeErrorLog(ths, "get log entry error");
|
syncNodeErrorLog(ths, "get log entry error");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue