提交 147a984c 编写于 作者: S Shengliang Guan

feat: make config dnode work

上级 b2525de7
......@@ -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) {
......
......@@ -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) {
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册