diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 47bd0d0b02..c0ea5e79c7 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2677,15 +2677,6 @@ typedef struct { int32_t tSerializeSMDropSmaReq(void* buf, int32_t bufLen, SMDropSmaReq* pReq); int32_t tDeserializeSMDropSmaReq(void* buf, int32_t bufLen, SMDropSmaReq* pReq); -typedef struct { - int32_t vgId; - SEpSet epSet; -} SVgEpSet; - -typedef struct { - int32_t padding; -} SRSmaExecMsg; - typedef struct { int8_t version; // for compatibility(default 0) int8_t intervalUnit; // MACRO: TIME_UNIT_XXX diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index 2fb934aaad..7a3b06f83a 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -38,7 +38,6 @@ static SSdbRow *mndSmaActionDecode(SSdbRaw *pRaw); static int32_t mndSmaActionInsert(SSdb *pSdb, SSmaObj *pSma); static int32_t mndSmaActionDelete(SSdb *pSdb, SSmaObj *pSpSmatb); static int32_t mndSmaActionUpdate(SSdb *pSdb, SSmaObj *pOld, SSmaObj *pNew); -static int32_t mndSmaGetVgEpSet(SMnode *pMnode, SDbObj *pDb, SVgEpSet **ppVgEpSet, int32_t *numOfVgroups); static int32_t mndProcessCreateSmaReq(SRpcMsg *pReq); static int32_t mndProcessDropSmaReq(SRpcMsg *pReq); static int32_t mndProcessGetSmaReq(SRpcMsg *pReq); @@ -840,6 +839,7 @@ static int32_t mndDropSma(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SSmaObj *p code = 0; _OVER: + mndReleaseStream(pMnode, pStream); mndTransDrop(pTrans); mndReleaseVgroup(pMnode, pVgroup); mndReleaseStb(pMnode, pStb); diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index e2ed6342a7..b0cec23a3f 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -800,11 +800,6 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) { return conflict; } - static void mndTransFreeObj(SSdb *pSdb) { - sdbFreeRowsByType(pSdb, SDB_STREAM); - sdbFreeRowsByType(pSdb, SDB_SMA); -} - int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) { if (pTrans->conflict == TRN_CONFLICT_DB || pTrans->conflict == TRN_CONFLICT_DB_INSIDE) { if (strlen(pTrans->dbname1) == 0 && strlen(pTrans->dbname2) == 0) { @@ -832,8 +827,6 @@ int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) { return -1; } - mndTransFreeObj(pMnode->pSdb); - mDebug("trans:%d, prepare finished", pTrans->id); STrans *pNew = mndAcquireTrans(pMnode, pTrans->id); diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h index 794011b3b2..f922baf329 100644 --- a/source/dnode/mnode/sdb/inc/sdb.h +++ b/source/dnode/mnode/sdb/inc/sdb.h @@ -367,7 +367,6 @@ int64_t sdbGetTableVer(SSdb *pSdb, ESdbType type); */ void sdbSetApplyInfo(SSdb *pSdb, int64_t index, int64_t term, int64_t config); void sdbGetCommitInfo(SSdb *pSdb, int64_t *index, int64_t *term, int64_t *config); -void sdbFreeRowsByType(SSdb *pSdb, ESdbType type); SSdbRaw *sdbAllocRaw(ESdbType type, int8_t sver, int32_t dataLen); void sdbFreeRaw(SSdbRaw *pRaw); diff --git a/source/dnode/mnode/sdb/src/sdb.c b/source/dnode/mnode/sdb/src/sdb.c index d0d79f9670..3db0087334 100644 --- a/source/dnode/mnode/sdb/src/sdb.c +++ b/source/dnode/mnode/sdb/src/sdb.c @@ -65,25 +65,6 @@ SSdb *sdbInit(SSdbOpt *pOption) { return pSdb; } -void sdbFreeRowsByType(SSdb *pSdb, ESdbType type) { - SHashObj *hash = pSdb->hashObjs[type]; - if (hash == NULL || !taosHashGetSize(hash)) { - return; - } - - SSdbRow **ppRow = taosHashIterate(hash, NULL); - while (ppRow != NULL) { - SSdbRow *pRow = *ppRow; - if (pRow == NULL) { - ppRow = taosHashIterate(hash, ppRow); - continue; - } - sdbFreeRow(pSdb, pRow, false); - ppRow = taosHashIterate(hash, ppRow); - } - taosHashClear(hash); -} - void sdbCleanup(SSdb *pSdb) { mDebug("start to cleanup sdb");