提交 6c350815 编写于 作者: wmmhello's avatar wmmhello

fix:add sdbFetchCancel to release hash node

上级 da9e3043
...@@ -77,7 +77,6 @@ static SClusterObj *mndAcquireCluster(SMnode *pMnode, void **ppIter) { ...@@ -77,7 +77,6 @@ static SClusterObj *mndAcquireCluster(SMnode *pMnode, void **ppIter) {
if (pIter == NULL) break; if (pIter == NULL) break;
*ppIter = pIter; *ppIter = pIter;
sdbCancelFetch(pSdb, pIter);
return pCluster; return pCluster;
} }
......
...@@ -1303,11 +1303,10 @@ static void mndBuildDBVgroupInfo(SDbObj *pDb, SMnode *pMnode, SArray *pVgList) { ...@@ -1303,11 +1303,10 @@ static void mndBuildDBVgroupInfo(SDbObj *pDb, SMnode *pMnode, SArray *pVgList) {
sdbRelease(pSdb, pVgroup); sdbRelease(pSdb, pVgroup);
if (pDb && (vindex >= pDb->cfg.numOfVgroups)) { if (pDb && (vindex >= pDb->cfg.numOfVgroups)) {
sdbCancelFetch(pSdb, pIter);
break; break;
} }
} }
sdbCancelFetch(pSdb, pIter);
} }
int32_t mndExtractDbInfo(SMnode *pMnode, SDbObj *pDb, SUseDbRsp *pRsp, const SUseDbReq *pReq) { int32_t mndExtractDbInfo(SMnode *pMnode, SDbObj *pDb, SUseDbRsp *pRsp, const SUseDbReq *pReq) {
......
...@@ -852,7 +852,7 @@ int32_t mndDropIdxsByDb(SMnode *pMnode, STrans *pTrans, SDbObj *pDb) { ...@@ -852,7 +852,7 @@ int32_t mndDropIdxsByDb(SMnode *pMnode, STrans *pTrans, SDbObj *pDb) {
if (pIdx->dbUid == pDb->uid) { if (pIdx->dbUid == pDb->uid) {
if (mndSetDropIdxCommitLogs(pMnode, pTrans, pIdx) != 0) { if (mndSetDropIdxCommitLogs(pMnode, pTrans, pIdx) != 0) {
sdbRelease(pSdb, pIdx); sdbRelease(pSdb, pIdx);
sdbCancelFetch(pSdb, pIdx); sdbCancelFetch(pSdb, pIter);
return -1; return -1;
} }
} }
......
...@@ -454,6 +454,7 @@ int32_t mndCreateQnodeList(SMnode *pMnode, SArray **pList, int32_t limit) { ...@@ -454,6 +454,7 @@ int32_t mndCreateQnodeList(SMnode *pMnode, SArray **pList, int32_t limit) {
sdbRelease(pSdb, pObj); sdbRelease(pSdb, pObj);
if (limit > 0 && numOfRows >= limit) { if (limit > 0 && numOfRows >= limit) {
sdbCancelFetch(pSdb, pIter);
break; break;
} }
} }
......
...@@ -198,6 +198,7 @@ SVgObj* mndSchedFetchOneVg(SMnode* pMnode, int64_t dbUid) { ...@@ -198,6 +198,7 @@ SVgObj* mndSchedFetchOneVg(SMnode* pMnode, int64_t dbUid) {
sdbRelease(pMnode->pSdb, pVgroup); sdbRelease(pMnode->pSdb, pVgroup);
continue; continue;
} }
sdbCancelFetch(pMnode->pSdb, pIter);
return pVgroup; return pVgroup;
} }
return pVgroup; return pVgroup;
......
...@@ -2330,6 +2330,7 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName, ...@@ -2330,6 +2330,7 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName,
} }
if (pStream->targetStbUid == suid) { if (pStream->targetStbUid == suid) {
sdbCancelFetch(pSdb, pIter);
sdbRelease(pSdb, pStream); sdbRelease(pSdb, pStream);
return -1; return -1;
} }
...@@ -2338,6 +2339,7 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName, ...@@ -2338,6 +2339,7 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName,
if (nodesStringToNode(pStream->ast, &pAst) != 0) { if (nodesStringToNode(pStream->ast, &pAst) != 0) {
terrno = TSDB_CODE_MND_INVALID_STREAM_OPTION; terrno = TSDB_CODE_MND_INVALID_STREAM_OPTION;
mError("stream:%s, create ast error", pStream->name); mError("stream:%s, create ast error", pStream->name);
sdbCancelFetch(pSdb, pIter);
sdbRelease(pSdb, pStream); sdbRelease(pSdb, pStream);
return -1; return -1;
} }
...@@ -2349,6 +2351,7 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName, ...@@ -2349,6 +2351,7 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName,
SColumnNode *pCol = (SColumnNode *)pNode; SColumnNode *pCol = (SColumnNode *)pNode;
if (pCol->tableId == suid) { if (pCol->tableId == suid) {
sdbCancelFetch(pSdb, pIter);
sdbRelease(pSdb, pStream); sdbRelease(pSdb, pStream);
nodesDestroyNode(pAst); nodesDestroyNode(pAst);
nodesDestroyList(pNodeList); nodesDestroyList(pNodeList);
......
...@@ -1445,7 +1445,6 @@ int32_t mndUserRemoveDb(SMnode *pMnode, STrans *pTrans, char *db) { ...@@ -1445,7 +1445,6 @@ int32_t mndUserRemoveDb(SMnode *pMnode, STrans *pTrans, char *db) {
code = -1; code = -1;
if (mndUserDupObj(pUser, &newUser) != 0) { if (mndUserDupObj(pUser, &newUser) != 0) {
sdbCancelFetch(pSdb, pIter);
break; break;
} }
...@@ -1457,7 +1456,6 @@ int32_t mndUserRemoveDb(SMnode *pMnode, STrans *pTrans, char *db) { ...@@ -1457,7 +1456,6 @@ int32_t mndUserRemoveDb(SMnode *pMnode, STrans *pTrans, char *db) {
SSdbRaw *pCommitRaw = mndUserActionEncode(&newUser); SSdbRaw *pCommitRaw = mndUserActionEncode(&newUser);
if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) {
sdbCancelFetch(pSdb, pIter);
break; break;
} }
(void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY); (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY);
...@@ -1490,7 +1488,6 @@ int32_t mndUserRemoveTopic(SMnode *pMnode, STrans *pTrans, char *topic) { ...@@ -1490,7 +1488,6 @@ int32_t mndUserRemoveTopic(SMnode *pMnode, STrans *pTrans, char *topic) {
code = -1; code = -1;
if (mndUserDupObj(pUser, &newUser) != 0) { if (mndUserDupObj(pUser, &newUser) != 0) {
sdbCancelFetch(pSdb, pIter);
break; break;
} }
...@@ -1499,7 +1496,6 @@ int32_t mndUserRemoveTopic(SMnode *pMnode, STrans *pTrans, char *topic) { ...@@ -1499,7 +1496,6 @@ int32_t mndUserRemoveTopic(SMnode *pMnode, STrans *pTrans, char *topic) {
(void)taosHashRemove(newUser.topics, topic, len); (void)taosHashRemove(newUser.topics, topic, len);
SSdbRaw *pCommitRaw = mndUserActionEncode(&newUser); SSdbRaw *pCommitRaw = mndUserActionEncode(&newUser);
if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) {
sdbCancelFetch(pSdb, pIter);
break; break;
} }
(void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY); (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册