From 116fc722b509b64a5c981806a3b0e0ce7714e732 Mon Sep 17 00:00:00 2001 From: dmchen Date: Mon, 22 Jul 2024 05:46:01 +0000 Subject: [PATCH] error str --- source/dnode/mnode/impl/src/mndShow.c | 14 +++++++------- source/dnode/mnode/impl/src/mndSma.c | 18 +++++++++--------- source/dnode/mnode/impl/src/mndSnode.c | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index 10b54e2afb..d4a28d75ca 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -37,7 +37,7 @@ int32_t mndInitShow(SMnode *pMnode) { pMgmt->cache = taosCacheInit(TSDB_DATA_TYPE_INT, 5000, true, (__cache_free_fn_t)mndFreeShowObj, "show"); if (pMgmt->cache == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; - mError("failed to alloc show cache since %s", terrstr()); + mError("failed to alloc show cache since %s", tstrerror(code)); TAOS_RETURN(code); } @@ -165,7 +165,7 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SRetrieveTableReq *pReq) { SShowObj *pShow = taosCachePut(pMgmt->cache, &showId, sizeof(int64_t), &showObj, size, keepTime); if (pShow == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; - mError("show:0x%" PRIx64 ", failed to put into cache since %s", showId, terrstr()); + mError("show:0x%" PRIx64 ", failed to put into cache since %s", showId, tstrerror(code)); return NULL; } @@ -232,7 +232,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { pMeta = taosHashGet(pMnode->perfsMeta, retrieveReq.tb, strlen(retrieveReq.tb)); if (pMeta == NULL) { code = TSDB_CODE_PAR_TABLE_NOT_EXIST; - mError("failed to process show-retrieve req:%p since %s", pShow, terrstr()); + mError("failed to process show-retrieve req:%p since %s", pShow, tstrerror(code)); TAOS_RETURN(code); } } @@ -240,7 +240,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { pShow = mndCreateShowObj(pMnode, &retrieveReq); if (pShow == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; - mError("failed to process show-meta req since %s", terrstr()); + mError("failed to process show-meta req since %s", tstrerror(code)); TAOS_RETURN(code); } @@ -250,7 +250,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { pShow = mndAcquireShowObj(pMnode, retrieveReq.showId); if (pShow == NULL) { code = TSDB_CODE_MND_INVALID_SHOWOBJ; - mError("failed to process show-retrieve req:%p since %s", pShow, terrstr()); + mError("failed to process show-retrieve req:%p since %s", pShow, tstrerror(code)); TAOS_RETURN(code); } } @@ -264,7 +264,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { if (retrieveFp == NULL) { mndReleaseShowObj(pShow, false); code = TSDB_CODE_MSG_NOT_PROCESSED; - mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, terrstr()); + mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, tstrerror(code)); TAOS_RETURN(code); } @@ -327,7 +327,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { if (pRsp == NULL) { mndReleaseShowObj(pShow, false); code = TSDB_CODE_OUT_OF_MEMORY; - mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, terrstr()); + mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, tstrerror(code)); blockDataDestroy(pBlock); TAOS_RETURN(code); } diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index 1a59b35cf1..0949055aa0 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -664,7 +664,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea } if ((code = mndAllocSmaVgroup(pMnode, pDb, &streamObj.fixedSinkVg)) != 0) { - mError("sma:%s, failed to create since %s", smaObj.name, terrstr()); + mError("sma:%s, failed to create since %s", smaObj.name, tstrerror(code)); TAOS_RETURN(code); } smaObj.dstVgId = streamObj.fixedSinkVg.vgId; @@ -846,7 +846,7 @@ static int32_t mndProcessCreateSmaReq(SRpcMsg *pReq) { _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { - mError("sma:%s, failed to create since %s", createReq.name, terrstr()); + mError("sma:%s, failed to create since %s", createReq.name, tstrerror(code)); } mndReleaseStb(pMnode, pStb); @@ -991,14 +991,14 @@ static int32_t mndDropSma(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SSmaObj *p goto _OVER; } else { if ((code = mndStreamSetDropAction(pMnode, pTrans, pStream)) < 0) { - mError("stream:%s, failed to drop task since %s", pStream->name, terrstr()); + mError("stream:%s, failed to drop task since %s", pStream->name, tstrerror(code)); sdbRelease(pMnode->pSdb, pStream); goto _OVER; } // drop stream if ((code = mndPersistTransLog(pStream, pTrans, SDB_STATUS_DROPPED)) < 0) { - mError("stream:%s, failed to drop log since %s", pStream->name, terrstr()); + mError("stream:%s, failed to drop log since %s", pStream->name, tstrerror(code)); sdbRelease(pMnode->pSdb, pStream); goto _OVER; } @@ -1047,7 +1047,7 @@ int32_t mndDropSmasByStb(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SStbObj *p SStreamObj *pStream = mndAcquireStream(pMnode, streamName); if (pStream != NULL && pStream->smaId == pSma->uid) { if ((code = mndStreamSetDropAction(pMnode, pTrans, pStream)) < 0) { - mError("stream:%s, failed to drop task since %s", pStream->name, terrstr()); + mError("stream:%s, failed to drop task since %s", pStream->name, tstrerror(code)); mndReleaseStream(pMnode, pStream); goto _OVER; } @@ -1144,7 +1144,7 @@ static int32_t mndProcessDropSmaReq(SRpcMsg *pReq) { _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { - mError("sma:%s, failed to drop since %s", dropReq.name, terrstr()); + mError("sma:%s, failed to drop since %s", dropReq.name, tstrerror(code)); } mndReleaseSma(pMnode, pSma); @@ -1300,7 +1300,7 @@ static int32_t mndProcessGetSmaReq(SRpcMsg *pReq) { _OVER: if (code != 0) { - mError("failed to get index %s since %s", indexReq.indexFName, terrstr()); + mError("failed to get index %s since %s", indexReq.indexFName, tstrerror(code)); } TAOS_RETURN(code); @@ -1346,7 +1346,7 @@ static int32_t mndProcessGetTbSmaReq(SRpcMsg *pReq) { _OVER: if (code != 0) { - mError("failed to get table index %s since %s", indexReq.tbFName, terrstr()); + mError("failed to get table index %s since %s", indexReq.tbFName, tstrerror(code)); } tFreeSerializeSTableIndexRsp(&rsp); @@ -1852,7 +1852,7 @@ static int32_t mndProcessCreateTSMAReq(SRpcMsg* pReq) { _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { - mError("tsma:%s, failed to create since %s", createReq.name, terrstr()); + mError("tsma:%s, failed to create since %s", createReq.name, tstrerror(code)); } if (pStb) mndReleaseStb(pMnode, pStb); diff --git a/source/dnode/mnode/impl/src/mndSnode.c b/source/dnode/mnode/impl/src/mndSnode.c index 4bb8ab92fb..e10fb394fc 100644 --- a/source/dnode/mnode/impl/src/mndSnode.c +++ b/source/dnode/mnode/impl/src/mndSnode.c @@ -332,7 +332,7 @@ static int32_t mndProcessCreateSnodeReq(SRpcMsg *pReq) { _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { - mError("snode:%d, failed to create since %s", createReq.dnodeId, terrstr()); + mError("snode:%d, failed to create since %s", createReq.dnodeId, tstrerror(code)); TAOS_RETURN(code); } @@ -457,7 +457,7 @@ static int32_t mndProcessDropSnodeReq(SRpcMsg *pReq) { _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { - mError("snode:%d, failed to drop since %s", dropReq.dnodeId, terrstr()); + mError("snode:%d, failed to drop since %s", dropReq.dnodeId, tstrerror(code)); } mndReleaseSnode(pMnode, pObj);