Skip to content

Conversation

@wenningerk
Copy link

@wenningerk wenningerk commented Jul 20, 2020

State query ping of pacemakerd prevents pacemakerd from
starting any sub-daemons (and thus services) if sbd can't
reach it via ipc. As a health-check get timestamp from
pacemakerd. On shudown fetch info about graceful
shutdown from pacemakerd.
Use new pacemakerd-api provided by pacemaker.

This refactors #106 sync with pacemakerd
to use new pacemakerd-api in pacemaker based on
generic client api framework.

Added SBD_SYNC_RESOURCE_STARTUP defaulting to 'no' so
that upgrading pacemaker without sbd doesn't lead to pacemaker
locked waiting to be pinged by sbd.

@wenningerk wenningerk changed the title Fix: sbd-pacemkaer: sync with pacemakerd for robustness [WIP] Fix: sbd-pacemkaer: sync with pacemakerd for robustness Jul 20, 2020
@wenningerk wenningerk force-pushed the sync_with_pacemakerd_generic_ipc_api branch from a10ffa1 to b1f7e47 Compare July 20, 2020 14:05
@wenningerk
Copy link
Author

retest this please

@wenningerk wenningerk changed the title [WIP] Fix: sbd-pacemkaer: sync with pacemakerd for robustness Fix: sbd-pacemkaer: sync with pacemakerd for robustness Jul 21, 2020
@wenningerk
Copy link
Author

retest this please

Copy link

@kgaillot kgaillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. BTW title/commit message has typo "pacemkaer"

#include <crm/common/ipc_pacemakerd.h>

static pcmk_ipc_api_t *pacemakerd_api = NULL;
time_t last_ok = (time_t) 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be static

char timeout_sysrq_char = 'b';
bool move_to_root_cgroup = true;
bool enforce_moving_to_root_cgroup = false;
bool sync_resource_startup = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if the default were true when USE_PACEMAKERD_API is set, but pacemaker would have no way of knowing that. I can think of a couple of ways around that:

  • distros can change the sysconfig setting when they know their versions are compatible
  • or sysconfig could be a .in file substituted at configure time

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, a pitty that the default has to be false to serve its purpose :-(
it was the intention to change the sysconfig-setting from the distro-spec-file.
there is already a sed-line for s390x. having a configure configure switch
(set by the distro-spec-file + maybe some additional auto-magic derived
from what is seen in pacemaker) would probably be more elegant though.

#if !USE_PACEMAKERD_API
if (sync_resource_startup) {
fprintf(stderr, "Failed to sync resource-startup as "
"SBD was built against pacemaker not supporting pacemakerd-API.\n");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fprintf() or cl_log()?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is an arguable point. using fprintf is at least consistent as all early-error-exits are using fprintf so far. if changed I guess it should be done consistently as an own commit.

@wenningerk wenningerk force-pushed the sync_with_pacemakerd_generic_ipc_api branch from c80b7aa to 65674d7 Compare July 23, 2020 13:19
@wenningerk wenningerk changed the title Fix: sbd-pacemkaer: sync with pacemakerd for robustness Fix: sbd-pacemaker: sync with pacemakerd for robustness Jul 23, 2020
@kgaillot
Copy link

looks good to me, though travis disagrees :)

@wenningerk
Copy link
Author

Travis has an issue with loopback mounts. CI needs 3 loopback-devices. The 3rd one is now /dev/loop8 which is one too much for the default of 8 available loopback devices. Obviously the stuff travis does on the VMs before actually starting the docker-containers now needs one loopback-device more than before. Haven't figured out yet how to pass something into the cmdline travis uses for the VM kernel. Reason why it just hits the x86_64 tests is that they are the only ones offering system-virtualization where there are loopback-devices available at all. All the other environments are containers where I have to configure the preload library for sbd so that it accepts plain files. As the loopback-device + device-mapper simulation is nearer to real devices I'd like to keep that though if possible somehow.

State query ping of pacemakerd prevents pacemakerd from
starting any sub-daemons (and thus services) if sbd can't
reach it via ipc. As a health-check get timestamp from
pacemakerd. On shudown fetch info about graceful
shutdown from pacemakerd.
Use new pacemakerd-api provided by pacemaker.
@wenningerk wenningerk force-pushed the sync_with_pacemakerd_generic_ipc_api branch from 65674d7 to f4d38a0 Compare July 27, 2020 05:12
@wenningerk wenningerk merged commit 1117c6b into ClusterLabs:master Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants