feat: make config dnode work

This commit is contained in:
Shengliang Guan 2022-06-23 15:11:23 +08:00
parent b2525de791
commit 147a984c17
3 changed files with 18 additions and 6 deletions

View File

@ -760,9 +760,14 @@ void taosCleanupCfg() {
}
void taosCfgDynamicOptions(const char *option, const char *value) {
if (strcasecmp(option, "debugFlag") == 0) {
int32_t debugFlag = atoi(value);
taosSetAllDebugFlag(debugFlag);
if (strncasecmp(option, "debugFlag", 9) == 0) {
if (value != NULL) {
if (strlen(option) > 10) {
value = option + 10;
}
}
int32_t flag = atoi(value);
taosSetAllDebugFlag(flag);
}
if (strcasecmp(option, "resetlog") == 0) {

View File

@ -123,8 +123,15 @@ int32_t dmProcessGrantRsp(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
}
int32_t dmProcessConfigReq(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
dError("config req is received, but not supported yet");
return TSDB_CODE_OPS_NOT_SUPPORT;
SDCfgDnodeReq cfgReq = {0};
if (tDeserializeSMCfgDnodeReq(pMsg->pCont, pMsg->contLen, &cfgReq) != 0) {
terrno = TSDB_CODE_INVALID_MSG;
return -1;
}
dInfo("start to config, option:%s, value:%s", cfgReq.config, cfgReq.value);
taosCfgDynamicOptions(cfgReq.config, cfgReq.value);
return 0;
}
static void dmGetServerRunStatus(SDnodeMgmt *pMgmt, SServerStatusRsp *pStatus) {

View File

@ -743,7 +743,7 @@ cmp_end:
}
void taosSetAllDebugFlag(int32_t flag) {
if (!(flag & DEBUG_TRACE || flag & DEBUG_DEBUG || flag & DEBUG_DUMP)) return;
if (flag <= 0) return;
dDebugFlag = flag;
vDebugFlag = flag;