From d0f955f98b1d58676b62d94965963afb12e81fe3 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 15 Jun 2020 10:20:24 +0000 Subject: [PATCH] [TD-570] un reference vgroup while create table --- src/mnode/src/mnodeTable.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 79079f99e5..22917f559c 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1464,7 +1464,8 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) { return TSDB_CODE_MND_ACTION_IN_PROGRESS; } -static SChildTableObj* mnodeDoCreateChildTable(SMnodeMsg *pMsg, SVgObj *pVgroup, int32_t tid) { +static SChildTableObj* mnodeDoCreateChildTable(SMnodeMsg *pMsg, int32_t tid) { + SVgObj *pVgroup = pMsg->pVgroup; SCMCreateTableMsg *pCreate = pMsg->rpcMsg.pCont; SChildTableObj *pTable = calloc(1, sizeof(SChildTableObj)); if (pTable == NULL) { @@ -1578,7 +1579,9 @@ static int32_t mnodeProcessCreateChildTableMsg(SMnodeMsg *pMsg) { return mnodeCreateVgroup(pMsg, pMsg->pDb); } - pMsg->pTable = (STableObj *)mnodeDoCreateChildTable(pMsg, pVgroup, sid); + pMsg->pVgroup = pVgroup; + mnodeIncVgroupRef(pVgroup); + pMsg->pTable = (STableObj *)mnodeDoCreateChildTable(pMsg, sid); if (pMsg->pTable == NULL) { return terrno; }