From 4c95270f582c329b68f1a1828970d7329ad61811 Mon Sep 17 00:00:00 2001 From: Shengliang Date: Sun, 23 Jan 2022 22:18:36 -0800 Subject: [PATCH] minor changes --- source/dnode/mnode/impl/src/mndFunc.c | 8 +++++--- source/dnode/mnode/impl/src/mndStb.c | 5 ++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndFunc.c b/source/dnode/mnode/impl/src/mndFunc.c index 15d5ef2d7a..7aada921f3 100644 --- a/source/dnode/mnode/impl/src/mndFunc.c +++ b/source/dnode/mnode/impl/src/mndFunc.c @@ -267,9 +267,9 @@ static int32_t mndProcessCreateFuncReq(SMnodeMsg *pReq) { mDebug("func:%s, start to create", pCreate->name); - SFuncObj *pFunc = mndAcquireFunc(pMnode->pSdb, pCreate->name); + SFuncObj *pFunc = mndAcquireFunc(pMnode, pCreate->name); if (pFunc != NULL) { - mndReleaseFunc(pMnode->pSdb, pFunc); + mndReleaseFunc(pMnode, pFunc); if (pCreate->igExists) { mDebug("stb:%s, already exist, ignore exist is set", pCreate->name); return 0; @@ -334,7 +334,7 @@ static int32_t mndProcessDropFuncReq(SMnodeMsg *pReq) { return -1; } - SFuncObj *pFunc = mndAcquireFunc(pMnode->pSdb, pDrop->name); + SFuncObj *pFunc = mndAcquireFunc(pMnode, pDrop->name); if (pFunc == NULL) { if (pDrop->igNotExists) { mDebug("func:%s, not exist, ignore not exist is set", pDrop->name); @@ -347,6 +347,8 @@ static int32_t mndProcessDropFuncReq(SMnodeMsg *pReq) { } int32_t code = mndDropFunc(pMnode, pReq, pFunc); + mndReleaseFunc(pMnode, pFunc); + if (code != 0) { mError("func:%s, failed to drop since %s", pDrop->name, terrstr()); return -1; diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index cd1b69d023..45b8428663 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -483,7 +483,7 @@ static int32_t mndProcessMCreateStbReq(SMnodeMsg *pReq) { SStbObj *pStb = mndAcquireStb(pMnode, pCreate->name); if (pStb != NULL) { - mndReleaseStb(pMnode->pSdb, pStb); + mndReleaseStb(pMnode, pStb); if (pCreate->igExists) { mDebug("stb:%s, already exist, ignore exist is set", pCreate->name); return 0; @@ -643,7 +643,7 @@ static int32_t mndDropStb(SMnode *pMnode, SMnodeMsg *pReq, SStbObj *pStb) { DROP_STB_OVER: mndTransDrop(pTrans); - return 0; + return code; } static int32_t mndProcessMDropStbReq(SMnodeMsg *pReq) { @@ -668,7 +668,6 @@ static int32_t mndProcessMDropStbReq(SMnodeMsg *pReq) { mndReleaseStb(pMnode, pStb); if (code != 0) { - terrno = code; mError("stb:%s, failed to drop since %s", pDrop->name, terrstr()); return -1; }