Bug 1868831

Summary: FreezerState is incorrectly updated on system running cgroup v1
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: systemdAssignee: Michal Sekletar <msekleta>
Status: CLOSED ERRATA QA Contact: Frantisek Sumsal <fsumsal>
Severity: low Docs Contact: Prerana Sharma <presharm>
Priority: unspecified    
Version: 8.3CC: agk, atolani, gustavold, heinzm, jamacku, jbrassow, jsefler, kazen, lmanasko, lmiksik, msekleta, narendra_k, prajnoha, presharm, santhosh_m_r, sujith_pandel, systemd-maint-list, teigland, zkabelac
Target Milestone: rcKeywords: ZStream
Target Release: 8.4   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-239-42.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1882452 (view as bug list) Environment:
Last Closed: 2021-05-18 14:53:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1798275, 1825398, 1825884, 1882452    

Description Corey Marthaler 2020-08-13 23:05:34 UTC
Description of problem:
I'm not sure how I got these services into a "thaw" state, but when trying to freeze and thaw again, it appears that it's not even supported anyways.

[root@host-083 ~]# systemctl status sanlock
â— sanlock.service - Shared Storage Lease Manager
   Loaded: loaded (/usr/lib/systemd/system/sanlock.service; disabled; vendor preset: disabled)
   Active: active (running) (thawing) since Thu 2020-08-13 16:58:24 CDT; 44min ago
  Process: 26236 ExecStart=/usr/sbin/sanlock daemon (code=exited, status=0/SUCCESS)
 Main PID: 26237 (sanlock)
    Tasks: 6 (limit: 93971)
   Memory: 14.2M
   CGroup: /system.slice/sanlock.service
           ├─26237 /usr/sbin/sanlock daemon
           └─26238 /usr/sbin/sanlock daemon

Aug 13 16:58:24 host-083.virt.lab.msp.redhat.com systemd[1]: Starting Shared Storage Lease Manager...
Aug 13 16:58:24 host-083.virt.lab.msp.redhat.com systemd[1]: Started Shared Storage Lease Manager.
Aug 13 16:58:24 host-083.virt.lab.msp.redhat.com sanlock[26237]: 2020-08-13 16:58:24 12371 [26237]: set scheduler RR|RESET_ON_FORK priority 99 failed: Operation not permitted


[root@host-083 ~]# systemctl status lvmlockd
â— lvmlockd.service - LVM lock daemon
   Loaded: loaded (/usr/lib/systemd/system/lvmlockd.service; disabled; vendor preset: disabled)
   Active: active (running) (thawing) since Thu 2020-08-13 17:14:36 CDT; 28min ago
     Docs: man:lvmlockd(8)
 Main PID: 26874 (lvmlockd)
    Tasks: 3 (limit: 93971)
   Memory: 2.7M
   CGroup: /system.slice/lvmlockd.service
           └─26874 /usr/sbin/lvmlockd --foreground

Aug 13 17:14:36 host-083.virt.lab.msp.redhat.com systemd[1]: Starting LVM lock daemon...
Aug 13 17:14:36 host-083.virt.lab.msp.redhat.com lvmlockd[26874]: [D] creating /run/lvm/lvmlockd.socket
Aug 13 17:14:36 host-083.virt.lab.msp.redhat.com lvmlockd[26874]: 1597356876 lvmlockd started
Aug 13 17:14:36 host-083.virt.lab.msp.redhat.com systemd[1]: Started LVM lock daemon.


[root@host-083 ~]# systemctl freeze lvmlockd
Failed to freeze unit lvmlockd.service: Unit 'lvmlockd.service' does not support freezing.

[root@host-083 ~]# systemctl thaw lvmlockd
Failed to thaw unit lvmlockd.service: Unit 'lvmlockd.service' does not support freezing.


Version-Release number of selected component (if applicable):
kernel-4.18.0-232.el8    BUILT: Mon Aug 10 02:17:54 CDT 2020
lvm2-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
lvm2-libs-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
lvm2-dbusd-2.03.09-5.el8    BUILT: Wed Aug 12 15:49:44 CDT 2020
lvm2-lockd-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-libs-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-event-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-event-libs-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
sanlock-3.8.1-1.el8    BUILT: Thu Jul  9 14:02:05 CDT 2020
sanlock-lib-3.8.1-1.el8    BUILT: Thu Jul  9 14:02:05 CDT 2020

Comment 1 David Teigland 2020-08-17 15:37:33 UTC
I've never heard of thawing.  The systemctl man page says nothing about the "(thawing)", and google finds nothing about it either.

Comment 2 Michal Sekletar 2020-08-24 14:27:35 UTC
Before debugging this further I'd like to know the following. Is the system where you observe unexpected (thawing) state running with cgroupv2 enabled? What does your kernel command line look like?

Comment 3 Michal Sekletar 2020-09-08 14:13:50 UTC
I started to investigate what is going on and found out that we have a bug in recently added freezer support when running on cgroup v1. I've already sent upstream PR to fix the issue.

Comment 4 Michal Sekletar 2020-09-08 14:23:02 UTC
Issue is mostly cosmetic, howeve, "FreezerState" property is visible in systemctl output when it is not set to default value. Due to this bug, restart or reload actions will set it to "thawing". That may cause unnecessary confusion for users and hence potentially increase case volume. We should fix the issue in 0day update.

Comment 7 David Tardon 2020-09-24 09:59:40 UTC
*** Bug 1882225 has been marked as a duplicate of this bug. ***

Comment 19 Gustavo Luiz Duarte 2020-10-13 15:25:56 UTC
Michal, could you please provide a build with the fix so that we can verify it in our environment?

Comment 20 Michal Sekletar 2020-10-15 09:15:33 UTC
(In reply to Gustavo Luiz Duarte from comment #19)
> Michal, could you please provide a build with the fix so that we can verify
> it in our environment?

Here are test rpms (btw, this is a systemd build that will be released as 8.3 0day update).

https://msekleta.fedorapeople.org/freezer-thawing-fix/

Comment 29 errata-xmlrpc 2021-05-18 14:53:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: systemd security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1611