add enable_cgroup cluster config

This commit is contained in:
obdev
2022-10-28 03:39:56 +00:00
committed by wangzelin.wzl
parent 4ffe4044cb
commit d7c7ca8f13
3 changed files with 8 additions and 1 deletions

View File

@ -1295,3 +1295,7 @@ DEF_STR_LIST(sanity_whitelist, OB_CLUSTER_PARAMETER, "", "vip who wouldn't leadi
DEF_TIME(_advance_checkpoint_timeout, OB_CLUSTER_PARAMETER, "30m", "[10s,180m]",
"the timeout for backup/migrate advance checkpoint Range: [10s,180m]",
ObParameterAttr(Section::ROOT_SERVICE, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(enable_cgroup, OB_CLUSTER_PARAMETER, "True",
"when set to false, cgroup will not init; when set to true but cgroup root dir is not ready, print ERROR",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::STATIC_EFFECTIVE));

View File

@ -40,7 +40,9 @@ ObCgSet ObCgSet::instance_;
int ObCgroupCtrl::init()
{
int ret = OB_SUCCESS;
if (OB_FAIL(init_cgroup_root_dir_(root_cgroup_))) {
if (GCONF.enable_cgroup == false) {
// not init cgroup when config set to false
} else if (OB_FAIL(init_cgroup_root_dir_(root_cgroup_))) {
LOG_WARN("init cgroup dir failed", K(ret), K(root_cgroup_));
} else if (OB_FAIL(init_cgroup_dir_(other_cgroup_))) {
LOG_WARN("init other cgroup dir failed", K(ret), K_(other_cgroup));

View File

@ -64,6 +64,7 @@ devname
disk_io_thread_count
dtl_buffer_size
enable_async_syslog
enable_cgroup
enable_ddl
enable_early_lock_release
enable_major_freeze