fix: cannot close vnode while transferring snapshot

This commit is contained in:
Shengliang Guan 2022-11-30 11:02:07 +08:00
parent 4b11f358dd
commit b6d3d2322c
1 changed files with 10 additions and 0 deletions

View File

@ -515,6 +515,16 @@ void vnodeSyncPreClose(SVnode *pVnode) {
vInfo("vgId:%d, pre close sync", pVnode->config.vgId);
syncLeaderTransfer(pVnode->sync);
syncPreStop(pVnode->sync);
while (!syncSnapshotRecving(pVnode->sync)) {
vInfo("vgId:%s, snapshot is recving");
taosMsleep(300);
}
while (!syncSnapshotSending(pVnode->sync)) {
vInfo("vgId:%s, snapshot is sending");
taosMsleep(300);
}
taosThreadMutexLock(&pVnode->lock);
if (pVnode->blocked) {
vInfo("vgId:%d, post block after close sync", pVnode->config.vgId);