提交 6f414d74 编写于 作者: N Ning Yu

resgroup: fix memory dir checking on 5X in gpconfig.

On 5X branch the dir 'memory/gpdb' is optional but 'memory' is mandatory
to provide 'memory.limit_in_bytes', in such a case we must always set a
proper 'memory' component dir.
上级 9f4c6926
......@@ -44,6 +44,12 @@ class cgroup(object):
if not self.compdirs:
self.die("failed to detect cgroup component dirs.")
# 'memory' on 5X is special, although dir 'memory/gpdb' is optional,
# dir 'memory' is mandatory to provide 'memory.limit_in_bytes'.
# in such a case we must always put 'memory' in compdirs on 5X.
if gpver.version < [6, 0, 0] and 'memory' not in self.compdirs:
self.compdirs['memory'] = ''
self.validate_permission("cpu", "gpdb/", "rwx")
self.validate_permission("cpu", "gpdb/cgroup.procs", "rw")
self.validate_permission("cpu", "gpdb/cpu.cfs_period_us", "rw")
......@@ -106,11 +112,7 @@ class cgroup(object):
otherwise return False.
"""
comps = ['cpu', 'cpuacct']
if gpver.version >= [6, 0, 0]:
comps.extend(['cpuset', 'memory'])
for comp in comps:
for comp in self.required_comps():
if comp not in self.compdirs:
return False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册