提交 1f91ac75 编写于 作者: S Shengliang Guan

TD-1663

上级 06dd3f79
......@@ -183,13 +183,13 @@ extern int32_t debugFlag;
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
void taosInitGlobalCfg();
bool taosCheckGlobalCfg();
void taosSetAllDebugFlag();
bool taosCfgDynamicOptions(char *msg);
int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port);
bool taosCheckBalanceCfgOptions(const char *option, int32_t *vnodeId, int32_t *dnodeId);
void taosInitGlobalCfg();
int32_t taosCheckGlobalCfg();
void taosSetAllDebugFlag();
bool taosCfgDynamicOptions(char *msg);
int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port);
bool taosCheckBalanceCfgOptions(const char *option, int32_t *vnodeId, int32_t *dnodeId);
#ifdef __cplusplus
}
#endif
......
......@@ -1316,7 +1316,7 @@ void taosInitGlobalCfg() {
pthread_once(&tsInitGlobalCfgOnce, doInitGlobalConfig);
}
bool taosCheckGlobalCfg() {
int32_t taosCheckGlobalCfg() {
char fqdn[TSDB_FQDN_LEN];
uint16_t port;
......@@ -1375,9 +1375,9 @@ bool taosCheckGlobalCfg() {
tsSyncPort = tsServerPort + TSDB_PORT_SYNC;
tsHttpPort = tsServerPort + TSDB_PORT_HTTP;
// taosPrintGlobalCfg();
taosPrintGlobalCfg();
return true;
return 0;
}
int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port) {
......
......@@ -87,7 +87,7 @@ bool dnodeCheckEpChanged(int32_t dnodeId, char *epstr) {
char epSaved[TSDB_EP_LEN + 1];
snprintf(epSaved, TSDB_EP_LEN, "%s:%u", ep->dnodeFqdn, ep->dnodePort);
changed = strcmp(epstr, epSaved) != 0;
// tstrncpy(epstr, epSaved, TSDB_EP_LEN);
tstrncpy(epstr, epSaved, TSDB_EP_LEN);
}
pthread_mutex_unlock(&tsEpsMutex);
return changed;
......@@ -236,7 +236,7 @@ PRASE_EPS_OVER:
dnodeResetEps(eps);
if (eps) free(eps);
// dnodeUpdateEp(dnodeGetDnodeId(), tsLocalEp, tsLocalFqdn, &tsServerPort);
dnodeUpdateEp(dnodeGetDnodeId(), tsLocalEp, tsLocalFqdn, &tsServerPort);
terrno = 0;
return 0;
......
......@@ -124,10 +124,10 @@ void dnodeGetEpSetForShell(SRpcEpSet *epSet) {
}
static void dnodePrintMInfos(SMnodeInfos *minfos) {
// dInfo("print mnode infos, mnodeNum:%d inUse:%d", minfos->mnodeNum, minfos->inUse);
// for (int32_t i = 0; i < minfos->mnodeNum; i++) {
// dInfo("mnode index:%d, %s", minfos->mnodeInfos[i].mnodeId, minfos->mnodeInfos[i].mnodeEp);
// }
dInfo("print mnode infos, mnodeNum:%d inUse:%d", minfos->mnodeNum, minfos->inUse);
for (int32_t i = 0; i < minfos->mnodeNum; i++) {
dInfo("mnode index:%d, %s", minfos->mnodeInfos[i].mnodeId, minfos->mnodeInfos[i].mnodeEp);
}
}
static void dnodeResetMInfos(SMnodeInfos *minfos) {
......@@ -240,10 +240,10 @@ PARSE_MINFOS_OVER:
if (fp != NULL) fclose(fp);
terrno = 0;
// for (int32_t i = 0; i < minfos.mnodeNum; ++i) {
// SMnodeInfo *mInfo = &minfos.mnodeInfos[i];
// dnodeUpdateEp(mInfo->mnodeId, mInfo->mnodeEp, NULL, NULL);
// }
for (int32_t i = 0; i < minfos.mnodeNum; ++i) {
SMnodeInfo *mInfo = &minfos.mnodeInfos[i];
dnodeUpdateEp(mInfo->mnodeId, mInfo->mnodeEp, NULL, NULL);
}
dnodeResetMInfos(&minfos);
return 0;
}
......
......@@ -58,7 +58,7 @@ static const SDnodeComponent tsDnodeComponents[] = {
{"dnodecfg", dnodeInitCfg, dnodeCleanupCfg},
{"dnodeeps", dnodeInitEps, dnodeCleanupEps},
{"mnodeinfos",dnodeInitMInfos, dnodeCleanupMInfos},
// {"globalcfg" ,taosCheckGlobalCfg, NULL},
{"globalcfg" ,taosCheckGlobalCfg, NULL},
{"wal", walInit, walCleanUp},
{"check", dnodeInitCheck, dnodeCleanupCheck}, // NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!!
{"vread", dnodeInitVnodeRead, dnodeCleanupVnodeRead},
......@@ -85,7 +85,9 @@ static int dnodeCreateDir(const char *dir) {
static void dnodeCleanupComponents(int32_t stepId) {
for (int32_t i = stepId; i >= 0; i--) {
tsDnodeComponents[i].cleanup();
if (tsDnodeComponents[i].cleanup) {
(*tsDnodeComponents[i].cleanup)();
}
}
}
......@@ -122,14 +124,12 @@ int32_t dnodeInitSystem() {
printf("failed to init log file\n");
}
if (!taosReadGlobalCfg() || !taosCheckGlobalCfg()) {
if (!taosReadGlobalCfg()) {
taosPrintGlobalCfg();
dError("TDengine read global config failed");
return -1;
}
taosPrintGlobalCfg();
dInfo("start to initialize TDengine");
if (dnodeInitComponents() != 0) {
......
......@@ -356,9 +356,9 @@ bool taosReadGlobalCfg() {
taosTFree(line);
// if (debugFlag & DEBUG_TRACE || debugFlag & DEBUG_DEBUG || debugFlag & DEBUG_DUMP) {
// taosSetAllDebugFlag();
// }
if (debugFlag & DEBUG_TRACE || debugFlag & DEBUG_DEBUG || debugFlag & DEBUG_DUMP) {
taosSetAllDebugFlag();
}
return true;
}
......
......@@ -72,7 +72,7 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
char file[TSDB_FILENAME_LEN + 30] = {0};
sprintf(file, "%s/vnode%d/config.json", tsVnodeDir, pVnode->vgId);
// vnodeMsg.cfg.vgId = pVnode->vgId;
vnodeMsg.cfg.vgId = pVnode->vgId;
fp = fopen(file, "r");
if (!fp) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册