opt msg on mnd
This commit is contained in:
parent
273e47a1fb
commit
9dbddeed16
|
@ -252,7 +252,7 @@ int32_t tsCompactPullupInterval = 10;
|
||||||
int32_t tsMqRebalanceInterval = 2;
|
int32_t tsMqRebalanceInterval = 2;
|
||||||
int32_t tsStreamCheckpointInterval = 60;
|
int32_t tsStreamCheckpointInterval = 60;
|
||||||
float tsSinkDataRate = 2.0;
|
float tsSinkDataRate = 2.0;
|
||||||
int32_t tsStreamNodeCheckInterval = 15;
|
int32_t tsStreamNodeCheckInterval = 16;
|
||||||
int32_t tsTtlUnit = 86400;
|
int32_t tsTtlUnit = 86400;
|
||||||
int32_t tsTtlPushIntervalSec = 10;
|
int32_t tsTtlPushIntervalSec = 10;
|
||||||
int32_t tsTrimVDbIntervalSec = 60 * 60; // interval of trimming db in all vgroups
|
int32_t tsTrimVDbIntervalSec = 60 * 60; // interval of trimming db in all vgroups
|
||||||
|
@ -691,8 +691,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
||||||
|
|
||||||
if (cfgAddBool(pCfg, "audit", tsEnableAudit, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
|
if (cfgAddBool(pCfg, "audit", tsEnableAudit, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
|
||||||
if (cfgAddBool(pCfg, "auditCreateTable", tsEnableAuditCreateTable, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
if (cfgAddBool(pCfg, "auditCreateTable", tsEnableAuditCreateTable, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||||
if (cfgAddInt32(pCfg, "auditInterval", tsAuditInterval, 500, 200000, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0)
|
if (cfgAddInt32(pCfg, "auditInterval", tsAuditInterval, 500, 200000, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (cfgAddBool(pCfg, "crashReporting", tsEnableCrashReport, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
if (cfgAddBool(pCfg, "crashReporting", tsEnableCrashReport, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||||
if (cfgAddBool(pCfg, "telemetryReporting", tsEnableTelem, CFG_SCOPE_BOTH, CFG_DYN_ENT_SERVER) != 0) return -1;
|
if (cfgAddBool(pCfg, "telemetryReporting", tsEnableTelem, CFG_SCOPE_BOTH, CFG_DYN_ENT_SERVER) != 0) return -1;
|
||||||
|
@ -711,8 +710,8 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
||||||
if (cfgAddInt32(pCfg, "transPullupInterval", tsTransPullupInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) !=
|
if (cfgAddInt32(pCfg, "transPullupInterval", tsTransPullupInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) !=
|
||||||
0)
|
0)
|
||||||
return -1;
|
return -1;
|
||||||
if (cfgAddInt32(pCfg, "compactPullupInterval", tsCompactPullupInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) !=
|
if (cfgAddInt32(pCfg, "compactPullupInterval", tsCompactPullupInterval, 1, 10000, CFG_SCOPE_SERVER,
|
||||||
0)
|
CFG_DYN_ENT_SERVER) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (cfgAddInt32(pCfg, "mqRebalanceInterval", tsMqRebalanceInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) !=
|
if (cfgAddInt32(pCfg, "mqRebalanceInterval", tsMqRebalanceInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) !=
|
||||||
0)
|
0)
|
||||||
|
@ -1465,8 +1464,7 @@ static int32_t taosCfgDynamicOptionsForServer(SConfig *pCfg, char *name) {
|
||||||
{"stDebugFlag", &stDebugFlag}, {"sndDebugFlag", &sndDebugFlag},
|
{"stDebugFlag", &stDebugFlag}, {"sndDebugFlag", &sndDebugFlag},
|
||||||
};
|
};
|
||||||
|
|
||||||
static OptionNameAndVar options[] = {
|
static OptionNameAndVar options[] = {{"audit", &tsEnableAudit},
|
||||||
{"audit", &tsEnableAudit},
|
|
||||||
{"asynclog", &tsAsyncLog},
|
{"asynclog", &tsAsyncLog},
|
||||||
{"disableStream", &tsDisableStream},
|
{"disableStream", &tsDisableStream},
|
||||||
{"enableWhiteList", &tsEnableWhiteList},
|
{"enableWhiteList", &tsEnableWhiteList},
|
||||||
|
@ -1497,8 +1495,7 @@ static int32_t taosCfgDynamicOptionsForServer(SConfig *pCfg, char *name) {
|
||||||
{"s3PageCacheSize", &tsS3PageCacheSize},
|
{"s3PageCacheSize", &tsS3PageCacheSize},
|
||||||
{"s3UploadDelaySec", &tsS3UploadDelaySec},
|
{"s3UploadDelaySec", &tsS3UploadDelaySec},
|
||||||
{"supportVnodes", &tsNumOfSupportVnodes},
|
{"supportVnodes", &tsNumOfSupportVnodes},
|
||||||
{"experimental", &tsExperimental}
|
{"experimental", &tsExperimental}};
|
||||||
};
|
|
||||||
|
|
||||||
if (taosCfgSetOption(debugOptions, tListLen(debugOptions), pItem, true) != 0) {
|
if (taosCfgSetOption(debugOptions, tListLen(debugOptions), pItem, true) != 0) {
|
||||||
taosCfgSetOption(options, tListLen(options), pItem, false);
|
taosCfgSetOption(options, tListLen(options), pItem, false);
|
||||||
|
@ -1695,8 +1692,7 @@ static int32_t taosCfgDynamicOptionsForClient(SConfig *pCfg, char *name) {
|
||||||
{"uDebugFlag", &uDebugFlag}, {"simDebugFlag", &simDebugFlag},
|
{"uDebugFlag", &uDebugFlag}, {"simDebugFlag", &simDebugFlag},
|
||||||
};
|
};
|
||||||
|
|
||||||
static OptionNameAndVar options[] = {
|
static OptionNameAndVar options[] = {{"asyncLog", &tsAsyncLog},
|
||||||
{"asyncLog", &tsAsyncLog},
|
|
||||||
{"assert", &tsAssert},
|
{"assert", &tsAssert},
|
||||||
{"compressMsgSize", &tsCompressMsgSize},
|
{"compressMsgSize", &tsCompressMsgSize},
|
||||||
{"countAlwaysReturnValue", &tsCountAlwaysReturnValue},
|
{"countAlwaysReturnValue", &tsCountAlwaysReturnValue},
|
||||||
|
@ -1720,8 +1716,7 @@ static int32_t taosCfgDynamicOptionsForClient(SConfig *pCfg, char *name) {
|
||||||
{"shellActivityTimer", &tsShellActivityTimer},
|
{"shellActivityTimer", &tsShellActivityTimer},
|
||||||
{"slowLogThreshold", &tsSlowLogThreshold},
|
{"slowLogThreshold", &tsSlowLogThreshold},
|
||||||
{"useAdapter", &tsUseAdapter},
|
{"useAdapter", &tsUseAdapter},
|
||||||
{"experimental", &tsExperimental}
|
{"experimental", &tsExperimental}};
|
||||||
};
|
|
||||||
|
|
||||||
if (taosCfgSetOption(debugOptions, tListLen(debugOptions), pItem, true) != 0) {
|
if (taosCfgSetOption(debugOptions, tListLen(debugOptions), pItem, true) != 0) {
|
||||||
taosCfgSetOption(options, tListLen(options), pItem, false);
|
taosCfgSetOption(options, tListLen(options), pItem, false);
|
||||||
|
|
|
@ -299,14 +299,14 @@ static bool mnodeIsNotLeader(SMnode *pMnode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t minCronTime() {
|
static int32_t minCronTime() {
|
||||||
int64_t min = INT64_MAX;
|
int32_t min = INT32_MAX;
|
||||||
min = TMIN(min, tsTtlPushIntervalSec);
|
min = TMIN(min, tsTtlPushIntervalSec);
|
||||||
min = TMIN(min, tsTrimVDbIntervalSec);
|
min = TMIN(min, tsTrimVDbIntervalSec);
|
||||||
min = TMIN(min, tsTransPullupInterval);
|
min = TMIN(min, tsTransPullupInterval);
|
||||||
min = TMIN(min, tsCompactPullupInterval);
|
min = TMIN(min, tsCompactPullupInterval);
|
||||||
min = TMIN(min, tsMqRebalanceInterval);
|
min = TMIN(min, tsMqRebalanceInterval);
|
||||||
min = TMIN(min, tsStreamCheckpointInterval);
|
min = TMIN(min, tsStreamCheckpointInterval);
|
||||||
min = TMIN(min, 5); // checkpointRemain
|
min = TMIN(min, 6); // checkpointRemain
|
||||||
min = TMIN(min, tsStreamNodeCheckInterval);
|
min = TMIN(min, tsStreamNodeCheckInterval);
|
||||||
|
|
||||||
int64_t telemInt = TMIN(60, (tsTelemInterval - 1));
|
int64_t telemInt = TMIN(60, (tsTelemInterval - 1));
|
||||||
|
@ -386,7 +386,8 @@ static void *mndThreadFp(void *param) {
|
||||||
int64_t minCron = minCronTime();
|
int64_t minCron = minCronTime();
|
||||||
if (sec % minCron == 0 && mnodeIsNotLeader(pMnode)) {
|
if (sec % minCron == 0 && mnodeIsNotLeader(pMnode)) {
|
||||||
// not leader, do nothing
|
// not leader, do nothing
|
||||||
mTrace("timer not process since mnode is not leader, reason: %s", tstrerror(terrno)) terrno = 0;
|
mTrace("timer not process since mnode is not leader, reason: %s", tstrerror(terrno));
|
||||||
|
terrno = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mndDoTimerPullupTask(pMnode, sec);
|
mndDoTimerPullupTask(pMnode, sec);
|
||||||
|
|
Loading…
Reference in New Issue