fix: cannot close mnode while transferring snapshot

This commit is contained in:
Shengliang Guan 2022-11-30 11:05:25 +08:00
parent b6d3d2322c
commit 82bc543ed7
2 changed files with 11 additions and 2 deletions

View File

@ -491,6 +491,15 @@ void mndPreClose(SMnode *pMnode) {
if (pMnode != NULL) {
syncLeaderTransfer(pMnode->syncMgmt.sync);
syncPreStop(pMnode->syncMgmt.sync);
while (!syncSnapshotRecving(pMnode->syncMgmt.sync)) {
mInfo("vgId:1, snapshot is recving");
taosMsleep(300);
}
while (!syncSnapshotSending(pMnode->syncMgmt.sync)) {
mInfo("vgId:1, snapshot is sending");
taosMsleep(300);
}
}
}

View File

@ -517,11 +517,11 @@ void vnodeSyncPreClose(SVnode *pVnode) {
syncPreStop(pVnode->sync);
while (!syncSnapshotRecving(pVnode->sync)) {
vInfo("vgId:%s, snapshot is recving");
vInfo("vgId:%d, snapshot is recving", pVnode->config.vgId);
taosMsleep(300);
}
while (!syncSnapshotSending(pVnode->sync)) {
vInfo("vgId:%s, snapshot is sending");
vInfo("vgId:%d, snapshot is sending", pVnode->config.vgId);
taosMsleep(300);
}