Merge pull request #6285 from taosdata/fix/TD-4417
[TD-4417]<fix>: return database not ready if vnode status & role not …
This commit is contained in:
commit
779ae053ad
|
@ -303,6 +303,17 @@ static int32_t vnodeWriteToWQueueImp(SVWriteMsg *pWrite) {
|
|||
}
|
||||
|
||||
int32_t vnodeWriteToWQueue(void *vparam, void *wparam, int32_t qtype, void *rparam) {
|
||||
SVnodeObj *pVnode = vparam;
|
||||
if (qtype == TAOS_QTYPE_RPC) {
|
||||
if (!vnodeInReadyStatus(pVnode)) {
|
||||
return TSDB_CODE_APP_NOT_READY; // it may be in deleting or closing state
|
||||
}
|
||||
|
||||
if (pVnode->role != TAOS_SYNC_ROLE_MASTER) {
|
||||
return TSDB_CODE_APP_NOT_READY;
|
||||
}
|
||||
}
|
||||
|
||||
SVWriteMsg *pWrite = vnodeBuildVWriteMsg(vparam, wparam, qtype, rparam);
|
||||
if (pWrite == NULL) {
|
||||
assert(terrno != 0);
|
||||
|
|
Loading…
Reference in New Issue