提交 cc4558ff 编写于 作者: dengyihao's avatar dengyihao

opt index

上级 a05eb4b1
...@@ -353,33 +353,33 @@ static int32_t mndProcessCreateIdxReq(SRpcMsg *pReq) { ...@@ -353,33 +353,33 @@ static int32_t mndProcessCreateIdxReq(SRpcMsg *pReq) {
//} //}
} }
pDb = mndAcquireDbByIdx(pMnode, createReq.idxName); // pDb = mndAcquireDbByIdx(pMnode, createReq.idxName);
if (pDb == NULL) { // if (pDb == NULL) {
terrno = TSDB_CODE_MND_DB_NOT_SELECTED; // terrno = TSDB_CODE_MND_DB_NOT_SELECTED;
goto _OVER; // goto _OVER;
} / e
}
if (mndCheckDbPrivilege(pMnode, pReq->info.conn.user, MND_OPER_WRITE_DB, pDb) != 0) { if (mndCheckDbPrivilege(pMnode, pReq->info.conn.user, MND_OPER_WRITE_DB, pDb) != 0) {
goto _OVER; goto _OVER;
} }
code = mndAddIndex(pMnode, pReq, &createReq, pDb, pStb); code = mndAddIndex(pMnode, pReq, &createReq, pDb, pStb);
if (terrno == TSDB_CODE_MND_TAG_INDEX_ALREADY_EXIST || terrno == TSDB_CODE_MND_TAG_NOT_EXIST) { if (terrno == TSDB_CODE_MND_TAG_INDEX_ALREADY_EXIST || terrno == TSDB_CODE_MND_TAG_NOT_EXIST) {
return terrno; return terrno;
} else { } else {
if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS;
} }
_OVER: _OVER : if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { mError("stb:%s, failed to create since %s", createReq.idxName, terrstr());
mError("stb:%s, failed to create since %s", createReq.idxName, terrstr()); }
}
mndReleaseStb(pMnode, pStb); mndReleaseStb(pMnode, pStb);
mndReleaseIdx(pMnode, pIdx); mndReleaseIdx(pMnode, pIdx);
mndReleaseDb(pMnode, pDb); mndReleaseDb(pMnode, pDb);
return code; return code;
} }
static int32_t mndSetDropIdxRedoLogs(SMnode *pMnode, STrans *pTrans, SIdxObj *pIdx) { static int32_t mndSetDropIdxRedoLogs(SMnode *pMnode, STrans *pTrans, SIdxObj *pIdx) {
...@@ -387,7 +387,7 @@ static int32_t mndSetDropIdxRedoLogs(SMnode *pMnode, STrans *pTrans, SIdxObj *pI ...@@ -387,7 +387,7 @@ static int32_t mndSetDropIdxRedoLogs(SMnode *pMnode, STrans *pTrans, SIdxObj *pI
if (pRedoRaw == NULL) return -1; if (pRedoRaw == NULL) return -1;
if (mndTransAppendRedolog(pTrans, pRedoRaw) != 0) return -1; if (mndTransAppendRedolog(pTrans, pRedoRaw) != 0) return -1;
if (sdbSetRawStatus(pRedoRaw, SDB_STATUS_DROPPING) != 0) return -1; if (sdbSetRawStatus(pRedoRaw, SDB_STATUS_DROPPING) != 0) return -1;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册