From 2dab54f67886b096b7d902e3772b3dcde787b748 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Thu, 13 Jan 2022 11:00:18 +0800 Subject: [PATCH] (other):fix the core dump caused by vgroup deletion during dnode status msg and mnode processing the message --- src/mnode/src/mnodeVgroup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index ba1dc95619..ad71a83a28 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -903,6 +903,8 @@ static SCreateVnodeMsg *mnodeBuildVnodeMsg(SVgObj *pVgroup) { SDbObj *pDb = pVgroup->pDb; if (pDb == NULL) return NULL; + if (pVgroup->idPool == NULL) return NULL; + SCreateVnodeMsg *pVnode = rpcMallocCont(sizeof(SCreateVnodeMsg)); if (pVnode == NULL) return NULL; @@ -1057,6 +1059,11 @@ void mnodeSendCompactVgroupMsg(SVgObj *pVgroup) { } static void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcEpSet *epSet, void *ahandle) { SCreateVnodeMsg *pCreate = mnodeBuildVnodeMsg(pVgroup); + if (pCreate == NULL) { + mError("vgId: %d, can not create vnode msg for send create vnode", pVgroup->vgId); + return; + } + SRpcMsg rpcMsg = { .ahandle = ahandle, .pCont = pCreate, -- GitLab