diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 4dc7b329ed4e9542437f5c5344f9a17eca81348e..0e5a206c2762a63fdde8d17958e6505025c79280 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -90,12 +90,12 @@ typedef struct STableComInfo { int32_t rowSize; } STableComInfo; -typedef struct SCMCorVgroupInfo { - int32_t version; - int8_t inUse; - int8_t numOfEps; - SEpAddr1 epAddr[TSDB_MAX_REPLICA]; -} SCMCorVgroupInfo; +typedef struct SCorVgroupInfo { + int32_t version; + int8_t inUse; + int8_t numOfEps; + SEpAddr1 epAddr[TSDB_MAX_REPLICA]; +} SCorVgroupInfo; typedef struct STableMeta { STableComInfo tableInfo; @@ -104,7 +104,7 @@ typedef struct STableMeta { int16_t tversion; char sTableId[TSDB_TABLE_FNAME_LEN]; SVgroupInfo vgroupInfo; - SCMCorVgroupInfo corVgroupInfo; + SCorVgroupInfo corVgroupInfo; STableId id; SSchema schema[]; // if the table is TSDB_CHILD_TABLE, schema is acquired by super table meta info } STableMeta; diff --git a/src/client/src/tscSchemaUtil.c b/src/client/src/tscSchemaUtil.c index 184b2aec9fd8a3b402152c9ea56468f366786873..0b1767dd2530d92e854c151f9be21985dce8d61c 100644 --- a/src/client/src/tscSchemaUtil.c +++ b/src/client/src/tscSchemaUtil.c @@ -140,7 +140,7 @@ struct SSchema tscGetTbnameColumnSchema() { strcpy(s.name, TSQL_TBNAME_L); return s; } -static void tscInitCorVgroupInfo(SCMCorVgroupInfo *corVgroupInfo, SVgroupInfo *vgroupInfo) { +static void tscInitCorVgroupInfo(SCorVgroupInfo *corVgroupInfo, SVgroupInfo *vgroupInfo) { corVgroupInfo->version = 0; corVgroupInfo->inUse = 0; corVgroupInfo->numOfEps = vgroupInfo->numOfEps; diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 4f81d69736351b490bab56c983f4bb995b8d6c61..e10097ed127b756b16da008605fa9dbcd0069c5f 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -100,7 +100,7 @@ void tscUpdateMgmtEpSet(SRpcEpSet *pEpSet) { tscMgmtEpSet.epSet = *pEpSet; taosCorEndWrite(&tscMgmtEpSet.version); } -static void tscDumpEpSetFromVgroupInfo(SCMCorVgroupInfo *pVgroupInfo, SRpcEpSet *pEpSet) { +static void tscDumpEpSetFromVgroupInfo(SCorVgroupInfo *pVgroupInfo, SRpcEpSet *pEpSet) { if (pVgroupInfo == NULL) { return;} taosCorBeginRead(&pVgroupInfo->version); int8_t inUse = pVgroupInfo->inUse; @@ -117,7 +117,7 @@ static void tscUpdateVgroupInfo(SSqlObj *pObj, SRpcEpSet *pEpSet) { SSqlCmd *pCmd = &pObj->cmd; STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0); if (pTableMetaInfo == NULL || pTableMetaInfo->pTableMeta == NULL) { return;} - SCMCorVgroupInfo *pVgroupInfo = &pTableMetaInfo->pTableMeta->corVgroupInfo; + SCorVgroupInfo *pVgroupInfo = &pTableMetaInfo->pTableMeta->corVgroupInfo; taosCorBeginWrite(&pVgroupInfo->version); tscDebug("before: Endpoint in use: %d", pVgroupInfo->inUse); diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 839d5889f3beb5401ba91790fed1c4a925c600bc..61c144b2da9b25ab4535f361ab931c243d7b8ce6 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -103,7 +103,7 @@ void taos_init_imp(void) { } taosReadGlobalCfg(); - taosCheckGlobalCfg(); + // taosCheckGlobalCfg(); tscDebug("starting to initialize TAOS client ..."); tscDebug("Local End Point is:%s", tsLocalEp); diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index b00f4b9f9f056c00f344cfd7bd1f3ccb18743bd1..4636eaac08db4943e1837b5d6e8db40341ba6546 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -183,13 +183,13 @@ extern int32_t debugFlag; #define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize) -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); - +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); + #ifdef __cplusplus } #endif diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 2fd0a53661fad923617c39eec386ac1d9ea45741..bda8945bd2f5f2b2c9521901ba76f4e055960996 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -1316,7 +1316,7 @@ void taosInitGlobalCfg() { pthread_once(&tsInitGlobalCfgOnce, doInitGlobalConfig); } -int32_t taosCheckGlobalCfg() { +bool taosCheckGlobalCfg() { char fqdn[TSDB_FQDN_LEN]; uint16_t port; @@ -1375,9 +1375,9 @@ int32_t taosCheckGlobalCfg() { tsSyncPort = tsServerPort + TSDB_PORT_SYNC; tsHttpPort = tsServerPort + TSDB_PORT_HTTP; - taosPrintGlobalCfg(); + // taosPrintGlobalCfg(); - return 0; + return true; } int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port) { diff --git a/src/dnode/src/dnodeEps.c b/src/dnode/src/dnodeEps.c index 9c90c391813f57024ecf090136dfa86f5e5f91e6..90fe3a3a4e3faaec1a00dc22dd1c18483ac57f7d 100644 --- a/src/dnode/src/dnodeEps.c +++ b/src/dnode/src/dnodeEps.c @@ -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; diff --git a/src/dnode/src/dnodeMInfos.c b/src/dnode/src/dnodeMInfos.c index c985db371d96be5d78d71a50f9602485157a84a4..241d966e2946fd1d496b02245987d65081fd45de 100644 --- a/src/dnode/src/dnodeMInfos.c +++ b/src/dnode/src/dnodeMInfos.c @@ -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; } diff --git a/src/dnode/src/dnodeMain.c b/src/dnode/src/dnodeMain.c index de8652c02afaea024630826d4dffcb94256bad9d..92f1cc00ea40caf15f95488d5a59b863d6cc7592 100644 --- a/src/dnode/src/dnodeMain.c +++ b/src/dnode/src/dnodeMain.c @@ -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,9 +85,7 @@ static int dnodeCreateDir(const char *dir) { static void dnodeCleanupComponents(int32_t stepId) { for (int32_t i = stepId; i >= 0; i--) { - if (tsDnodeComponents[i].cleanup) { - (*tsDnodeComponents[i].cleanup)(); - } + tsDnodeComponents[i].cleanup(); } } @@ -124,12 +122,14 @@ int32_t dnodeInitSystem() { printf("failed to init log file\n"); } - if (!taosReadGlobalCfg()) { + if (!taosReadGlobalCfg() || !taosCheckGlobalCfg()) { taosPrintGlobalCfg(); dError("TDengine read global config failed"); return -1; } + taosPrintGlobalCfg(); + dInfo("start to initialize TDengine"); if (dnodeInitComponents() != 0) { diff --git a/src/util/src/tconfig.c b/src/util/src/tconfig.c index f449bfb68b6f9beecaf9f1a041a4c6c1c73ee09f..743c3d489b16b3cae5e478235658b267f8b27499 100644 --- a/src/util/src/tconfig.c +++ b/src/util/src/tconfig.c @@ -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; } diff --git a/src/vnode/src/vnodeCfg.c b/src/vnode/src/vnodeCfg.c index f0040f8cdf8cf52d6cca66602c7bbc61ae931cca..7d064b07627f53420204748f782b461cbd0b071b 100644 --- a/src/vnode/src/vnodeCfg.c +++ b/src/vnode/src/vnodeCfg.c @@ -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) {