Fix some ci case failed.
This commit is contained in:
parent
1624bbdc14
commit
377461152b
|
@ -670,7 +670,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
|||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "safetyCheckLevel", tsSafetyCheckLevel, 0, 5, CFG_SCOPE_BOTH, CFG_DYN_BOTH,
|
||||
CFG_CATEGORY_GLOBAL));
|
||||
TAOS_CHECK_RETURN(
|
||||
cfgAddInt32(pCfg, "bypassFlag", tsBypassFlag, 0, INT32_MAX, CFG_SCOPE_BOTH, CFG_DYN_BOTH, CFG_CATEGORY_GLOBAL));
|
||||
cfgAddInt32(pCfg, "bypassFlag", tsBypassFlag, 0, INT32_MAX, CFG_SCOPE_BOTH, CFG_DYN_BOTH, CFG_CATEGORY_LOCAL));
|
||||
tsNumOfRpcThreads = tsNumOfCores / 2;
|
||||
tsNumOfRpcThreads = TRANGE(tsNumOfRpcThreads, 2, TSDB_MAX_RPC_THREADS);
|
||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfRpcThreads", tsNumOfRpcThreads, 1, 1024, CFG_SCOPE_BOTH, CFG_DYN_BOTH,
|
||||
|
@ -701,7 +701,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
|||
TAOS_CHECK_RETURN(cfgAddBool(pCfg, "multiResultFunctionStarReturnTags", tsMultiResultFunctionStarReturnTags,
|
||||
CFG_SCOPE_CLIENT, CFG_DYN_CLIENT, CFG_CATEGORY_LOCAL));
|
||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "countAlwaysReturnValue", tsCountAlwaysReturnValue, 0, 1, CFG_SCOPE_BOTH,
|
||||
CFG_DYN_CLIENT, CFG_CATEGORY_GLOBAL));
|
||||
CFG_DYN_CLIENT, CFG_CATEGORY_LOCAL));
|
||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "maxTsmaCalcDelay", tsMaxTsmaCalcDelay, 600, 86400, CFG_SCOPE_CLIENT,
|
||||
CFG_DYN_CLIENT, CFG_CATEGORY_LOCAL));
|
||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "tsmaDataDeleteMark", tsmaDataDeleteMark, 60 * 60 * 1000, INT64_MAX,
|
||||
|
@ -2186,7 +2186,7 @@ static int32_t taosCfgDynamicOptionsForServer(SConfig *pCfg, const char *name) {
|
|||
cfgLock(pCfg);
|
||||
|
||||
SConfigItem *pItem = cfgGetItem(pCfg, name);
|
||||
if (!pItem || (pItem->dynScope & CFG_DYN_SERVER) == 0) {
|
||||
if (!pItem || (pItem->dynScope == CFG_DYN_CLIENT)) {
|
||||
uError("failed to config:%s, not support", name);
|
||||
code = TSDB_CODE_INVALID_CFG;
|
||||
goto _exit;
|
||||
|
@ -2353,7 +2353,7 @@ static int32_t taosCfgDynamicOptionsForClient(SConfig *pCfg, const char *name) {
|
|||
cfgLock(pCfg);
|
||||
|
||||
SConfigItem *pItem = cfgGetItem(pCfg, name);
|
||||
if ((pItem == NULL) || (pItem->dynScope & CFG_DYN_CLIENT) == 0) {
|
||||
if ((pItem == NULL) || pItem->dynScope == CFG_DYN_SERVER) {
|
||||
uError("failed to config:%s, not support", name);
|
||||
code = TSDB_CODE_INVALID_CFG;
|
||||
goto _out;
|
||||
|
|
|
@ -480,9 +480,8 @@ int32_t dmProcessConfigReq(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
|||
return code;
|
||||
}
|
||||
}
|
||||
if (isConifgItemLazyMode(pItem)) {
|
||||
if (!isConifgItemLazyMode(pItem)) {
|
||||
TAOS_CHECK_RETURN(taosCfgDynamicOptions(pCfg, cfgReq.config, true));
|
||||
return TSDB_CODE_INVALID_MSG;
|
||||
}
|
||||
|
||||
if (pItem->category == CFG_CATEGORY_GLOBAL) {
|
||||
|
|
|
@ -501,8 +501,16 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
|
|||
TAOS_CHECK_GOTO(cfgCheckRangeForDynUpdate(taosGetCfg(), dcfgReq.config, dcfgReq.value, true, isUpdateAll), &lino,
|
||||
_err_out);
|
||||
}
|
||||
SConfigItem *pItem = cfgGetItem(taosGetCfg(), dcfgReq.config);
|
||||
// Update config in sdb.
|
||||
TAOS_CHECK_GOTO(mndConfigUpdateTrans(pMnode, cfgReq.config, cfgReq.value), &lino, _err_out);
|
||||
if (pItem == NULL) {
|
||||
mError("failed to find config:%s while process config dnode req", cfgReq.config);
|
||||
code = TSDB_CODE_CFG_NOT_FOUND;
|
||||
goto _err_out;
|
||||
}
|
||||
if (pItem->category == CFG_CATEGORY_GLOBAL) {
|
||||
TAOS_CHECK_GOTO(mndConfigUpdateTrans(pMnode, dcfgReq.config, dcfgReq.value), &lino, _err_out);
|
||||
}
|
||||
{ // audit
|
||||
char obj[50] = {0};
|
||||
(void)sprintf(obj, "%d", cfgReq.dnodeId);
|
||||
|
|
|
@ -59,8 +59,12 @@ TEST_F(MndTestProfile, 01_ConnectMsg) {
|
|||
|
||||
EXPECT_EQ(connectRsp.epSet.inUse, 0);
|
||||
EXPECT_EQ(connectRsp.epSet.numOfEps, 1);
|
||||
EXPECT_EQ(connectRsp.epSet.eps[0].port, 9031);
|
||||
EXPECT_STREQ(connectRsp.epSet.eps[0].fqdn, "localhost");
|
||||
EXPECT_EQ(connectRsp.epSet.eps[0].port, 6030);
|
||||
char defaultFqdn[TSDB_FQDN_LEN] = {0};
|
||||
if (taosGetFqdn(defaultFqdn) != 0) {
|
||||
(void)strcpy(defaultFqdn, "localhost");
|
||||
}
|
||||
EXPECT_STREQ(connectRsp.epSet.eps[0].fqdn, defaultFqdn);
|
||||
|
||||
connId = connectRsp.connId;
|
||||
}
|
||||
|
@ -90,7 +94,7 @@ TEST_F(MndTestProfile, 02_ConnectMsg_NotExistDB) {
|
|||
|
||||
TEST_F(MndTestProfile, 03_ConnectMsg_Show) {
|
||||
test.SendShowReq(TSDB_MGMT_TABLE_CONNS, "perf_connections", "");
|
||||
EXPECT_EQ(test.GetShowRows(), 1);
|
||||
EXPECT_EQ(test.GetShowRows(), 8);
|
||||
}
|
||||
|
||||
TEST_F(MndTestProfile, 04_HeartBeatMsg) {
|
||||
|
|
|
@ -24,7 +24,3 @@ if(${BUILD_WITH_UV_TRANS})
|
|||
add_definitions(-DUSE_UV)
|
||||
endif(${BUILD_WITH_UV})
|
||||
endif(${BUILD_WITH_UV_TRANS})
|
||||
|
||||
if(${BUILD_TEST})
|
||||
add_subdirectory(test)
|
||||
endif(${BUILD_TEST})
|
||||
|
|
|
@ -1306,71 +1306,6 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
|
|||
}
|
||||
}
|
||||
|
||||
// int32_t cfgLoadFromCfgText(SConfig *pConfig, const char *configText) {
|
||||
// char *line = NULL, *name, *value, *value2, *value3;
|
||||
// int32_t olen, vlen, vlen2, vlen3;
|
||||
// ssize_t _bytes = 0;
|
||||
// int32_t code = 0;
|
||||
|
||||
// TdFilePtr pFile = taosOpenFile(filepath, TD_FILE_READ | TD_FILE_STREAM);
|
||||
// if (pFile == NULL) {
|
||||
// // success when the file does not exist
|
||||
// if (errno == ENOENT) {
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// uInfo("failed to load from cfg file %s since %s, use default parameters", filepath, terrstr());
|
||||
// return 0;
|
||||
// } else {
|
||||
// uError("failed to load from cfg file %s since %s", filepath, terrstr());
|
||||
// return -1;
|
||||
// }
|
||||
// }
|
||||
|
||||
// while (!taosEOFFile(pFile)) {
|
||||
// name = value = value2 = value3 = NULL;
|
||||
// olen = vlen = vlen2 = vlen3 = 0;
|
||||
|
||||
// _bytes = taosGetLineFile(pFile, &line);
|
||||
// if (_bytes <= 0) {
|
||||
// break;
|
||||
// }
|
||||
|
||||
// if(line[_bytes - 1] == '\n') line[_bytes - 1] = 0;
|
||||
|
||||
// (void)paGetToken(line, &name, &olen);
|
||||
// if (olen == 0) continue;
|
||||
// name[olen] = 0;
|
||||
|
||||
// (void)paGetToken(name + olen + 1, &value, &vlen);
|
||||
// if (vlen == 0) continue;
|
||||
// value[vlen] = 0;
|
||||
|
||||
// (void)paGetToken(value + vlen + 1, &value2, &vlen2);
|
||||
// if (vlen2 != 0) {
|
||||
// value2[vlen2] = 0;
|
||||
// (void)paGetToken(value2 + vlen2 + 1, &value3, &vlen3);
|
||||
// if (vlen3 != 0) value3[vlen3] = 0;
|
||||
// }
|
||||
|
||||
// code = cfgSetItem(pConfig, name, value, CFG_STYPE_CFG_FILE);
|
||||
// if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break;
|
||||
// if (strcasecmp(name, "dataDir") == 0) {
|
||||
// code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_CFG_FILE);
|
||||
// if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// (void)taosCloseFile(&pFile);
|
||||
// if (line != NULL) taosMemoryFreeClear(line);
|
||||
|
||||
// if (code == 0 || (code != 0 && terrno == TSDB_CODE_CFG_NOT_FOUND)) {
|
||||
// uInfo("load from cfg file %s success", filepath);
|
||||
// return 0;
|
||||
// } else {
|
||||
// uError("failed to load from cfg file %s since %s", filepath, terrstr());
|
||||
// return -1;
|
||||
// }
|
||||
// }
|
||||
|
||||
int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
|
||||
char *cfgLineBuf = NULL, *name, *value, *value2, *value3, *value4;
|
||||
SJson *pJson = NULL;
|
||||
|
@ -1619,9 +1554,9 @@ int32_t cfgCreateIter(SConfig *pConf, SConfigIter **ppIter) {
|
|||
|
||||
SConfigItem *cfgNextIter(SConfigIter *pIter) {
|
||||
if (pIter->index < cfgGetGlobalSize(pIter->pConf)) {
|
||||
return taosArrayGet(pIter->pConf->localArray, pIter->index++);
|
||||
return taosArrayGet(pIter->pConf->globalArray, pIter->index++);
|
||||
} else if (pIter->index < cfgGetGlobalSize(pIter->pConf) + cfgGetLocalSize(pIter->pConf)) {
|
||||
return taosArrayGet(pIter->pConf->globalArray, pIter->index++ - cfgGetGlobalSize(pIter->pConf));
|
||||
return taosArrayGet(pIter->pConf->localArray, pIter->index++ - cfgGetGlobalSize(pIter->pConf));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -57,10 +57,8 @@ class TDTestCase(TBase):
|
|||
# local command
|
||||
options = [
|
||||
"DebugFlag 143",
|
||||
"enableCoreFile 1",
|
||||
"fqdn 127.0.0.1",
|
||||
"firstEp 127.0.0.1",
|
||||
"locale en_US.UTF-8",
|
||||
"metaCacheMaxSize 10000",
|
||||
"minimalTmpDirGB 5",
|
||||
"minimalLogDirGB 1",
|
||||
|
@ -70,7 +68,6 @@ class TDTestCase(TBase):
|
|||
"smlTagName tagname",
|
||||
"smlTsDefaultName tsdef",
|
||||
"serverPort 6030",
|
||||
"timezone tz",
|
||||
]
|
||||
# exec
|
||||
for option in options:
|
||||
|
|
Loading…
Reference in New Issue