diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index c1ae5273c2..30953736eb 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -799,6 +799,13 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) { TSDB_CHECK_NULL(sql, code, lino, _OVER, terrno); } + // check for the taskEp update trans + if (isNodeUpdateTransActive()) { + mError("stream:%s failed to create stream, node update trans is active", createReq.name); + code = TSDB_CODE_STREAM_TASK_IVLD_STATUS; + goto _OVER; + } + SDbObj *pSourceDb = mndAcquireDb(pMnode, createReq.sourceDB); if (pSourceDb == NULL) { code = terrno; @@ -807,13 +814,6 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) { goto _OVER; } - // check for the taskEp update trans - if (isNodeUpdateTransActive()) { - mError("stream:%s failed to create stream, node update trans is active", createReq.name); - code = TSDB_CODE_STREAM_TASK_IVLD_STATUS; - goto _OVER; - } - code = mndCheckForSnode(pMnode, pSourceDb); mndReleaseDb(pMnode, pSourceDb); if (code != 0) {