fix: create db errors

This commit is contained in:
Shengliang Guan 2024-10-31 16:36:35 +08:00
parent aec6f3a105
commit 5bab977a43
2 changed files with 16 additions and 9 deletions

View File

@ -57,7 +57,6 @@ static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq);
#ifndef TD_ENTERPRISE
int32_t mndProcessCompactDbReq(SRpcMsg *pReq) { return TSDB_CODE_OPS_NOT_SUPPORT; }
int32_t mndCheckDbDnodeList(SMnode *pMnode, char *db, char *dnodeListStr, SArray *dnodeList) { return 0; }
#endif
int32_t mndInitDb(SMnode *pMnode) {
@ -926,6 +925,11 @@ _exit:
TAOS_RETURN(code);
}
int32_t mndCheckDbDnodeList(SMnode *pMnode, char *db, char *dnodeListStr, SArray *dnodeList) {
terrno = TSDB_CODE_OPS_NOT_SUPPORT;
return terrno;
}
static int32_t mndProcessCreateDbReq(SRpcMsg *pReq) {
SMnode *pMnode = pReq->info.node;
int32_t code = -1;

View File

@ -724,15 +724,18 @@ static bool mndBuildDnodesArrayFp(SMnode *pMnode, void *pObj, void *p1, void *p2
}
if (dnodeList != NULL) {
bool inDnodeList = false;
for (int32_t index = 0; index < taosArrayGetSize(dnodeList); ++index) {
int32_t dnodeId = *(int32_t *)taosArrayGet(dnodeList, index);
if (pDnode->id == dnodeId) {
inDnodeList = true;
int32_t dnodeListSize = taosArrayGetSize(dnodeList);
if (dnodeListSize > 0) {
bool inDnodeList = false;
for (int32_t index = 0; index < dnodeListSize; ++index) {
int32_t dnodeId = *(int32_t *)taosArrayGet(dnodeList, index);
if (pDnode->id == dnodeId) {
inDnodeList = true;
}
}
if (!inDnodeList) {
return true;
}
}
if (!inDnodeList) {
return true;
}
}