From a657409880b01478ed78497b01e9719069b3c6bd Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 10 Feb 2022 17:53:43 +0800 Subject: [PATCH] message redirection mechanism of mnode --- source/dnode/mgmt/impl/src/dndMnode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/dnode/mgmt/impl/src/dndMnode.c b/source/dnode/mgmt/impl/src/dndMnode.c index 20585f269b..0874c633bf 100644 --- a/source/dnode/mgmt/impl/src/dndMnode.c +++ b/source/dnode/mgmt/impl/src/dndMnode.c @@ -552,8 +552,12 @@ static void dndWriteMnodeMsgToWorker(SDnode *pDnode, SDnodeWorker *pWorker, SRpc if (code != 0) { if (pRpcMsg->msgType & 1u) { - SRpcMsg rsp = {.handle = pRpcMsg->handle, .ahandle = pRpcMsg->ahandle, .code = code}; - rpcSendResponse(&rsp); + if (code == TSDB_CODE_DND_MNODE_NOT_DEPLOYED || code == TSDB_CODE_APP_NOT_READY) { + dndSendRedirectRsp(pDnode, pRpcMsg); + } else { + SRpcMsg rsp = {.handle = pRpcMsg->handle, .ahandle = pRpcMsg->ahandle, .code = code}; + rpcSendResponse(&rsp); + } } rpcFreeCont(pRpcMsg->pCont); } -- GitLab