diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index a653b8383342d688d6b9ea42919ac4afe7b69423..f04b8b63375744775912692b02d981270087c6f7 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -314,22 +314,6 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { } break; - case TSDB_OPTION_SOCKET_TYPE: - cfg = taosGetConfigOption("sockettype"); - assert(cfg != NULL); - - if (cfg->cfgStatus <= TAOS_CFG_CSTATUS_OPTION) { -// if (strcasecmp(pStr, TAOS_SOCKET_TYPE_NAME_UDP) != 0 && strcasecmp(pStr, TAOS_SOCKET_TYPE_NAME_TCP) != 0) { -// tscError("only 'tcp' or 'udp' allowed for configuring the socket type"); -// return -1; -// } - - tstrncpy(tsSocketType, pStr, sizeof(tsSocketType)); - cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION; - tscPrint("socket type is set:%s", tsSocketType); - } - break; - default: // TODO return the correct error code to client in the format for taos_errstr() tscError("Invalid option %d", option); diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 980635588ee537702287073bcf8c8e361f5e221b..2a51eb9933e2b6344fb8047031f84914e5cfd1a3 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -20,60 +20,51 @@ extern "C" { #endif -extern char configDir[]; -extern char tsVnodeDir[]; -extern char tsDnodeDir[]; -extern char tsMnodeDir[]; -extern char tsDataDir[]; -extern char tsLogDir[]; -extern char tsScriptDir[]; -extern char tsOsName[]; - -// system info -extern int64_t tsPageSize; -extern int64_t tsOpenMax; -extern int64_t tsStreamMax; -extern int32_t tsNumOfCores; -extern int32_t tsAlternativeRole; -extern float tsTotalLogDirGB; -extern float tsTotalTmpDirGB; -extern float tsTotalDataDirGB; -extern float tsAvailLogDirGB; -extern float tsAvailTmpDirGB; -extern float tsAvailDataDirGB; -extern float tsMinimalLogDirGB; -extern float tsMinimalTmpDirGB; -extern float tsMinimalDataDirGB; -extern int32_t tsEnableCoreFile; -extern int32_t tsTotalMemoryMB; -extern int32_t tsVersion; - -extern int32_t tscEmbedded; -extern int64_t tsMsPerDay[3]; - -extern char tsFirst[]; -extern char tsSecond[]; -extern char tsLocalFqdn[]; -extern char tsLocalEp[]; +// cluster +extern char tsFirst[]; +extern char tsSecond[]; +extern char tsLocalFqdn[]; +extern char tsLocalEp[]; extern uint16_t tsServerPort; extern uint16_t tsDnodeShellPort; extern uint16_t tsDnodeDnodePort; extern uint16_t tsSyncPort; - -extern int32_t tsStatusInterval; -extern int32_t tsShellActivityTimer; -extern int32_t tsVnodePeerHBTimer; -extern int32_t tsMgmtPeerHBTimer; -extern int32_t tsTableMetaKeepTimer; - -extern float tsNumOfThreadsPerCore; -extern float tsRatioOfQueryThreads; -extern char tsPublicIp[]; -extern char tsPrivateIp[]; +extern int32_t tsStatusInterval; extern int16_t tsNumOfVnodesPerCore; extern int16_t tsNumOfTotalVnodes; -extern uint32_t tsPublicIpInt; +extern int32_t tsNumOfMnodes; + +// common +extern int tsRpcTimer; +extern int tsRpcMaxTime; +extern int32_t tsMaxConnections; +extern int32_t tsMaxShellConns; +extern int32_t tsShellActivityTimer; +extern uint32_t tsMaxTmrCtrl; +extern float tsNumOfThreadsPerCore; +extern float tsRatioOfQueryThreads; +extern int8_t tsDaylight; +extern char tsTimezone[64]; +extern char tsLocale[64]; +extern char tsCharset[64]; // default encode string +extern int32_t tsEnableCoreFile; +extern int32_t tsCompressMsgSize; + +// client +extern int32_t tsTableMetaKeepTimer; +extern int32_t tsMaxSQLStringLen; +extern int32_t tsTscEnableRecordSql; +extern int32_t tsMaxNumOfOrderedResults; +extern int32_t tsMinSlidingTime; +extern int32_t tsMinIntervalTime; +extern int32_t tsMaxStreamComputDelay; +extern int32_t tsStreamCompStartDelay; +extern int32_t tsStreamCompRetryDelay; +extern float tsStreamComputDelayRatio; // the delayed computing ration of the whole time window +extern int32_t tsProjectExecInterval; +extern int64_t tsMaxRetentWindow; +// db parameters in client extern int32_t tsCacheBlockSize; extern int32_t tsBlocksPerVnode; extern int32_t tsMaxTablePerVnode; @@ -87,42 +78,16 @@ extern int16_t tsCompression; extern int16_t tsWAL; extern int32_t tsReplications; -extern int16_t tsAffectedRowsMod; -extern int32_t tsNumOfMnodes; -extern int32_t tsMaxShellConns; -extern int32_t tsMaxTables; - -extern char tsMqttBrokerAddress[]; -extern char tsMqttBrokerClientId[]; - -extern int32_t tsMaxConnections; - +// balance +extern int32_t tsEnableBalance; +extern int32_t tsAlternativeRole; extern int32_t tsBalanceInterval; extern int32_t tsOfflineThreshold; extern int32_t tsMnodeEqualVnodeNum; -extern int32_t tsEnableHttpModule; -extern int32_t tsEnableMqttModule; -extern int32_t tsEnableMonitorModule; - -extern int32_t tsRestRowLimit; -extern int32_t tsMaxSQLStringLen; -extern int32_t tsCompressMsgSize; -extern int32_t tsMaxNumOfOrderedResults; - -extern char tsSocketType[4]; - -extern int32_t tsMinSlidingTime; -extern int32_t tsMinIntervalTime; -extern int32_t tsMaxStreamComputDelay; -extern int32_t tsStreamCompStartDelay; -extern int32_t tsStreamCompRetryDelay; -extern float tsStreamComputDelayRatio; // the delayed computing ration of the whole time window - -extern int tsProjectExecInterval; -extern int64_t tsMaxRetentWindow; - -extern char tsHttpIp[]; +// restful +extern int32_t tsEnableHttpModule; +extern int32_t tsRestRowLimit; extern uint16_t tsHttpPort; extern int32_t tsHttpCacheSessions; extern int32_t tsHttpSessionExpire; @@ -131,12 +96,54 @@ extern int32_t tsHttpEnableCompress; extern int32_t tsHttpEnableRecordSql; extern int32_t tsTelegrafUseFieldNum; -extern int32_t tsTscEnableRecordSql; +// mqtt +extern int32_t tsEnableMqttModule; +extern char tsMqttBrokerAddress[]; +extern char tsMqttBrokerClientId[]; + +// monitor +extern int32_t tsEnableMonitorModule; +extern char tsMonitorDbName[]; +extern char tsInternalPass[]; +extern int32_t tsMonitorInterval; + +// internal +extern int32_t tscEmbedded; +extern char configDir[]; +extern char tsVnodeDir[]; +extern char tsDnodeDir[]; +extern char tsMnodeDir[]; +extern char tsDataDir[]; +extern char tsLogDir[]; +extern char tsScriptDir[]; +extern int64_t tsMsPerDay[3]; + +// system info +extern char tsOsName[]; +extern int64_t tsPageSize; +extern int64_t tsOpenMax; +extern int64_t tsStreamMax; +extern int32_t tsNumOfCores; +extern float tsTotalLogDirGB; +extern float tsTotalTmpDirGB; +extern float tsTotalDataDirGB; +extern float tsAvailLogDirGB; +extern float tsAvailTmpDirGB; +extern float tsAvailDataDirGB; +extern float tsMinimalLogDirGB; +extern float tsMinimalTmpDirGB; +extern float tsMinimalDataDirGB; +extern int32_t tsTotalMemoryMB; +extern int32_t tsVersion; -extern char tsMonitorDbName[]; -extern char tsInternalPass[]; -extern int32_t tsMonitorInterval; +// build info +extern char version[]; +extern char compatible_version[]; +extern char gitinfo[]; +extern char gitinfoOfInternal[]; +extern char buildinfo[]; +// log extern int32_t tsAsyncLog; extern int32_t tsNumOfLogLines; extern int32_t dDebugFlag; @@ -155,22 +162,6 @@ extern int32_t debugFlag; extern int32_t odbcDebugFlag; extern int32_t qDebugFlag; -extern uint32_t taosMaxTmrCtrl; - -extern int tsRpcTimer; -extern int tsRpcMaxTime; -extern int tsUdpDelay; -extern char version[]; -extern char compatible_version[]; -extern char gitinfo[]; -extern char gitinfoOfInternal[]; -extern char buildinfo[]; - -extern int8_t tsDaylight; -extern char tsTimezone[64]; -extern char tsLocale[64]; -extern char tsCharset[64]; // default encode string - #define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize) void taosInitGlobalCfg(); diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 2ed6ef3ab7a77ea3f6bc6def2d8456828c6ef1c5..e588339ca742af86b97898e1dd70e928622302f0 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -27,68 +27,77 @@ #include "ttimezone.h" #include "tsync.h" -char configDir[TSDB_FILENAME_LEN] = "/etc/taos"; -char tsVnodeDir[TSDB_FILENAME_LEN] = {0}; -char tsDnodeDir[TSDB_FILENAME_LEN] = {0}; -char tsMnodeDir[TSDB_FILENAME_LEN] = {0}; -char tsDataDir[TSDB_FILENAME_LEN] = "/var/lib/taos"; -char tsScriptDir[TSDB_FILENAME_LEN] = "/etc/taos"; -char tsOsName[10] = "Linux"; - -// system info, not configurable -int64_t tsPageSize; -int64_t tsOpenMax; -int64_t tsStreamMax; -int32_t tsNumOfCores = 1; -int32_t tsAlternativeRole = 0; -float tsTotalTmpDirGB = 0; -float tsTotalDataDirGB = 0; -float tsAvailTmpDirGB = 0; -float tsAvailDataDirGB = 0; -float tsMinimalTmpDirGB = 0.1; -float tsMinimalDataDirGB = 0.5; -int32_t tsTotalMemoryMB = 0; -int32_t tsVersion = 0; -int32_t tsEnableCoreFile = 0; - -// global, not configurable -int32_t tscEmbedded = 0; - -/* - * minimum scale for whole system, millisecond by default - * for TSDB_TIME_PRECISION_MILLI: 86400000L - * TSDB_TIME_PRECISION_MICRO: 86400000000L - * TSDB_TIME_PRECISION_NANO: 86400000000000L - */ -int64_t tsMsPerDay[] = {86400000L, 86400000000L, 86400000000000L}; - -char tsFirst[TSDB_EP_LEN] = {0}; -char tsSecond[TSDB_EP_LEN] = {0}; -char tsArbitrator[TSDB_EP_LEN] = {0}; -char tsLocalFqdn[TSDB_FQDN_LEN] = {0}; -char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port +// cluster +char tsFirst[TSDB_EP_LEN] = {0}; +char tsSecond[TSDB_EP_LEN] = {0}; +char tsArbitrator[TSDB_EP_LEN] = {0}; +char tsLocalFqdn[TSDB_FQDN_LEN] = {0}; +char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port uint16_t tsServerPort = 6030; uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035] -uint16_t tsDnodeDnodePort = 6035; // udp/tcp +uint16_t tsDnodeDnodePort = 6035; // udp/tcp uint16_t tsSyncPort = 6040; +int32_t tsStatusInterval = 1; // second +int16_t tsNumOfVnodesPerCore = 8; +int16_t tsNumOfTotalVnodes = TSDB_INVALID_VNODE_NUM; +int32_t tsNumOfMnodes = 3; -int32_t tsStatusInterval = 1; // second -int32_t tsShellActivityTimer = 3; // second -int32_t tsTableMetaKeepTimer = 7200; // second +// common int32_t tsRpcTimer = 300; -int32_t tsRpcMaxTime = 600; // seconds; - +int32_t tsRpcMaxTime = 600; // seconds; +int32_t tsMaxShellConns = 5000; +int32_t tsMaxConnections = 5000; +int32_t tsShellActivityTimer = 3; // second float tsNumOfThreadsPerCore = 1.0; float tsRatioOfQueryThreads = 0.5; -int16_t tsNumOfVnodesPerCore = 8; -int16_t tsNumOfTotalVnodes = TSDB_INVALID_VNODE_NUM; +int8_t tsDaylight = 0; +char tsTimezone[64] = {0}; +char tsLocale[TSDB_LOCALE_LEN] = {0}; +char tsCharset[TSDB_LOCALE_LEN] = {0}; // default encode string +int32_t tsEnableCoreFile = 0; +int32_t tsMaxBinaryDisplayWidth = 30; -#ifdef _TD_ARM_32_ -int32_t tsMaxTablePerVnode = 100; -#else -int32_t tsMaxTablePerVnode = TSDB_DEFAULT_TABLES; -#endif +/* + * denote if the server needs to compress response message at the application layer to client, including query rsp, + * metricmeta rsp, and multi-meter query rsp message body. The client compress the submit message to server. + * + * 0: all data are compressed + * -1: all data are not compressed + * other values: if the message payload size is greater than the tsCompressMsgSize, the message will be compressed. + */ +int32_t tsCompressMsgSize = -1; + +// client +int32_t tsTableMetaKeepTimer = 7200; // second +int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN; +int32_t tsTscEnableRecordSql = 0; +// the maximum number of results for projection query on super table that are returned from +// one virtual node, to order according to timestamp +int32_t tsMaxNumOfOrderedResults = 100000; + +// 10 ms for sliding time, the value will changed in case of time precision changed +int32_t tsMinSlidingTime = 10; + +// 10 ms for interval time range, changed accordingly +int32_t tsMinIntervalTime = 10; + +// 20sec, the maximum value of stream computing delay, changed accordingly +int32_t tsMaxStreamComputDelay = 20000; + +// 10sec, the first stream computing delay time after system launched successfully, changed accordingly +int32_t tsStreamCompStartDelay = 10000; + +// the stream computing delay time after executing failed, change accordingly +int32_t tsStreamCompRetryDelay = 10; + +// The delayed computing ration. 10% of the whole computing time window by default. +float tsStreamComputDelayRatio = 0.1; + +int32_t tsProjectExecInterval = 10000; // every 10sec, the projection will be executed once +int64_t tsMaxRetentWindow = 24 * 3600L; // maximum time window tolerance + +// db parameters int32_t tsCacheBlockSize = TSDB_DEFAULT_CACHE_BLOCK_SIZE; int32_t tsBlocksPerVnode = TSDB_DEFAULT_TOTAL_BLOCKS; int16_t tsDaysPerFile = TSDB_DEFAULT_DAYS_PER_FILE; @@ -101,27 +110,74 @@ int16_t tsCompression = TSDB_DEFAULT_COMP_LEVEL; int16_t tsWAL = TSDB_DEFAULT_WAL_LEVEL; int32_t tsReplications = TSDB_DEFAULT_REPLICA_NUM; -/** - * Change the meaning of affected rows: - * 0: affected rows not include those duplicate records - * 1: affected rows include those duplicate records - */ -int16_t tsAffectedRowsMod = 0; -int32_t tsNumOfMnodes = 3; -int32_t tsMaxShellConns = 5000; -int32_t tsMaxConnections = 5000; +#ifdef _TD_ARM_32_ + int32_t tsMaxTablePerVnode = 100; +#else + int32_t tsMaxTablePerVnode = TSDB_DEFAULT_TABLES; +#endif +// balance +int32_t tsEnableBalance = 1; +int32_t tsAlternativeRole = 0; int32_t tsBalanceInterval = 300; // seconds int32_t tsOfflineThreshold = 86400*100; // seconds 10days int32_t tsMnodeEqualVnodeNum = 4; -int32_t tsEnableHttpModule = 1; -int32_t tsEnableMqttModule = 0; // not finished yet, not started it by default +// restful +int32_t tsEnableHttpModule = 1; +int32_t tsRestRowLimit = 10240; +uint16_t tsHttpPort = 6020; // only tcp, range tcp[6020] +int32_t tsHttpCacheSessions = 100; +int32_t tsHttpSessionExpire = 36000; +int32_t tsHttpMaxThreads = 2; +int32_t tsHttpEnableCompress = 0; +int32_t tsHttpEnableRecordSql = 0; +int32_t tsTelegrafUseFieldNum = 0; + +// mqtt +int32_t tsEnableMqttModule = 0; // not finished yet, not started it by default +char tsMqttBrokerAddress[128] = {0}; +char tsMqttBrokerClientId[128] = {0}; + +// monitor int32_t tsEnableMonitorModule = 0; +char tsMonitorDbName[TSDB_DB_NAME_LEN] = "log"; +char tsInternalPass[] = "secretkey"; +int32_t tsMonitorInterval = 30; // seconds -int32_t tsRestRowLimit = 10240; -int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN; +// internal +int32_t tscEmbedded = 0; +char configDir[TSDB_FILENAME_LEN] = "/etc/taos"; +char tsVnodeDir[TSDB_FILENAME_LEN] = {0}; +char tsDnodeDir[TSDB_FILENAME_LEN] = {0}; +char tsMnodeDir[TSDB_FILENAME_LEN] = {0}; +char tsDataDir[TSDB_FILENAME_LEN] = "/var/lib/taos"; +char tsScriptDir[TSDB_FILENAME_LEN] = "/etc/taos"; + +/* + * minimum scale for whole system, millisecond by default + * for TSDB_TIME_PRECISION_MILLI: 86400000L + * TSDB_TIME_PRECISION_MICRO: 86400000000L + * TSDB_TIME_PRECISION_NANO: 86400000000000L + */ +int64_t tsMsPerDay[] = {86400000L, 86400000000L, 86400000000000L}; + +// system info +char tsOsName[10] = "Linux"; +int64_t tsPageSize; +int64_t tsOpenMax; +int64_t tsStreamMax; +int32_t tsNumOfCores = 1; +float tsTotalTmpDirGB = 0; +float tsTotalDataDirGB = 0; +float tsAvailTmpDirGB = 0; +float tsAvailDataDirGB = 0; +float tsMinimalTmpDirGB = 0.1; +float tsMinimalDataDirGB = 0.5; +int32_t tsTotalMemoryMB = 0; +int32_t tsVersion = 0; +// log int32_t tsNumOfLogLines = 10000000; int32_t mDebugFlag = 135; int32_t sdbDebugFlag = 135; @@ -140,69 +196,6 @@ int32_t debugFlag = 131; int32_t sDebugFlag = 135; int32_t tsdbDebugFlag = 135; -// the maximum number of results for projection query on super table that are returned from -// one virtual node, to order according to timestamp -int32_t tsMaxNumOfOrderedResults = 100000; - -/* - * denote if the server needs to compress response message at the application layer to client, including query rsp, - * metricmeta rsp, and multi-meter query rsp message body. The client compress the submit message to server. - * - * 0: all data are compressed - * -1: all data are not compressed - * other values: if the message payload size is greater than the tsCompressMsgSize, the message will be compressed. - */ -int32_t tsCompressMsgSize = -1; - -// use UDP by default[option: udp, tcp] -char tsSocketType[4] = "udp"; - -// 10 ms for sliding time, the value will changed in case of time precision changed -int32_t tsMinSlidingTime = 10; - -// 10 ms for interval time range, changed accordingly -int32_t tsMinIntervalTime = 10; - -// 20sec, the maximum value of stream computing delay, changed accordingly -int32_t tsMaxStreamComputDelay = 20000; - -// 10sec, the first stream computing delay time after system launched successfully, changed accordingly -int32_t tsStreamCompStartDelay = 10000; - -// the stream computing delay time after executing failed, change accordingly -int32_t tsStreamCompRetryDelay = 10; - -// The delayed computing ration. 10% of the whole computing time window by default. -float tsStreamComputDelayRatio = 0.1; - -int32_t tsProjectExecInterval = 10000; // every 10sec, the projection will be executed once -int64_t tsMaxRetentWindow = 24 * 3600L; // maximum time window tolerance - -uint16_t tsHttpPort = 6020; // only tcp, range tcp[6020] -// uint16_t tsNginxPort = 6060; //only tcp, range tcp[6060] -int32_t tsHttpCacheSessions = 100; -int32_t tsHttpSessionExpire = 36000; -int32_t tsHttpMaxThreads = 2; -int32_t tsHttpEnableCompress = 0; -int32_t tsHttpEnableRecordSql = 0; -int32_t tsTelegrafUseFieldNum = 0; - -int32_t tsTscEnableRecordSql = 0; -uint32_t tsPublicIpInt = 0; - -char tsMonitorDbName[TSDB_DB_NAME_LEN] = "log"; -char tsInternalPass[] = "secretkey"; -int32_t tsMonitorInterval = 30; // seconds - -int8_t tsDaylight = 0; -char tsTimezone[64] = {0}; -char tsLocale[TSDB_LOCALE_LEN] = {0}; -char tsCharset[TSDB_LOCALE_LEN] = {0}; // default encode string -char tsMqttBrokerAddress[128] = {0}; -char tsMqttBrokerClientId[128] = {0}; - -int32_t tsMaxBinaryDisplayWidth = 30; - static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT; void taosSetAllDebugFlag() { @@ -426,6 +419,16 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); + cfg.option = "balance"; + cfg.ptr = &tsEnableBalance; + cfg.valType = TAOS_CFG_VTYPE_INT32; + cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; + cfg.minValue = 0; + cfg.maxValue = 1; + cfg.ptrLength = 1; + cfg.unitType = TAOS_CFG_UTYPE_NONE; + taosInitConfigOption(cfg); + cfg.option = "balanceInterval"; cfg.ptr = &tsBalanceInterval; cfg.valType = TAOS_CFG_VTYPE_INT32; @@ -447,19 +450,9 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "affectedRowsMod"; - cfg.ptr = &tsAffectedRowsMod; - cfg.valType = TAOS_CFG_VTYPE_INT16; - cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT; - cfg.minValue = 0; - cfg.maxValue = 1; - cfg.ptrLength = 0; - cfg.unitType = TAOS_CFG_UTYPE_NONE; - taosInitConfigOption(cfg); - // timer cfg.option = "maxTmrCtrl"; - cfg.ptr = &taosMaxTmrCtrl; + cfg.ptr = &tsMaxTmrCtrl; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; cfg.minValue = 8; @@ -669,16 +662,6 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "ctime"; - cfg.ptr = &tsCommitTime; - cfg.valType = TAOS_CFG_VTYPE_INT16; - cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; - cfg.minValue = TSDB_MIN_COMMIT_TIME; - cfg.maxValue = TSDB_MAX_COMMIT_TIME; - cfg.ptrLength = 0; - cfg.unitType = TAOS_CFG_UTYPE_SECOND; - taosInitConfigOption(cfg); - cfg.option = "comp"; cfg.ptr = &tsCompression; cfg.valType = TAOS_CFG_VTYPE_INT16; @@ -729,17 +712,6 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - // socket type; udp by default - cfg.option = "sockettype"; - cfg.ptr = tsSocketType; - cfg.valType = TAOS_CFG_VTYPE_STRING; - cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT | TSDB_CFG_CTYPE_B_SHOW; - cfg.minValue = 0; - cfg.maxValue = 0; - cfg.ptrLength = 3; - cfg.unitType = TAOS_CFG_UTYPE_NONE; - taosInitConfigOption(cfg); - cfg.option = "compressMsgSize"; cfg.ptr = &tsCompressMsgSize; cfg.valType = TAOS_CFG_VTYPE_INT32; @@ -873,7 +845,6 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "mqtt"; cfg.ptr = &tsEnableMqttModule; cfg.valType = TAOS_CFG_VTYPE_INT32; @@ -894,16 +865,6 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "monitorDbName"; - cfg.ptr = tsMonitorDbName; - cfg.valType = TAOS_CFG_VTYPE_STRING; - cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; - cfg.minValue = 0; - cfg.maxValue = 0; - cfg.ptrLength = TSDB_DB_NAME_LEN - 1; - cfg.unitType = TAOS_CFG_UTYPE_NONE; - taosInitConfigOption(cfg); - // http configs cfg.option = "httpCacheSessions"; cfg.ptr = &tsHttpCacheSessions; @@ -955,16 +916,6 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "httpEnableCompress"; - cfg.ptr = &tsHttpEnableCompress; - cfg.valType = TAOS_CFG_VTYPE_INT32; - cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG; - cfg.minValue = 0; - cfg.maxValue = 1; - cfg.ptrLength = 1; - cfg.unitType = TAOS_CFG_UTYPE_NONE; - taosInitConfigOption(cfg); - // debug flag cfg.option = "numOfLogLines"; cfg.ptr = &tsNumOfLogLines; diff --git a/src/inc/taos.h b/src/inc/taos.h index d524d95685581560fa3e565bce4cf189145af128..1d609bc7dbb7f5fe9bc1c26b169fcbdbac973cef 100644 --- a/src/inc/taos.h +++ b/src/inc/taos.h @@ -48,7 +48,6 @@ typedef enum { TSDB_OPTION_TIMEZONE, TSDB_OPTION_CONFIGDIR, TSDB_OPTION_SHELL_ACTIVITY_TIMER, - TSDB_OPTION_SOCKET_TYPE, TSDB_MAX_OPTIONS } TSDB_OPTION; diff --git a/src/inc/tbalance.h b/src/inc/tbalance.h index 63437021fd1542471a37f0ad168507398ddd8192..c52f5afaaa986e0979897c7664e2ef17b1d70766 100644 --- a/src/inc/tbalance.h +++ b/src/inc/tbalance.h @@ -25,8 +25,8 @@ struct SDnodeObj; int32_t balanceInit(); void balanceCleanUp(); -void balanceNotify(); -void balanceUpdateMnode(); +void balanceAsyncNotify(); +void balanceSyncNotify(); void balanceReset(); int32_t balanceAllocVnodes(struct SVgObj *pVgroup); int32_t balanceDropDnode(struct SDnodeObj *pDnode); diff --git a/src/mnode/src/mnodeBalance.c b/src/mnode/src/mnodeBalance.c index 14acffdb62e2358b02a08254ff967af175688b57..29389ce1aa0d5eb62a5ddc4f64c058d7ebff2d81 100644 --- a/src/mnode/src/mnodeBalance.c +++ b/src/mnode/src/mnodeBalance.c @@ -25,8 +25,8 @@ int32_t balanceInit() { return TSDB_CODE_SUCCESS; } void balanceCleanUp() {} -void balanceNotify() {} -void balanceUpdateMnode() {} +void balanceAsyncNotify() {} +void balanceSyncNotify() {} void balanceReset() {} int32_t balanceAllocVnodes(SVgObj *pVgroup) { diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index 9709d7786aaa3f6e0f563bd85ed453679ce0c4f6..01f56f8902c09057f83b8b8ff67c9ceea6fa652c 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -910,7 +910,7 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) { mTrace("db:%s, all vgroups is altered", pDb->name); mLPrint("db:%s, is alterd by %s", pDb->name, mnodeGetUserFromMsg(pMsg)); - balanceNotify(); + balanceAsyncNotify(); return TSDB_CODE_SUCCESS; } diff --git a/src/mnode/src/mnodeDnode.c b/src/mnode/src/mnodeDnode.c index e16195499b17335d44e5d51ae756e01d89e727ec..65c47fe583ac656e8cf9a37ad24a47e1e1929520 100644 --- a/src/mnode/src/mnodeDnode.c +++ b/src/mnode/src/mnodeDnode.c @@ -81,7 +81,7 @@ static int32_t mnodeDnodeActionDelete(SSdbOper *pOper) { mnodeDropAllDnodeVgroups(pDnode); #endif mnodeDropMnodeLocal(pDnode->dnodeId); - balanceNotify(); + balanceAsyncNotify(); mTrace("dnode:%d, all vgroups is dropped from sdb", pDnode->dnodeId); return TSDB_CODE_SUCCESS; @@ -382,8 +382,8 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { mTrace("dnode:%d, from offline to online", pDnode->dnodeId); pDnode->status = TAOS_DN_STATUS_READY; - balanceUpdateMnode(); - balanceNotify(); + balanceSyncNotify(); + balanceAsyncNotify(); } if (openVnodes != pDnode->openVnodes) { diff --git a/src/util/inc/ttimer.h b/src/util/inc/ttimer.h index 3649a8d2f1f4d09c61a930acf33be5c6e4701f6d..6992f5ab6ea792f6cdadd0af217fa5cb8b02dbc5 100644 --- a/src/util/inc/ttimer.h +++ b/src/util/inc/ttimer.h @@ -24,7 +24,7 @@ typedef void *tmr_h; typedef void (*TAOS_TMR_CALLBACK)(void *, void *); extern int taosTmrThreads; -extern uint32_t taosMaxTmrCtrl; +extern uint32_t tsMaxTmrCtrl; #define MSECONDS_PER_TICK 5 diff --git a/src/util/src/ttimer.c b/src/util/src/ttimer.c index a19b3607fd844f81a8ca34475f7bfe02f0df139e..a7b3bfb8182a237ae28b75f6cf5499501ed1ebb8 100644 --- a/src/util/src/ttimer.c +++ b/src/util/src/ttimer.c @@ -90,7 +90,7 @@ typedef struct time_wheel_t { } time_wheel_t; int32_t tmrDebugFlag = 131; -uint32_t taosMaxTmrCtrl = 512; +uint32_t tsMaxTmrCtrl = 512; static pthread_once_t tmrModuleInit = PTHREAD_ONCE_INIT; static pthread_mutex_t tmrCtrlMutex; @@ -492,17 +492,17 @@ bool taosTmrReset(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle, } static void taosTmrModuleInit(void) { - tmrCtrls = malloc(sizeof(tmr_ctrl_t) * taosMaxTmrCtrl); + tmrCtrls = malloc(sizeof(tmr_ctrl_t) * tsMaxTmrCtrl); if (tmrCtrls == NULL) { tmrError("failed to allocate memory for timer controllers."); return; } - for (int i = 0; i < taosMaxTmrCtrl - 1; ++i) { + for (int i = 0; i < tsMaxTmrCtrl - 1; ++i) { tmr_ctrl_t* ctrl = tmrCtrls + i; ctrl->next = ctrl + 1; } - (tmrCtrls + taosMaxTmrCtrl - 1)->next = NULL; + (tmrCtrls + tsMaxTmrCtrl - 1)->next = NULL; unusedTmrCtrl = tmrCtrls; pthread_mutex_init(&tmrCtrlMutex, NULL);