]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
systemd: Support Graceful Reboot for AIO Node 37301/head
authorWong Hoi Sing Edison <hswong3i@gmail.com>
Tue, 25 Aug 2020 04:16:54 +0000 (12:16 +0800)
committerWong Hoi Sing Edison <hswong3i@pantarei-design.com>
Tue, 22 Sep 2020 08:09:52 +0000 (16:09 +0800)
commited34cf29cfe8b42c17cf334455c1491700f60504
tree26c5f8b6012c9a6b8233f30cd6dff02fe51e5023
parentaf8003626d33fdc488a14d7a9e6ec7da1b81cf68
systemd: Support Graceful Reboot for AIO Node

Ceph AIO installation with single/multiple node is not friendly for
loopback mount, especially always get deadlock issue during graceful
system reboot.

We already have `rbdmap.service` with graceful system reboot friendly as
below:

    [Unit]
    After=network-online.target
    Before=remote-fs-pre.target
    Wants=network-online.target remote-fs-pre.target

    [Service]
    ExecStart=/usr/bin/rbdmap map
    ExecReload=/usr/bin/rbdmap map
    ExecStop=/usr/bin/rbdmap unmap-all

This PR introduce:

  - `ceph-mon.target`: Ensure startup after `network-online.target` and
    before `remote-fs-pre.target`
  - `ceph-*.target`: Ensure startup after `ceph-mon.target` and before
    `remote-fs-pre.target`
  - `rbdmap.service`: Once all `_netdev` get unmount by
    `remote-fs.target`, ensure unmap all RBD BEFORE any Ceph components
    under `ceph.target` get stopped during shutdown

The logic is concept proof by
<https://github.com/alvistack/ansible-role-ceph_common/tree/develop>;
also works as expected with Ceph + Kubernetes deployment by
<https://github.com/alvistack/ansible-collection-kubernetes/tree/develop>.
No more deadlock happened during graceful system reboot, both AIO
single/multiple no de with loopback mount.

Also see:

  - <https://github.com/ceph/ceph/pull/36776>
  - <https://github.com/etcd-io/etcd/pull/12259>
  - <https://github.com/cri-o/cri-o/pull/4128>
  - <https://github.com/kubernetes/release/pull/1504>

Fixes: https://tracker.ceph.com/issues/47528
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
(cherry picked from commit d88c834ea44bd67cfde0bd11ec4ded079b76d11a)

Conflicts:
systemd/ceph-immutable-object-cache.target
- only exists in branch octopus and master, not exists in branch nautilus
systemd/ceph-mgr@.service.in
systemd/ceph-mon@.service.in
- reorder lines due to original branch different, no logical changes
14 files changed:
systemd/ceph-fuse.target
systemd/ceph-mds.target
systemd/ceph-mds@.service.in
systemd/ceph-mgr.target
systemd/ceph-mgr@.service.in
systemd/ceph-mon.target
systemd/ceph-mon@.service.in
systemd/ceph-osd.target
systemd/ceph-osd@.service.in
systemd/ceph-radosgw.target
systemd/ceph-radosgw@.service.in
systemd/ceph-rbd-mirror.target
systemd/ceph.target
systemd/rbdmap.service.in