diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 7d77e29d7472b26ca1976a3f074041d1e8acd607..ad8c16f826bf222eef9d04d7e4ce8384f55482c1 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -204,7 +204,7 @@ static int32_t mndStbActionUpdate(SSdb *pSdb, SStbObj *pOldStb, SStbObj *pNewStb SStbObj *mndAcquireStb(SMnode *pMnode, char *stbName) { SSdb *pSdb = pMnode->pSdb; SStbObj *pStb = sdbAcquire(pSdb, SDB_STB, stbName); - if (pStb == NULL) { + if (pStb == NULL && terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) { terrno = TSDB_CODE_MND_STB_NOT_EXIST; } return pStb; @@ -513,9 +513,11 @@ static int32_t mndProcesSMCreateStbReq(SMnodeMsg *pMsg) { return 0; } else { terrno = TSDB_CODE_MND_STB_ALREADY_EXIST; - mError("db:%s, failed to create since %s", pCreate->name, terrstr()); + mError("stb:%s, failed to create since %s", pCreate->name, terrstr()); return -1; } + } else if (terrno != TSDB_CODE_MND_STB_NOT_EXIST) { + mError("stb:%s, failed to create since %s", pCreate->name, terrstr()); } // topic should have different name with stb diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 058178260fe7ac29387d018706733b0dcd188834..2301df65d78125c94253f0ce2b7e751f48e3a607 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -825,7 +825,7 @@ static bool mndTransPerformUndoActionStage(SMnode *pMnode, STrans *pTrans) { mDebug("trans:%d, stage from undoAction to undoLog", pTrans->id); continueExec = true; } else if (code == TSDB_CODE_MND_ACTION_IN_PROGRESS) { - mError("trans:%d, stage keep on undoAction since %s", pTrans->id, tstrerror(code)); + mDebug("trans:%d, stage keep on undoAction since %s", pTrans->id, tstrerror(code)); continueExec = false; } else { pTrans->failedTimes++; diff --git a/tests/script/sim/db/error1.sim b/tests/script/sim/db/error1.sim index 6698ca6f67328fb1b54d568ab315cff3c3246f54..bf9e04c017b79fc436a4a7d11547ec8071a183c6 100644 --- a/tests/script/sim/db/error1.sim +++ b/tests/script/sim/db/error1.sim @@ -58,4 +58,42 @@ if $data03 != 0 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +print ========== stop dnode2 +system sh/exec.sh -n dnode2 -s stop -x SIGKILL + +print =============== create database +sql_error drop database d1 + +print ========== start dnode2 +system sh/exec.sh -n dnode2 -s start + +print =============== re-create database +$x = 0 +re-create2: + $x = $x + 1 + sleep 1000 + if $x == 10 then + return -1 + endi + +sql create database d1 vgroups 5 -x re-create2 + +sql show databases +if $rows != 1 then + return -1 +endi + +if $data00 != d1 then + return -1 +endi + +if $data02 != 5 then + return -1 +endi + +if $data03 != 0 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT +system sh/exec.sh -n dnode2 -s stop -x SIGINT \ No newline at end of file