fix: do not process query and fetch msg until vnode restore finished
This commit is contained in:
parent
7e85a15c31
commit
f14d00a5d6
|
@ -797,6 +797,12 @@ bool vnodeIsLeader(SVnode *pVnode) {
|
|||
}
|
||||
|
||||
bool vnodeIsReadyForRead(SVnode *pVnode) {
|
||||
if (!pVnode->restored) {
|
||||
vDebug("vgId:%d, vnode restore not finished", pVnode->config.vgId);
|
||||
terrno = TSDB_CODE_APP_NOT_READY;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (syncIsReady(pVnode->sync)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -805,12 +811,6 @@ bool vnodeIsReadyForRead(SVnode *pVnode) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!pVnode->restored) {
|
||||
vDebug("vgId:%d, vnode restore not finished", pVnode->config.vgId);
|
||||
terrno = TSDB_CODE_APP_NOT_READY;
|
||||
return false;
|
||||
}
|
||||
|
||||
vDebug("vgId:%d, vnode not ready for read, state:%s, last:%ld, cmt:%ld", pVnode->config.vgId,
|
||||
syncGetMyRoleStr(pVnode->sync), syncGetLastIndex(pVnode->sync), syncGetCommitIndex(pVnode->sync));
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue