While setting up cgroups v2 on Greenplum (GP) 7 and RedHat Enterprise Linux(RHEL) 9 below error might be encountered when setting "gp_resource_manager"
# gpconfig -c gp_resource_manager -v "group-v2"
20240813:15:32:43:1265603 gpconfig:mdw:gpadmin-[CRITICAL]:-new GUC value failed validation: [sdw1:cgroup is not properly configured: directory '/sys/fs/cgroup/gpdb/' does not exist],[sdw2:cgroup ....
Segment logs report:
2024-08-15 13:26:04.036379 CDT,,,p463679,th-1819166528,,,,0,,,seg2,,,,,"FATAL","XX000","can't write data to file '/sys/fs/cgroup/gpdb.service/cgroup.subtree_control': Operation not permitted",,,,,,,,"writeData","cgroup.c",341,1 0xd01aa6 postgres errstart (elog.c:494)
2 0x73b0d5 postgres <symbol not found> (cgroup.c:341)
3 0xd4563e postgres writeStr (cgroup.c:462)
4 0xd47a3d postgres <symbol not found> (cgroup-ops-linux-v2.c:194)
5 0xaff671 postgres PostmasterMain (postmaster.c:1531)
6 0x76ebd3 postgres main (main.c:173)
7 0x7fbd93a29590 libc.so.6 <symbol not found> + 0x93a29590
8 0x7fbd93a29640 libc.so.6 __libc_start_main + 0x80
9 0x77aa55 postgres _start + 0x25
RHEL9
GP 7.2, 7.3
cgroups v2 for resource groups
Possible causes:
Greenplum documentaiton had incorrect gpdb.service file information. Edit the /etc/systemd/system/gpdb.service file and use the following contents.
[Unit]
Description=Greenplum Cgroup v2 Configuration Service
[Service]
Type=simple
WorkingDirectory=/sys/fs/cgroup/gpdb.service
Delegate=yes
Slice=-.slice
# set hierarchies only if cgroup v2 mounted
ExecCondition=bash -c '[ xcgroup2fs = x$(stat -fc "%%T" /sys/fs/cgroup) ] || exit 1'
ExecStartPre=bash -ec " \
chown -R gpadmin:gpadmin .; \
chmod a+w ../cgroup.procs; \
mkdir -p helper.scope"
ExecStart=sleep infinity
ExecStartPost=bash -ec "echo $MAINPID > /sys/fs/cgroup/cgroup.procs;"
[Install]
WantedBy=basic.target
The file should be modified on all hosts in the cluster, coordinator, standby coordinator and segment hosts.
The documentation for "Configuring and Using Resource Groups" will be updated with the correct information for the gpdb.service file.