Merge pull request #24911 from taosdata/fix/TD-28877
fix: config global debugflag
This commit is contained in:
commit
09a04ed0a4
|
@ -234,10 +234,10 @@ int32_t taosCfgDynamicOptions(SConfig *pCfg, char *name, bool forServer);
|
||||||
|
|
||||||
struct SConfig *taosGetCfg();
|
struct SConfig *taosGetCfg();
|
||||||
|
|
||||||
void taosSetAllDebugFlag(int32_t flag);
|
void taosSetGlobalDebugFlag(int32_t flag);
|
||||||
void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal);
|
void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal);
|
||||||
void taosLocalCfgForbiddenToChange(char *name, bool *forbidden);
|
void taosLocalCfgForbiddenToChange(char *name, bool *forbidden);
|
||||||
int8_t taosGranted(int8_t type);
|
int8_t taosGranted(int8_t type);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -1263,6 +1263,8 @@ static int32_t taosSetReleaseCfg(SConfig *pCfg) { return 0; }
|
||||||
int32_t taosSetReleaseCfg(SConfig *pCfg);
|
int32_t taosSetReleaseCfg(SConfig *pCfg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void taosSetAllDebugFlag(SConfig *pCfg, int32_t flag);
|
||||||
|
|
||||||
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd,
|
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd,
|
||||||
const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc) {
|
const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc) {
|
||||||
if (tsCfg == NULL) osDefaultInit();
|
if (tsCfg == NULL) osDefaultInit();
|
||||||
|
@ -1307,7 +1309,7 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
|
||||||
taosSetServerLogCfg(pCfg);
|
taosSetServerLogCfg(pCfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosSetAllDebugFlag(cfgGetItem(pCfg, "debugFlag")->i32);
|
taosSetAllDebugFlag(pCfg, cfgGetItem(pCfg, "debugFlag")->i32);
|
||||||
|
|
||||||
if (taosMulModeMkDir(tsLogDir, 0777, true) != 0) {
|
if (taosMulModeMkDir(tsLogDir, 0777, true) != 0) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
|
@ -1385,7 +1387,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
|
||||||
taosSetSystemCfg(tsCfg);
|
taosSetSystemCfg(tsCfg);
|
||||||
if (taosSetFileHandlesLimit() != 0) return -1;
|
if (taosSetFileHandlesLimit() != 0) return -1;
|
||||||
|
|
||||||
taosSetAllDebugFlag(cfgGetItem(tsCfg, "debugFlag")->i32);
|
taosSetAllDebugFlag(tsCfg, cfgGetItem(tsCfg, "debugFlag")->i32);
|
||||||
|
|
||||||
cfgDumpCfg(tsCfg, tsc, false);
|
cfgDumpCfg(tsCfg, tsc, false);
|
||||||
|
|
||||||
|
@ -1478,7 +1480,7 @@ static int32_t taosCfgDynamicOptionsForServer(SConfig *pCfg, char *name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncasecmp(name, "debugFlag", 9) == 0) {
|
if (strncasecmp(name, "debugFlag", 9) == 0) {
|
||||||
taosSetAllDebugFlag(pItem->i32);
|
taosSetAllDebugFlag(pCfg, pItem->i32);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1552,7 +1554,7 @@ static int32_t taosCfgDynamicOptionsForClient(SConfig *pCfg, char *name) {
|
||||||
switch (lowcaseName[0]) {
|
switch (lowcaseName[0]) {
|
||||||
case 'd': {
|
case 'd': {
|
||||||
if (strcasecmp("debugFlag", name) == 0) {
|
if (strcasecmp("debugFlag", name) == 0) {
|
||||||
taosSetAllDebugFlag(pItem->i32);
|
taosSetAllDebugFlag(pCfg, pItem->i32);
|
||||||
matched = true;
|
matched = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1777,11 +1779,13 @@ static void taosCheckAndSetDebugFlag(int32_t *pFlagPtr, char *name, int32_t flag
|
||||||
taosSetDebugFlag(pFlagPtr, name, 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;
|
if (flag <= 0) return;
|
||||||
|
|
||||||
SArray *noNeedToSetVars = NULL;
|
SArray *noNeedToSetVars = NULL;
|
||||||
SConfigItem *pItem = cfgGetItem(tsCfg, "debugFlag");
|
SConfigItem *pItem = cfgGetItem(pCfg, "debugFlag");
|
||||||
if (pItem != NULL) {
|
if (pItem != NULL) {
|
||||||
pItem->i32 = flag;
|
pItem->i32 = flag;
|
||||||
noNeedToSetVars = pItem->array;
|
noNeedToSetVars = pItem->array;
|
||||||
|
|
|
@ -68,7 +68,7 @@ static struct {
|
||||||
int64_t startTime;
|
int64_t startTime;
|
||||||
} global = {0};
|
} 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 dmSetAssert(int32_t signum, void *sigInfo, void *context) { tsAssert = 1; }
|
||||||
|
|
||||||
static void dmStopDnode(int signum, void *sigInfo, void *context) {
|
static void dmStopDnode(int signum, void *sigInfo, void *context) {
|
||||||
|
|
Loading…
Reference in New Issue