From b536877f513d1e5c046de14ce72ce8caab7fecfe Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 2 Aug 2020 15:14:44 +0800 Subject: [PATCH] TD-1038 TD-1040 --- src/mnode/src/mnodeDb.c | 1 + src/mnode/src/mnodeSdb.c | 2 +- src/mnode/src/mnodeTable.c | 2 ++ src/mnode/src/mnodeVgroup.c | 6 ++++++ src/util/src/tqueue.c | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index c7e3085e69..48acc6787c 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -458,6 +458,7 @@ void mnodeRemoveVgroupFromDb(SVgObj *pVgroup) { pDb->vgList[v2] = pDb->vgList[v2 + 1]; } pDb->numOfVgroups--; + pDb->vgList[pDb->numOfVgroups] = NULL; break; } } diff --git a/src/mnode/src/mnodeSdb.c b/src/mnode/src/mnodeSdb.c index 7ae8b5670c..301dd41cbc 100644 --- a/src/mnode/src/mnodeSdb.c +++ b/src/mnode/src/mnodeSdb.c @@ -494,7 +494,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) { sdbDeleteHash(pTable, pOper); } - return code; + return TSDB_CODE_SUCCESS; } static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) { diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 14cc052c49..5837aed259 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -2359,6 +2359,8 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) { mnodeSendDropChildTableMsg(mnodeMsg, false); rpcMsg->code = TSDB_CODE_SUCCESS; + dnodeSendRpcMnodeWriteRsp(mnodeMsg, rpcMsg->code); + return; } if (rpcMsg->code == TSDB_CODE_SUCCESS || rpcMsg->code == TSDB_CODE_TDB_TABLE_ALREADY_EXIST) { diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index 0c5df5aa11..9423720241 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -449,6 +449,12 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi } } + if (pDb->numOfVgroups < 1) { + mDebug("app:%p:%p, db:%s, failed create new vgroup since:%s, numOfVgroups:%d maxVgroupsPerDb:%d ", + pMsg->rpcMsg.ahandle, pMsg, pDb->name, tstrerror(code), pDb->numOfVgroups, maxVgroupsPerDb); + return code; + } + SVgObj *pVgroup = pDb->vgList[0]; if (pVgroup == NULL) { pthread_mutex_unlock(&pDb->mutex); diff --git a/src/util/src/tqueue.c b/src/util/src/tqueue.c index 8c6d6243eb..e2f0614455 100644 --- a/src/util/src/tqueue.c +++ b/src/util/src/tqueue.c @@ -241,6 +241,7 @@ void taosCloseQset(taos_qset param) { if (param == NULL) return; STaosQset *qset = (STaosQset *)param; +#if 0 // remove all the queues from qset pthread_mutex_lock(&qset->mutex); while (qset->head) { @@ -251,6 +252,7 @@ void taosCloseQset(taos_qset param) { queue->next = NULL; } pthread_mutex_unlock(&qset->mutex); +#endif pthread_mutex_destroy(&qset->mutex); tsem_destroy(&qset->sem); -- GitLab