fix: do not process query and fetch msg until vnode restore finished
This commit is contained in:
parent
aaf325489b
commit
ee484470f3
|
@ -240,7 +240,7 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs)
|
|||
isWeak, isBlock, msg, numOfMsgs, arrayPos, pMsg->info.handle);
|
||||
|
||||
if (!pVnode->restored) {
|
||||
vGError("vgId:%d, msg:%p failed to process since not leader", vgId, pMsg);
|
||||
vGError("vgId:%d, msg:%p failed to process since restore not finished", vgId, pMsg);
|
||||
terrno = TSDB_CODE_APP_NOT_READY;
|
||||
vnodeHandleProposeError(pVnode, pMsg, TSDB_CODE_APP_NOT_READY);
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
|
@ -805,6 +805,12 @@ bool vnodeIsReadyForRead(SVnode *pVnode) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (pVnode->restored) {
|
||||
vDebug("vgId:%d, vnode not restore 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