提交 ad965dbc 编写于 作者: S Shengliang Guan

invalid release

上级 6ae9a421
...@@ -26,7 +26,7 @@ static SSdbRaw *mndBnodeActionEncode(SBnodeObj *pObj); ...@@ -26,7 +26,7 @@ static SSdbRaw *mndBnodeActionEncode(SBnodeObj *pObj);
static SSdbRow *mndBnodeActionDecode(SSdbRaw *pRaw); static SSdbRow *mndBnodeActionDecode(SSdbRaw *pRaw);
static int32_t mndBnodeActionInsert(SSdb *pSdb, SBnodeObj *pObj); static int32_t mndBnodeActionInsert(SSdb *pSdb, SBnodeObj *pObj);
static int32_t mndBnodeActionDelete(SSdb *pSdb, SBnodeObj *pObj); static int32_t mndBnodeActionDelete(SSdb *pSdb, SBnodeObj *pObj);
static int32_t mndBnodeActionUpdate(SSdb *pSdb, SBnodeObj *pOldBnode, SBnodeObj *pNewBnode); static int32_t mndBnodeActionUpdate(SSdb *pSdb, SBnodeObj *pOld, SBnodeObj *pNew);
static int32_t mndProcessCreateBnodeReq(SMnodeMsg *pMsg); static int32_t mndProcessCreateBnodeReq(SMnodeMsg *pMsg);
static int32_t mndProcessDropBnodeReq(SMnodeMsg *pMsg); static int32_t mndProcessDropBnodeReq(SMnodeMsg *pMsg);
static int32_t mndProcessCreateBnodeRsp(SMnodeMsg *pMsg); static int32_t mndProcessCreateBnodeRsp(SMnodeMsg *pMsg);
...@@ -155,9 +155,9 @@ static int32_t mndBnodeActionDelete(SSdb *pSdb, SBnodeObj *pObj) { ...@@ -155,9 +155,9 @@ static int32_t mndBnodeActionDelete(SSdb *pSdb, SBnodeObj *pObj) {
return 0; return 0;
} }
static int32_t mndBnodeActionUpdate(SSdb *pSdb, SBnodeObj *pOldBnode, SBnodeObj *pNewBnode) { static int32_t mndBnodeActionUpdate(SSdb *pSdb, SBnodeObj *pOld, SBnodeObj *pNew) {
mTrace("bnode:%d, perform update action, old_row:%p new_row:%p", pOldBnode->id, pOldBnode, pNewBnode); mTrace("bnode:%d, perform update action, old_row:%p new_row:%p", pOld->id, pOld, pNew);
pOldBnode->updateTime = pNewBnode->updateTime; pOld->updateTime = pNew->updateTime;
return 0; return 0;
} }
...@@ -251,6 +251,7 @@ static int32_t mndProcessCreateBnodeReq(SMnodeMsg *pMsg) { ...@@ -251,6 +251,7 @@ static int32_t mndProcessCreateBnodeReq(SMnodeMsg *pMsg) {
SBnodeObj *pObj = mndAcquireBnode(pMnode, pCreate->dnodeId); SBnodeObj *pObj = mndAcquireBnode(pMnode, pCreate->dnodeId);
if (pObj != NULL) { if (pObj != NULL) {
mError("bnode:%d, bnode already exist", pObj->id); mError("bnode:%d, bnode already exist", pObj->id);
terrno = TSDB_CODE_MND_BNODE_ALREADY_EXIST;
mndReleaseBnode(pMnode, pObj); mndReleaseBnode(pMnode, pObj);
return -1; return -1;
} }
...@@ -370,11 +371,12 @@ static int32_t mndProcessDropBnodeReq(SMnodeMsg *pMsg) { ...@@ -370,11 +371,12 @@ static int32_t mndProcessDropBnodeReq(SMnodeMsg *pMsg) {
int32_t code = mndDropBnode(pMnode, pMsg, pObj); int32_t code = mndDropBnode(pMnode, pMsg, pObj);
if (code != 0) { if (code != 0) {
sdbRelease(pMnode->pSdb, pObj);
mError("bnode:%d, failed to drop since %s", pMnode->dnodeId, terrstr()); mError("bnode:%d, failed to drop since %s", pMnode->dnodeId, terrstr());
return -1; return -1;
} }
sdbRelease(pMnode->pSdb, pMnode); sdbRelease(pMnode->pSdb, pObj);
return TSDB_CODE_MND_ACTION_IN_PROGRESS; return TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
......
...@@ -26,7 +26,7 @@ static SSdbRaw *mndQnodeActionEncode(SQnodeObj *pObj); ...@@ -26,7 +26,7 @@ static SSdbRaw *mndQnodeActionEncode(SQnodeObj *pObj);
static SSdbRow *mndQnodeActionDecode(SSdbRaw *pRaw); static SSdbRow *mndQnodeActionDecode(SSdbRaw *pRaw);
static int32_t mndQnodeActionInsert(SSdb *pSdb, SQnodeObj *pObj); static int32_t mndQnodeActionInsert(SSdb *pSdb, SQnodeObj *pObj);
static int32_t mndQnodeActionDelete(SSdb *pSdb, SQnodeObj *pObj); static int32_t mndQnodeActionDelete(SSdb *pSdb, SQnodeObj *pObj);
static int32_t mndQnodeActionUpdate(SSdb *pSdb, SQnodeObj *pOldQnode, SQnodeObj *pNewQnode); static int32_t mndQnodeActionUpdate(SSdb *pSdb, SQnodeObj *pOld, SQnodeObj *pNew);
static int32_t mndProcessCreateQnodeReq(SMnodeMsg *pMsg); static int32_t mndProcessCreateQnodeReq(SMnodeMsg *pMsg);
static int32_t mndProcessDropQnodeReq(SMnodeMsg *pMsg); static int32_t mndProcessDropQnodeReq(SMnodeMsg *pMsg);
static int32_t mndProcessCreateQnodeRsp(SMnodeMsg *pMsg); static int32_t mndProcessCreateQnodeRsp(SMnodeMsg *pMsg);
...@@ -155,9 +155,9 @@ static int32_t mndQnodeActionDelete(SSdb *pSdb, SQnodeObj *pObj) { ...@@ -155,9 +155,9 @@ static int32_t mndQnodeActionDelete(SSdb *pSdb, SQnodeObj *pObj) {
return 0; return 0;
} }
static int32_t mndQnodeActionUpdate(SSdb *pSdb, SQnodeObj *pOldQnode, SQnodeObj *pNewQnode) { static int32_t mndQnodeActionUpdate(SSdb *pSdb, SQnodeObj *pOld, SQnodeObj *pNew) {
mTrace("qnode:%d, perform update action, old_row:%p new_row:%p", pOldQnode->id, pOldQnode, pNewQnode); mTrace("qnode:%d, perform update action, old_row:%p new_row:%p", pOld->id, pOld, pNew);
pOldQnode->updateTime = pNewQnode->updateTime; pOld->updateTime = pNew->updateTime;
return 0; return 0;
} }
...@@ -251,6 +251,7 @@ static int32_t mndProcessCreateQnodeReq(SMnodeMsg *pMsg) { ...@@ -251,6 +251,7 @@ static int32_t mndProcessCreateQnodeReq(SMnodeMsg *pMsg) {
SQnodeObj *pObj = mndAcquireQnode(pMnode, pCreate->dnodeId); SQnodeObj *pObj = mndAcquireQnode(pMnode, pCreate->dnodeId);
if (pObj != NULL) { if (pObj != NULL) {
mError("qnode:%d, qnode already exist", pObj->id); mError("qnode:%d, qnode already exist", pObj->id);
terrno = TSDB_CODE_MND_QNODE_ALREADY_EXIST;
mndReleaseQnode(pMnode, pObj); mndReleaseQnode(pMnode, pObj);
return -1; return -1;
} }
...@@ -370,11 +371,12 @@ static int32_t mndProcessDropQnodeReq(SMnodeMsg *pMsg) { ...@@ -370,11 +371,12 @@ static int32_t mndProcessDropQnodeReq(SMnodeMsg *pMsg) {
int32_t code = mndDropQnode(pMnode, pMsg, pObj); int32_t code = mndDropQnode(pMnode, pMsg, pObj);
if (code != 0) { if (code != 0) {
sdbRelease(pMnode->pSdb, pObj);
mError("qnode:%d, failed to drop since %s", pMnode->dnodeId, terrstr()); mError("qnode:%d, failed to drop since %s", pMnode->dnodeId, terrstr());
return -1; return -1;
} }
sdbRelease(pMnode->pSdb, pMnode); sdbRelease(pMnode->pSdb, pObj);
return TSDB_CODE_MND_ACTION_IN_PROGRESS; return TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
......
...@@ -26,7 +26,7 @@ static SSdbRaw *mndSnodeActionEncode(SSnodeObj *pObj); ...@@ -26,7 +26,7 @@ static SSdbRaw *mndSnodeActionEncode(SSnodeObj *pObj);
static SSdbRow *mndSnodeActionDecode(SSdbRaw *pRaw); static SSdbRow *mndSnodeActionDecode(SSdbRaw *pRaw);
static int32_t mndSnodeActionInsert(SSdb *pSdb, SSnodeObj *pObj); static int32_t mndSnodeActionInsert(SSdb *pSdb, SSnodeObj *pObj);
static int32_t mndSnodeActionDelete(SSdb *pSdb, SSnodeObj *pObj); static int32_t mndSnodeActionDelete(SSdb *pSdb, SSnodeObj *pObj);
static int32_t mndSnodeActionUpdate(SSdb *pSdb, SSnodeObj *pOldSnode, SSnodeObj *pNewSnode); static int32_t mndSnodeActionUpdate(SSdb *pSdb, SSnodeObj *pOld, SSnodeObj *pNew);
static int32_t mndProcessCreateSnodeReq(SMnodeMsg *pMsg); static int32_t mndProcessCreateSnodeReq(SMnodeMsg *pMsg);
static int32_t mndProcessDropSnodeReq(SMnodeMsg *pMsg); static int32_t mndProcessDropSnodeReq(SMnodeMsg *pMsg);
static int32_t mndProcessCreateSnodeRsp(SMnodeMsg *pMsg); static int32_t mndProcessCreateSnodeRsp(SMnodeMsg *pMsg);
...@@ -155,9 +155,9 @@ static int32_t mndSnodeActionDelete(SSdb *pSdb, SSnodeObj *pObj) { ...@@ -155,9 +155,9 @@ static int32_t mndSnodeActionDelete(SSdb *pSdb, SSnodeObj *pObj) {
return 0; return 0;
} }
static int32_t mndSnodeActionUpdate(SSdb *pSdb, SSnodeObj *pOldSnode, SSnodeObj *pNewSnode) { static int32_t mndSnodeActionUpdate(SSdb *pSdb, SSnodeObj *pOld, SSnodeObj *pNew) {
mTrace("snode:%d, perform update action, old_row:%p new_row:%p", pOldSnode->id, pOldSnode, pNewSnode); mTrace("snode:%d, perform update action, old_row:%p new_row:%p", pOld->id, pOld, pNew);
pOldSnode->updateTime = pNewSnode->updateTime; pOld->updateTime = pNew->updateTime;
return 0; return 0;
} }
...@@ -251,6 +251,7 @@ static int32_t mndProcessCreateSnodeReq(SMnodeMsg *pMsg) { ...@@ -251,6 +251,7 @@ static int32_t mndProcessCreateSnodeReq(SMnodeMsg *pMsg) {
SSnodeObj *pObj = mndAcquireSnode(pMnode, pCreate->dnodeId); SSnodeObj *pObj = mndAcquireSnode(pMnode, pCreate->dnodeId);
if (pObj != NULL) { if (pObj != NULL) {
mError("snode:%d, snode already exist", pObj->id); mError("snode:%d, snode already exist", pObj->id);
terrno = TSDB_CODE_MND_SNODE_ALREADY_EXIST;
mndReleaseSnode(pMnode, pObj); mndReleaseSnode(pMnode, pObj);
return -1; return -1;
} }
...@@ -370,11 +371,12 @@ static int32_t mndProcessDropSnodeReq(SMnodeMsg *pMsg) { ...@@ -370,11 +371,12 @@ static int32_t mndProcessDropSnodeReq(SMnodeMsg *pMsg) {
int32_t code = mndDropSnode(pMnode, pMsg, pObj); int32_t code = mndDropSnode(pMnode, pMsg, pObj);
if (code != 0) { if (code != 0) {
sdbRelease(pMnode->pSdb, pObj);
mError("snode:%d, failed to drop since %s", pMnode->dnodeId, terrstr()); mError("snode:%d, failed to drop since %s", pMnode->dnodeId, terrstr());
return -1; return -1;
} }
sdbRelease(pMnode->pSdb, pMnode); sdbRelease(pMnode->pSdb, pObj);
return TSDB_CODE_MND_ACTION_IN_PROGRESS; return TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册