From 82bc543ed7d08ae28955a32216cc62c534e09811 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 30 Nov 2022 11:05:25 +0800 Subject: [PATCH] fix: cannot close mnode while transferring snapshot --- source/dnode/mnode/impl/src/mndMain.c | 9 +++++++++ source/dnode/vnode/src/vnd/vnodeSync.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 2d888d2ff7..1b74b00dac 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -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); + } } } diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index ad6f153aca..5ae9813bef 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -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); } -- GitLab