From 2029befaa635daf6a8b6bf3afecde0a2aac67607 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 10 Feb 2022 17:17:10 +0800 Subject: [PATCH] repeated creation of the same supertable may deadlock --- source/dnode/mnode/impl/src/mndStb.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 2b61ae7176..6749fdb877 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -581,12 +581,11 @@ static int32_t mndProcessMCreateStbReq(SMnodeMsg *pReq) { } code = mndCreateStb(pMnode, pReq, &createReq, pDb); + if (code == 0) code = TSDB_CODE_MND_ACTION_IN_PROGRESS; CREATE_STB_OVER: - if (code != 0) { + if (code != 0 && code != TSDB_CODE_MND_ACTION_IN_PROGRESS) { mError("stb:%s, failed to create since %s", createReq.name, terrstr()); - } else { - code = TSDB_CODE_MND_ACTION_IN_PROGRESS; } mndReleaseStb(pMnode, pStb); @@ -1039,12 +1038,11 @@ static int32_t mndProcessMAlterStbReq(SMnodeMsg *pReq) { } code = mndAlterStb(pMnode, pReq, &alterReq, pDb, pStb); + if (code == 0) code = TSDB_CODE_MND_ACTION_IN_PROGRESS; ALTER_STB_OVER: - if (code != 0) { + if (code != 0 && code != TSDB_CODE_MND_ACTION_IN_PROGRESS) { mError("stb:%s, failed to alter since %s", alterReq.name, terrstr()); - } else { - code = TSDB_CODE_MND_ACTION_IN_PROGRESS; } mndReleaseStb(pMnode, pStb); -- GitLab