enh: adjust dmEps.c

This commit is contained in:
Shengliang Guan 2023-01-11 11:37:59 +08:00
parent 8c9daa32fc
commit 71ef10409c
1 changed files with 17 additions and 1 deletions

View File

@ -147,6 +147,22 @@ _OVER:
if (code != 0) { if (code != 0) {
dError("failed to read dnode file:%s since %s", file, terrstr()); dError("failed to read dnode file:%s since %s", file, terrstr());
} }
if (taosArrayGetSize(pData->dnodeEps) == 0) {
SDnodeEp dnodeEp = {0};
dnodeEp.isMnode = 1;
taosGetFqdnPortFromEp(tsFirst, &dnodeEp.ep);
taosArrayPush(pData->dnodeEps, &dnodeEp);
}
dDebug("reset dnode list on startup");
dmResetEps(pData, pData->dnodeEps);
if (dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) {
dError("localEp %s different with %s and need reconfigured", tsLocalEp, file);
return -1;
}
return code; return code;
} }
@ -215,7 +231,7 @@ _OVER:
if (code != 0) { if (code != 0) {
if (terrno == 0) terrno = TAOS_SYSTEM_ERROR(errno); if (terrno == 0) terrno = TAOS_SYSTEM_ERROR(errno);
dInfo("succeed to write dnode file:%s since %s, dnodeVer:%" PRId64, realfile, terrstr(), pData->dnodeVer); dError("failed to write dnode file:%s since %s, dnodeVer:%" PRId64, realfile, terrstr(), pData->dnodeVer);
} }
return code; return code;
} }