Skip to contentSkip to conversation

drbd-reactor v0.5.1

DRBD-announce Roland Kammerer 1 participant 1 message Nov 30, 2021

lore
Share & tools
lore
#0 lore raw

Dear DRBD users,

This is drbd-reactor v0.5.1, fixing a bug mainly relevant for LINBIT vSAN, and introducing a smaller feature, both in the promoter plugin.

The feature is that we now also override the Description field in our service overrides, which makes reading logs/systemdctl status a bit nicer. drbd-reactor controlled services show up like this:

mnt-test.mount - drbd-reactor controlled mnt-test

The bug that was fixed occurs in combination with the "stop-services-on-exit" config option. If set, the controlled services (i.e., the [email protected]) is stopped whenever the plugin exits. This can be a drbd-reactorctl disable ..., or even a systemctl stop drbd-reactor. vSAN sets that option, which makes it easy to switch over all services by stopping the drbd-reactor service. And this is where it gets complicated, I just quote the commit message for this fix:

Commit 27d798e0 introduced setting Before=drbd-reactor.service in the generated drbd-services@ target overrides. While a good idea in general (see that particular commit), it also can create a situation where the user issues a systemctl stop drbd-reactor (expecting switch-over), which then blocks as: drbd-reactor.service wants to shut down and promoter wants to systemctl stop the target unit. But this contains the mentioned Before= and wants drbd-reactor to be gone first. Blocks and timeouts.

We can borrow Pacemaker behavior by writing the Before= in a extra override and when the plugin detects it is responsible for shutdown, it then can:
- rm that particular Before= override file.
- systemctl daemon-reload
- systemctl stop the target (that now does not have the Before= dependency on drbd-reactor.service)

All fine, but with that we saw another behavior becoming a show stopper:
systemd.mount(5) automatically adds a Before= dependency on local-fs.target unless "nofail" is specified. That in combination with what was described above made systemd fail with a cyclic dependency on "reboot". That can be solved by setting "nofail" as an option, or what looks even a slightly better in our case by setting "DefaultDependencies=no".

Regards, rck

GIT: https://github.com/LINBIT/drbd-reactor/commit/3b521bacec0957725ed00e2ada0c691edbdde9d4
TGZ: https://pkg.linbit.com//downloads/drbd/utils/drbd-reactor-0.5.1.tar.gz
PPA: https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack

Changelog:
* build: bump debian utils dep as well
* promoter: fix stop-services-on-exit
* promoter: override description