From 12d870ef3b69d8191b11481a1f732c59ed9a332f Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Wed, 12 Oct 2022 20:48:23 +0800 Subject: [PATCH] fix: response TSDB_CODE_VND_NOT_SYNCED while not pVnode->inUse in vnodeProcessWriteMsg --- source/dnode/vnode/src/vnd/vnodeSvr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index b8047abe69..5f96fd8807 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -145,6 +145,12 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp int32_t len; int32_t ret; + if (!pVnode->inUse) { + terrno = TSDB_CODE_VND_NOT_SYNCED; + vError("vgId:%d, not ready to write since %s", TD_VID(pVnode), terrstr()); + return -1; + } + vDebug("vgId:%d, start to process write request %s, index:%" PRId64, TD_VID(pVnode), TMSG_INFO(pMsg->msgType), version);