Add config item alter lazy mode.
This commit is contained in:
parent
8ffa8811f5
commit
a63c132fba
|
@ -305,6 +305,7 @@ int32_t setAllConfigs(SConfig *pCfg);
|
|||
void printConfigNotMatch(SArray *array);
|
||||
|
||||
int32_t compareSConfigItemArrays(SArray *mArray, const SArray *dArray, SArray *diffArray);
|
||||
bool isConifgItemLazyMode(SConfigItem *item);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3036,4 +3036,12 @@ void printConfigNotMatch(SArray *array) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool isConifgItemLazyMode(SConfigItem *item) {
|
||||
if (item->dynScope == CFG_DYN_CLIENT_LAZY || item->dynScope == CFG_DYN_SERVER_LAZY ||
|
||||
item->dynScope == CFG_DYN_BOTH_LAZY) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
|
@ -476,10 +476,11 @@ int32_t dmProcessConfigReq(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
|||
return code;
|
||||
}
|
||||
}
|
||||
TAOS_CHECK_RETURN(taosCfgDynamicOptions(pCfg, cfgReq.config, true));
|
||||
if (cfgReq.version > 0) {
|
||||
tsdmConfigVersion = cfgReq.version;
|
||||
if (isConifgItemLazyMode(pItem)) {
|
||||
TAOS_CHECK_RETURN(taosCfgDynamicOptions(pCfg, cfgReq.config, true));
|
||||
return TSDB_CODE_INVALID_MSG;
|
||||
}
|
||||
|
||||
if (pItem->category == CFG_CATEGORY_GLOBAL) {
|
||||
code = taosPersistGlobalConfig(taosGetGlobalCfg(pCfg), pMgmt->path, tsdmConfigVersion);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
|
@ -491,6 +492,9 @@ int32_t dmProcessConfigReq(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
|||
dError("failed to persist local config since %s", tstrerror(code));
|
||||
}
|
||||
}
|
||||
if (cfgReq.version > 0) {
|
||||
tsdmConfigVersion = cfgReq.version;
|
||||
}
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue