Merge pull request #29704 from taosdata/fix/main/TS-5974
Fix(cfg):fix some configs' errors and remove some configs from global config list.
This commit is contained in:
commit
f5c0d5ffaa
|
@ -326,7 +326,6 @@ int32_t tDeserializeSConfigArray(SDecoder *pDecoder, SArray *array);
|
||||||
int32_t setAllConfigs(SConfig *pCfg);
|
int32_t setAllConfigs(SConfig *pCfg);
|
||||||
void printConfigNotMatch(SArray *array);
|
void printConfigNotMatch(SArray *array);
|
||||||
|
|
||||||
int32_t compareSConfigItemArrays(SArray *mArray, const SArray *dArray, SArray *diffArray);
|
|
||||||
bool isConifgItemLazyMode(SConfigItem *item);
|
bool isConifgItemLazyMode(SConfigItem *item);
|
||||||
int32_t taosUpdateTfsItemDisable(SConfig *pCfg, const char *value, void *pTfs);
|
int32_t taosUpdateTfsItemDisable(SConfig *pCfg, const char *value, void *pTfs);
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ time_t mktime_z(timezone_t, struct tm *);
|
||||||
timezone_t tzalloc(char const *);
|
timezone_t tzalloc(char const *);
|
||||||
void tzfree(timezone_t);
|
void tzfree(timezone_t);
|
||||||
void getTimezoneStr(char *tz);
|
void getTimezoneStr(char *tz);
|
||||||
|
void truncateTimezoneString(char *tz);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -713,11 +713,11 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
||||||
tsNumOfRpcThreads = tsNumOfCores / 2;
|
tsNumOfRpcThreads = tsNumOfCores / 2;
|
||||||
tsNumOfRpcThreads = TRANGE(tsNumOfRpcThreads, 2, TSDB_MAX_RPC_THREADS);
|
tsNumOfRpcThreads = TRANGE(tsNumOfRpcThreads, 2, TSDB_MAX_RPC_THREADS);
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfRpcThreads", tsNumOfRpcThreads, 1, 1024, CFG_SCOPE_BOTH, CFG_DYN_BOTH_LAZY,
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfRpcThreads", tsNumOfRpcThreads, 1, 1024, CFG_SCOPE_BOTH, CFG_DYN_BOTH_LAZY,
|
||||||
CFG_CATEGORY_GLOBAL));
|
CFG_CATEGORY_LOCAL));
|
||||||
|
|
||||||
tsNumOfRpcSessions = TRANGE(tsNumOfRpcSessions, 100, 100000);
|
tsNumOfRpcSessions = TRANGE(tsNumOfRpcSessions, 100, 100000);
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfRpcSessions", tsNumOfRpcSessions, 1, 100000, CFG_SCOPE_BOTH,
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfRpcSessions", tsNumOfRpcSessions, 1, 100000, CFG_SCOPE_BOTH,
|
||||||
CFG_DYN_BOTH_LAZY, CFG_CATEGORY_GLOBAL));
|
CFG_DYN_BOTH_LAZY, CFG_CATEGORY_LOCAL));
|
||||||
|
|
||||||
tsShareConnLimit = TRANGE(tsShareConnLimit, 1, 512);
|
tsShareConnLimit = TRANGE(tsShareConnLimit, 1, 512);
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "shareConnLimit", tsShareConnLimit, 1, 512, CFG_SCOPE_BOTH, CFG_DYN_BOTH_LAZY,
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "shareConnLimit", tsShareConnLimit, 1, 512, CFG_SCOPE_BOTH, CFG_DYN_BOTH_LAZY,
|
||||||
|
@ -734,7 +734,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
||||||
tsNumOfTaskQueueThreads = TMAX(tsNumOfTaskQueueThreads, 16);
|
tsNumOfTaskQueueThreads = TMAX(tsNumOfTaskQueueThreads, 16);
|
||||||
|
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfTaskQueueThreads", tsNumOfTaskQueueThreads, 4, 1024, CFG_SCOPE_CLIENT,
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfTaskQueueThreads", tsNumOfTaskQueueThreads, 4, 1024, CFG_SCOPE_CLIENT,
|
||||||
CFG_DYN_CLIENT_LAZY, CFG_CATEGORY_GLOBAL));
|
CFG_DYN_CLIENT_LAZY, CFG_CATEGORY_LOCAL));
|
||||||
TAOS_CHECK_RETURN(
|
TAOS_CHECK_RETURN(
|
||||||
cfgAddBool(pCfg, "experimental", tsExperimental, CFG_SCOPE_BOTH, CFG_DYN_BOTH_LAZY, CFG_CATEGORY_GLOBAL));
|
cfgAddBool(pCfg, "experimental", tsExperimental, CFG_SCOPE_BOTH, CFG_DYN_BOTH_LAZY, CFG_CATEGORY_GLOBAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddBool(pCfg, "multiResultFunctionStarReturnTags", tsMultiResultFunctionStarReturnTags,
|
TAOS_CHECK_RETURN(cfgAddBool(pCfg, "multiResultFunctionStarReturnTags", tsMultiResultFunctionStarReturnTags,
|
||||||
|
@ -864,12 +864,12 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
||||||
|
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfSnodeSharedThreads", tsNumOfSnodeStreamThreads, 2, 1024, CFG_SCOPE_SERVER, CFG_DYN_SERVER_LAZY,CFG_CATEGORY_LOCAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfSnodeSharedThreads", tsNumOfSnodeStreamThreads, 2, 1024, CFG_SCOPE_SERVER, CFG_DYN_SERVER_LAZY,CFG_CATEGORY_LOCAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfSnodeUniqueThreads", tsNumOfSnodeWriteThreads, 2, 1024, CFG_SCOPE_SERVER, CFG_DYN_SERVER_LAZY,CFG_CATEGORY_LOCAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfSnodeUniqueThreads", tsNumOfSnodeWriteThreads, 2, 1024, CFG_SCOPE_SERVER, CFG_DYN_SERVER_LAZY,CFG_CATEGORY_LOCAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "rpcQueueMemoryAllowed", tsQueueMemoryAllowed, TSDB_MAX_MSG_SIZE * RPC_MEMORY_USAGE_RATIO * 10L, INT64_MAX, CFG_SCOPE_SERVER, CFG_DYN_SERVER,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "rpcQueueMemoryAllowed", tsQueueMemoryAllowed, TSDB_MAX_MSG_SIZE * RPC_MEMORY_USAGE_RATIO * 10L, INT64_MAX, CFG_SCOPE_SERVER, CFG_DYN_SERVER,CFG_CATEGORY_LOCAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncElectInterval", tsElectInterval, 10, 1000 * 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncElectInterval", tsElectInterval, 10, 1000 * 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncHeartbeatInterval", tsHeartbeatInterval, 10, 1000 * 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncHeartbeatInterval", tsHeartbeatInterval, 10, 1000 * 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncHeartbeatTimeout", tsHeartbeatTimeout, 10, 1000 * 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncHeartbeatTimeout", tsHeartbeatTimeout, 10, 1000 * 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncSnapReplMaxWaitN", tsSnapReplMaxWaitN, 16, (TSDB_SYNC_SNAP_BUFFER_SIZE >> 2), CFG_SCOPE_SERVER, CFG_DYN_SERVER,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncSnapReplMaxWaitN", tsSnapReplMaxWaitN, 16, (TSDB_SYNC_SNAP_BUFFER_SIZE >> 2), CFG_SCOPE_SERVER, CFG_DYN_SERVER,CFG_CATEGORY_GLOBAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "syncLogBufferMemoryAllowed", tsLogBufferMemoryAllowed, TSDB_MAX_MSG_SIZE * 10L, INT64_MAX, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "syncLogBufferMemoryAllowed", tsLogBufferMemoryAllowed, TSDB_MAX_MSG_SIZE * 10L, INT64_MAX, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER,CFG_CATEGORY_LOCAL));
|
||||||
|
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "arbHeartBeatIntervalSec", tsArbHeartBeatIntervalSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_SERVER,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "arbHeartBeatIntervalSec", tsArbHeartBeatIntervalSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_SERVER,CFG_CATEGORY_GLOBAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "arbCheckSyncIntervalSec", tsArbCheckSyncIntervalSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_SERVER,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "arbCheckSyncIntervalSec", tsArbCheckSyncIntervalSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_SERVER,CFG_CATEGORY_GLOBAL));
|
||||||
|
@ -947,9 +947,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "cacheLazyLoadThreshold", tsCacheLazyLoadThreshold, 0, 100000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "cacheLazyLoadThreshold", tsCacheLazyLoadThreshold, 0, 100000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER,CFG_CATEGORY_GLOBAL));
|
||||||
|
|
||||||
TAOS_CHECK_RETURN(cfgAddFloat(pCfg, "fPrecision", tsFPrecision, 0.0f, 100000.0f, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddFloat(pCfg, "fPrecision", tsFPrecision, 0.0f, 100000.0f, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
||||||
SConfigItem *pItem = NULL;
|
|
||||||
TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, "fPrecision");
|
|
||||||
tsFPrecision = pItem->fval;
|
|
||||||
TAOS_CHECK_RETURN(cfgAddFloat(pCfg, "dPrecision", tsDPrecision, 0.0f, 1000000.0f, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddFloat(pCfg, "dPrecision", tsDPrecision, 0.0f, 1000000.0f, CFG_SCOPE_SERVER, CFG_DYN_NONE,CFG_CATEGORY_GLOBAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "maxRange", tsMaxRange, 0, 65536, CFG_SCOPE_SERVER, CFG_DYN_SERVER_LAZY,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "maxRange", tsMaxRange, 0, 65536, CFG_SCOPE_SERVER, CFG_DYN_SERVER_LAZY,CFG_CATEGORY_GLOBAL));
|
||||||
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "curRange", tsCurRange, 0, 65536, CFG_SCOPE_SERVER, CFG_DYN_SERVER_LAZY,CFG_CATEGORY_GLOBAL));
|
TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "curRange", tsCurRange, 0, 65536, CFG_SCOPE_SERVER, CFG_DYN_SERVER_LAZY,CFG_CATEGORY_GLOBAL));
|
||||||
|
@ -3196,57 +3194,6 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compareSConfigItem(const SConfigItem *item1, const SConfigItem *item2) {
|
|
||||||
switch (item1->dtype) {
|
|
||||||
case CFG_DTYPE_BOOL:
|
|
||||||
if (item1->bval != item2->bval) return false;
|
|
||||||
break;
|
|
||||||
case CFG_DTYPE_FLOAT:
|
|
||||||
if (item1->fval != item2->fval) return false;
|
|
||||||
break;
|
|
||||||
case CFG_DTYPE_INT32:
|
|
||||||
if (item1->i32 != item2->i32) return false;
|
|
||||||
break;
|
|
||||||
case CFG_DTYPE_INT64:
|
|
||||||
if (item1->i64 != item2->i64) return false;
|
|
||||||
break;
|
|
||||||
case CFG_DTYPE_STRING:
|
|
||||||
case CFG_DTYPE_DIR:
|
|
||||||
case CFG_DTYPE_LOCALE:
|
|
||||||
case CFG_DTYPE_CHARSET:
|
|
||||||
case CFG_DTYPE_TIMEZONE:
|
|
||||||
if (strcmp(item1->str, item2->str) != 0) return false;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t compareSConfigItemArrays(SArray *mArray, const SArray *dArray, SArray *diffArray) {
|
|
||||||
int32_t code = 0;
|
|
||||||
int32_t msz = taosArrayGetSize(mArray);
|
|
||||||
int32_t dsz = taosArrayGetSize(dArray);
|
|
||||||
|
|
||||||
if (msz != dsz) {
|
|
||||||
return TSDB_CODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < msz; i++) {
|
|
||||||
SConfigItem *mItem = (SConfigItem *)taosArrayGet(mArray, i);
|
|
||||||
SConfigItem *dItem = (SConfigItem *)taosArrayGet(dArray, i);
|
|
||||||
if (!compareSConfigItem(mItem, dItem)) {
|
|
||||||
code = TSDB_CODE_FAILED;
|
|
||||||
if (taosArrayPush(diffArray, mItem) == NULL) {
|
|
||||||
code = terrno;
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
void printConfigNotMatch(SArray *array) {
|
void printConfigNotMatch(SArray *array) {
|
||||||
uError(
|
uError(
|
||||||
"The global configuration parameters in the configuration file do not match those in the cluster. Please "
|
"The global configuration parameters in the configuration file do not match those in the cluster. Please "
|
||||||
|
|
|
@ -40,6 +40,7 @@ static int32_t initConfigArrayFromSdb(SMnode *pMnode, SArray *array);
|
||||||
static int32_t mndTryRebuildConfigSdb(SRpcMsg *pReq);
|
static int32_t mndTryRebuildConfigSdb(SRpcMsg *pReq);
|
||||||
static void cfgArrayCleanUp(SArray *array);
|
static void cfgArrayCleanUp(SArray *array);
|
||||||
static void cfgObjArrayCleanUp(SArray *array);
|
static void cfgObjArrayCleanUp(SArray *array);
|
||||||
|
int32_t compareSConfigItemArrays(SMnode *pMnode, const SArray *dArray, SArray *diffArray);
|
||||||
|
|
||||||
static int32_t mndConfigUpdateTrans(SMnode *pMnode, const char *name, char *pValue, ECfgDataType dtype,
|
static int32_t mndConfigUpdateTrans(SMnode *pMnode, const char *name, char *pValue, ECfgDataType dtype,
|
||||||
int32_t tsmmConfigVersion);
|
int32_t tsmmConfigVersion);
|
||||||
|
@ -250,7 +251,12 @@ static int32_t mndProcessConfigReq(SRpcMsg *pReq) {
|
||||||
configRsp.cver = vObj->i32;
|
configRsp.cver = vObj->i32;
|
||||||
if (configRsp.forceReadConfig) {
|
if (configRsp.forceReadConfig) {
|
||||||
// compare config array from configReq with current config array
|
// compare config array from configReq with current config array
|
||||||
if (compareSConfigItemArrays(taosGetGlobalCfg(tsCfg), configReq.array, array)) {
|
code = compareSConfigItemArrays(pMnode, configReq.array, array);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
mError("failed to compare config array, since %s", tstrerror(code));
|
||||||
|
goto _OVER;
|
||||||
|
}
|
||||||
|
if (taosArrayGetSize(array) > 0) {
|
||||||
configRsp.array = array;
|
configRsp.array = array;
|
||||||
} else {
|
} else {
|
||||||
configRsp.isConifgVerified = 1;
|
configRsp.isConifgVerified = 1;
|
||||||
|
@ -293,7 +299,7 @@ _OVER:
|
||||||
}
|
}
|
||||||
sdbRelease(pMnode->pSdb, vObj);
|
sdbRelease(pMnode->pSdb, vObj);
|
||||||
cfgArrayCleanUp(array);
|
cfgArrayCleanUp(array);
|
||||||
return TSDB_CODE_SUCCESS;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t mndInitWriteCfg(SMnode *pMnode) {
|
int32_t mndInitWriteCfg(SMnode *pMnode) {
|
||||||
|
@ -921,4 +927,85 @@ _OVER:
|
||||||
|
|
||||||
tFreeSShowVariablesRsp(&rsp);
|
tFreeSShowVariablesRsp(&rsp);
|
||||||
TAOS_RETURN(code);
|
TAOS_RETURN(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t compareSConfigItem(const SConfigObj *item1, SConfigItem *item2, bool *compare) {
|
||||||
|
switch (item1->dtype) {
|
||||||
|
case CFG_DTYPE_BOOL:
|
||||||
|
if (item1->bval != item2->bval) {
|
||||||
|
item2->bval = item1->bval;
|
||||||
|
*compare = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CFG_DTYPE_FLOAT:
|
||||||
|
if (item1->fval != item2->fval) {
|
||||||
|
item2->fval = item1->fval;
|
||||||
|
*compare = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CFG_DTYPE_INT32:
|
||||||
|
if (item1->i32 != item2->i32) {
|
||||||
|
item2->i32 = item1->i32;
|
||||||
|
*compare = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CFG_DTYPE_INT64:
|
||||||
|
if (item1->i64 != item2->i64) {
|
||||||
|
item2->i64 = item1->i64;
|
||||||
|
*compare = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CFG_DTYPE_STRING:
|
||||||
|
case CFG_DTYPE_DIR:
|
||||||
|
case CFG_DTYPE_LOCALE:
|
||||||
|
case CFG_DTYPE_CHARSET:
|
||||||
|
case CFG_DTYPE_TIMEZONE:
|
||||||
|
if (strcmp(item1->str, item2->str) != 0) {
|
||||||
|
taosMemoryFree(item2->str);
|
||||||
|
item2->str = taosStrdup(item1->str);
|
||||||
|
if (item2->str == NULL) {
|
||||||
|
return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
*compare = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*compare = false;
|
||||||
|
return TSDB_CODE_INVALID_CFG;
|
||||||
|
}
|
||||||
|
*compare = true;
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t compareSConfigItemArrays(SMnode *pMnode, const SArray *dArray, SArray *diffArray) {
|
||||||
|
int32_t code = 0;
|
||||||
|
int32_t dsz = taosArrayGetSize(dArray);
|
||||||
|
bool compare = false;
|
||||||
|
|
||||||
|
for (int i = 0; i < dsz; i++) {
|
||||||
|
SConfigItem *dItem = (SConfigItem *)taosArrayGet(dArray, i);
|
||||||
|
SConfigObj *mObj = sdbAcquire(pMnode->pSdb, SDB_CFG, dItem->name);
|
||||||
|
if (mObj == NULL) {
|
||||||
|
code = terrno;
|
||||||
|
mError("failed to acquire config:%s from sdb, since %s", dItem->name, tstrerror(code));
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
code = compareSConfigItem(mObj, dItem, &compare);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
sdbRelease(pMnode->pSdb, mObj);
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!compare) {
|
||||||
|
if (taosArrayPush(diffArray, dItem) == NULL) {
|
||||||
|
sdbRelease(pMnode->pSdb, mObj);
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sdbRelease(pMnode->pSdb, mObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
return code;
|
||||||
}
|
}
|
|
@ -872,6 +872,13 @@ END:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void truncateTimezoneString(char *tz) {
|
||||||
|
char *spacePos = strchr(tz, ' ');
|
||||||
|
if (spacePos != NULL) {
|
||||||
|
*spacePos = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int32_t taosGetSystemTimezone(char *outTimezoneStr) {
|
int32_t taosGetSystemTimezone(char *outTimezoneStr) {
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
char value[100] = {0};
|
char value[100] = {0};
|
||||||
|
|
|
@ -97,6 +97,7 @@ int32_t cfgLoadFromArray(SConfig *pCfg, SArray *pArgs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t cfgUpdateFromArray(SConfig *pCfg, SArray *pArgs) {
|
int32_t cfgUpdateFromArray(SConfig *pCfg, SArray *pArgs) {
|
||||||
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
int32_t size = taosArrayGetSize(pArgs);
|
int32_t size = taosArrayGetSize(pArgs);
|
||||||
for (int32_t i = 0; i < size; ++i) {
|
for (int32_t i = 0; i < size; ++i) {
|
||||||
SConfigItem *pItemNew = taosArrayGet(pArgs, i);
|
SConfigItem *pItemNew = taosArrayGet(pArgs, i);
|
||||||
|
@ -124,9 +125,6 @@ int32_t cfgUpdateFromArray(SConfig *pCfg, SArray *pArgs) {
|
||||||
break;
|
break;
|
||||||
case CFG_DTYPE_STRING:
|
case CFG_DTYPE_STRING:
|
||||||
case CFG_DTYPE_DIR:
|
case CFG_DTYPE_DIR:
|
||||||
case CFG_DTYPE_LOCALE:
|
|
||||||
case CFG_DTYPE_CHARSET:
|
|
||||||
case CFG_DTYPE_TIMEZONE:
|
|
||||||
taosMemoryFree(pItemOld->str);
|
taosMemoryFree(pItemOld->str);
|
||||||
pItemOld->str = taosStrdup(pItemNew->str);
|
pItemOld->str = taosStrdup(pItemNew->str);
|
||||||
if (pItemOld->str == NULL) {
|
if (pItemOld->str == NULL) {
|
||||||
|
@ -134,6 +132,22 @@ int32_t cfgUpdateFromArray(SConfig *pCfg, SArray *pArgs) {
|
||||||
TAOS_RETURN(terrno);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CFG_DTYPE_LOCALE:
|
||||||
|
case CFG_DTYPE_CHARSET:
|
||||||
|
code = cfgSetItemVal(pItemOld, pItemNew->name, pItemNew->str, pItemNew->stype);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
(void)taosThreadMutexUnlock(&pCfg->lock);
|
||||||
|
TAOS_RETURN(code);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CFG_DTYPE_TIMEZONE:
|
||||||
|
truncateTimezoneString(pItemNew->str);
|
||||||
|
code = cfgSetItemVal(pItemOld, pItemNew->name, pItemNew->str, pItemNew->stype);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
(void)taosThreadMutexUnlock(&pCfg->lock);
|
||||||
|
TAOS_RETURN(code);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,12 @@ class TDTestCase(TBase):
|
||||||
def alter_err_case(self):
|
def alter_err_case(self):
|
||||||
tdSql.error(f"alter local 'audit 0'",expectErrInfo="Config not found")
|
tdSql.error(f"alter local 'audit 0'",expectErrInfo="Config not found")
|
||||||
tdSql.error(f"alter dnode 1 'audit 1'",expectErrInfo="Invalid config option")
|
tdSql.error(f"alter dnode 1 'audit 1'",expectErrInfo="Invalid config option")
|
||||||
|
|
||||||
|
def alter_dnode_1_case(self):
|
||||||
|
tdSql.execute("alter dnode 1 'numOfRpcThreads' '5'")
|
||||||
|
tdSql.execute("alter dnode 1 'rpcQueueMemoryAllowed' '15242880'")
|
||||||
|
tdSql.execute("alter dnode 1 'syncLogBufferMemoryAllowed' '115728640'")
|
||||||
|
|
||||||
# run
|
# run
|
||||||
def run(self):
|
def run(self):
|
||||||
tdLog.debug(f"start to excute {__file__}")
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
@ -191,6 +196,7 @@ class TDTestCase(TBase):
|
||||||
self.alterBypassFlag()
|
self.alterBypassFlag()
|
||||||
# TS-5007
|
# TS-5007
|
||||||
self.alter_err_case()
|
self.alter_err_case()
|
||||||
|
self.alter_dnode_1_case()
|
||||||
|
|
||||||
tdLog.success(f"{__file__} successfully executed")
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ endi
|
||||||
sql_error show create stable t0;
|
sql_error show create stable t0;
|
||||||
|
|
||||||
sql show variables;
|
sql show variables;
|
||||||
if $rows != 93 then
|
if $rows != 88 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ if $rows != 3 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show variables;
|
sql show variables;
|
||||||
if $rows != 93 then
|
if $rows != 88 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class TDTestCase:
|
||||||
|
|
||||||
def case2(self):
|
def case2(self):
|
||||||
tdSql.query("show variables")
|
tdSql.query("show variables")
|
||||||
tdSql.checkRows(93)
|
tdSql.checkRows(88)
|
||||||
|
|
||||||
for i in range(self.replicaVar):
|
for i in range(self.replicaVar):
|
||||||
tdSql.query("show dnode %d variables like 'debugFlag'" % (i + 1))
|
tdSql.query("show dnode %d variables like 'debugFlag'" % (i + 1))
|
||||||
|
|
Loading…
Reference in New Issue