Merge branch '3.0' of https://github.com/taosdata/TDengine into feat/TS-4243-3.0
This commit is contained in:
commit
8a4b9db172
|
@ -234,10 +234,10 @@ int32_t taosCfgDynamicOptions(SConfig *pCfg, char *name, bool forServer);
|
|||
|
||||
struct SConfig *taosGetCfg();
|
||||
|
||||
void taosSetAllDebugFlag(int32_t flag);
|
||||
void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal);
|
||||
void taosLocalCfgForbiddenToChange(char *name, bool *forbidden);
|
||||
int8_t taosGranted(int8_t type);
|
||||
void taosSetGlobalDebugFlag(int32_t flag);
|
||||
void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal);
|
||||
void taosLocalCfgForbiddenToChange(char *name, bool *forbidden);
|
||||
int8_t taosGranted(int8_t type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -705,7 +705,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
if (cfgAddInt32(pCfg, "monitorIntervalForBasic", tsMonitorIntervalForBasic, 1, 200000, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0)
|
||||
return -1;
|
||||
if (cfgAddBool(pCfg, "monitorForceV2", tsMonitorForceV2, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 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 (cfgAddInt32(pCfg, "auditInterval", tsAuditInterval, 500, 200000, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
|
@ -1174,7 +1174,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
tsMonitorLogProtocol = cfgGetItem(pCfg, "monitorLogProtocol")->bval;
|
||||
tsMonitorIntervalForBasic = cfgGetItem(pCfg, "monitorIntervalForBasic")->i32;
|
||||
tsMonitorForceV2 = cfgGetItem(pCfg, "monitorForceV2")->i32;
|
||||
|
||||
|
||||
tsEnableAudit = cfgGetItem(pCfg, "audit")->bval;
|
||||
tsEnableAuditCreateTable = cfgGetItem(pCfg, "auditCreateTable")->bval;
|
||||
tsAuditInterval = cfgGetItem(pCfg, "auditInterval")->i32;
|
||||
|
@ -1263,6 +1263,8 @@ static int32_t taosSetReleaseCfg(SConfig *pCfg) { return 0; }
|
|||
int32_t taosSetReleaseCfg(SConfig *pCfg);
|
||||
#endif
|
||||
|
||||
static void taosSetAllDebugFlag(SConfig *pCfg, int32_t flag);
|
||||
|
||||
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd,
|
||||
const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc) {
|
||||
if (tsCfg == NULL) osDefaultInit();
|
||||
|
@ -1307,7 +1309,7 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
|
|||
taosSetServerLogCfg(pCfg);
|
||||
}
|
||||
|
||||
taosSetAllDebugFlag(cfgGetItem(pCfg, "debugFlag")->i32);
|
||||
taosSetAllDebugFlag(pCfg, cfgGetItem(pCfg, "debugFlag")->i32);
|
||||
|
||||
if (taosMulModeMkDir(tsLogDir, 0777, true) != 0) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
|
@ -1385,7 +1387,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
|
|||
taosSetSystemCfg(tsCfg);
|
||||
if (taosSetFileHandlesLimit() != 0) return -1;
|
||||
|
||||
taosSetAllDebugFlag(cfgGetItem(tsCfg, "debugFlag")->i32);
|
||||
taosSetAllDebugFlag(tsCfg, cfgGetItem(tsCfg, "debugFlag")->i32);
|
||||
|
||||
cfgDumpCfg(tsCfg, tsc, false);
|
||||
|
||||
|
@ -1478,7 +1480,7 @@ static int32_t taosCfgDynamicOptionsForServer(SConfig *pCfg, char *name) {
|
|||
}
|
||||
|
||||
if (strncasecmp(name, "debugFlag", 9) == 0) {
|
||||
taosSetAllDebugFlag(pItem->i32);
|
||||
taosSetAllDebugFlag(pCfg, pItem->i32);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1552,7 +1554,7 @@ static int32_t taosCfgDynamicOptionsForClient(SConfig *pCfg, char *name) {
|
|||
switch (lowcaseName[0]) {
|
||||
case 'd': {
|
||||
if (strcasecmp("debugFlag", name) == 0) {
|
||||
taosSetAllDebugFlag(pItem->i32);
|
||||
taosSetAllDebugFlag(pCfg, pItem->i32);
|
||||
matched = true;
|
||||
}
|
||||
break;
|
||||
|
@ -1777,11 +1779,13 @@ static void taosCheckAndSetDebugFlag(int32_t *pFlagPtr, char *name, int32_t flag
|
|||
taosSetDebugFlag(pFlagPtr, name, flag);
|
||||
}
|
||||
|
||||
void taosSetAllDebugFlag(int32_t flag) {
|
||||
void taosSetGlobalDebugFlag(int32_t flag) { taosSetAllDebugFlag(tsCfg, flag); }
|
||||
|
||||
static void taosSetAllDebugFlag(SConfig *pCfg, int32_t flag) {
|
||||
if (flag <= 0) return;
|
||||
|
||||
SArray *noNeedToSetVars = NULL;
|
||||
SConfigItem *pItem = cfgGetItem(tsCfg, "debugFlag");
|
||||
SConfigItem *pItem = cfgGetItem(pCfg, "debugFlag");
|
||||
if (pItem != NULL) {
|
||||
pItem->i32 = flag;
|
||||
noNeedToSetVars = pItem->array;
|
||||
|
@ -1831,4 +1835,4 @@ int8_t taosGranted(int8_t type) {
|
|||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ static struct {
|
|||
int64_t startTime;
|
||||
} global = {0};
|
||||
|
||||
static void dmSetDebugFlag(int32_t signum, void *sigInfo, void *context) { taosSetAllDebugFlag(143); }
|
||||
static void dmSetDebugFlag(int32_t signum, void *sigInfo, void *context) { taosSetGlobalDebugFlag(143); }
|
||||
static void dmSetAssert(int32_t signum, void *sigInfo, void *context) { tsAssert = 1; }
|
||||
|
||||
static void dmStopDnode(int signum, void *sigInfo, void *context) {
|
||||
|
|
|
@ -216,7 +216,7 @@ int taos_collector_registry_validate_metric_name(taos_collector_registry_t *self
|
|||
regfree(&r);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
const char *taos_collector_registry_bridge(taos_collector_registry_t *self, char *ts, char *format) {
|
||||
taos_metric_formatter_clear(self->metric_formatter);
|
||||
taos_metric_formatter_load_metrics(self->metric_formatter, self->collectors, ts, format);
|
||||
|
@ -229,7 +229,7 @@ const char *taos_collector_registry_bridge(taos_collector_registry_t *self, char
|
|||
|
||||
return taos_string_builder_str(self->string_builder_batch);
|
||||
}
|
||||
|
||||
*/
|
||||
int taos_collector_registry_clear_batch(taos_collector_registry_t *self){
|
||||
return taos_string_builder_clear(self->string_builder_batch);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ int taos_gauge_destroy(taos_gauge_t *self) {
|
|||
self = NULL;
|
||||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
int taos_gauge_inc(taos_gauge_t *self, const char **label_values) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
if (self == NULL) return 1;
|
||||
|
@ -86,7 +86,7 @@ int taos_gauge_sub(taos_gauge_t *self, double r_value, const char **label_values
|
|||
if (sample == NULL) return 1;
|
||||
return taos_metric_sample_sub(sample, r_value);
|
||||
}
|
||||
|
||||
*/
|
||||
int taos_gauge_set(taos_gauge_t *self, double r_value, const char **label_values) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
if (self == NULL) return 1;
|
||||
|
|
|
@ -63,7 +63,7 @@ int taos_metric_formatter_destroy(taos_metric_formatter_t *self) {
|
|||
self = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
int taos_metric_formatter_load_help(taos_metric_formatter_t *self, const char *name, const char *help) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
if (self == NULL) return 1;
|
||||
|
@ -105,7 +105,7 @@ int taos_metric_formatter_load_type(taos_metric_formatter_t *self, const char *n
|
|||
|
||||
return taos_string_builder_add_char(self->string_builder, '\n');
|
||||
}
|
||||
|
||||
*/
|
||||
int taos_metric_formatter_load_l_value(taos_metric_formatter_t *self, const char *name, const char *suffix,
|
||||
size_t label_count, const char **label_keys, const char **label_values) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
|
@ -156,7 +156,7 @@ int taos_metric_formatter_load_l_value(taos_metric_formatter_t *self, const char
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
int taos_metric_formatter_load_sample(taos_metric_formatter_t *self, taos_metric_sample_t *sample,
|
||||
char *ts, char *format) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
|
@ -185,7 +185,7 @@ int taos_metric_formatter_load_sample(taos_metric_formatter_t *self, taos_metric
|
|||
|
||||
return taos_string_builder_add_char(self->string_builder, '\n');
|
||||
}
|
||||
|
||||
*/
|
||||
int taos_metric_formatter_clear(taos_metric_formatter_t *self) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
return taos_string_builder_clear(self->string_builder);
|
||||
|
@ -204,7 +204,7 @@ char *taos_metric_formatter_dump(taos_metric_formatter_t *self) {
|
|||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/*
|
||||
int taos_metric_formatter_load_metric(taos_metric_formatter_t *self, taos_metric_t *metric, char *ts, char *format) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
if (self == NULL) return 1;
|
||||
|
@ -255,3 +255,4 @@ int taos_metric_formatter_load_metrics(taos_metric_formatter_t *self, taos_map_t
|
|||
}
|
||||
return r;
|
||||
}
|
||||
*/
|
|
@ -91,6 +91,7 @@ int taos_metric_sample_add(taos_metric_sample_t *self, double r_value) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
int taos_metric_sample_sub(taos_metric_sample_t *self, double r_value) {
|
||||
TAOS_ASSERT(self != NULL);
|
||||
if (self->type != TAOS_GAUGE) {
|
||||
|
@ -99,7 +100,8 @@ int taos_metric_sample_sub(taos_metric_sample_t *self, double r_value) {
|
|||
}
|
||||
|
||||
#ifdef C11_ATOMIC
|
||||
/*_Atomic*/ double old = atomic_load(&self->r_value);
|
||||
///_Atomic/
|
||||
double old = atomic_load(&self->r_value);
|
||||
for (;;) {
|
||||
_Atomic double new = ATOMIC_VAR_INIT(old - r_value);
|
||||
if (atomic_compare_exchange_weak(&self->r_value, &old, new)) {
|
||||
|
@ -116,6 +118,7 @@ int taos_metric_sample_sub(taos_metric_sample_t *self, double r_value) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int taos_metric_sample_set(taos_metric_sample_t *self, double r_value) {
|
||||
if (self->type != TAOS_GAUGE && self->type != TAOS_COUNTER) {
|
||||
|
|
|
@ -46,7 +46,9 @@ class TDTestCase(TBase):
|
|||
# clusterDnodes.starttaosd(1)
|
||||
# time.sleep(5)
|
||||
autoGen.insert_data(5000, True)
|
||||
tdSql.execute(f"flush database {self.db}")
|
||||
self.flushDb(True)
|
||||
# wait flush operation over
|
||||
time.sleep(5)
|
||||
|
||||
# sql = 'show vnodes;'
|
||||
# while True:
|
||||
|
|
|
@ -214,7 +214,7 @@ function lcovFunc {
|
|||
'*/clientJniConnector.c' '*/clientTmqConnector.c' '*/version.c' '*/build_version.cc'\
|
||||
'*/tthread.c' '*/tversion.c' '*/ctgDbg.c' '*/schDbg.c' '*/qwDbg.c' '*/tencode.h' \
|
||||
'*/shellAuto.c' '*/shellTire.c' '*/shellCommand.c'\
|
||||
'*/sql.c' '*/sql.y'\
|
||||
'*/sql.c' '*/sql.y' '*/smaSnapshot.c' '*/smaCommit.c'\
|
||||
--branch-coverage --function-coverage -o coverage.info
|
||||
|
||||
# generate result
|
||||
|
|
|
@ -206,6 +206,7 @@ SWords shellCommands[] = {
|
|||
{"show grants full;", 0, 0, NULL},
|
||||
{"show grants logs;", 0, 0, NULL},
|
||||
#ifdef TD_ENTERPRISE
|
||||
{"show views;", 0, 0, NULL},
|
||||
{"split vgroup <vgroup_id>", 0, 0, NULL},
|
||||
#endif
|
||||
{"insert into <tb_name> values(", 0, 0, NULL},
|
||||
|
@ -570,6 +571,7 @@ void showHelp() {
|
|||
split vgroup <vgroup_id>;\n\
|
||||
show compacts;\n\
|
||||
show compact \n\
|
||||
show views;\n\
|
||||
show create view <all_table>;");
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue