Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: sbd-inquisitor: SBD_SYNC_RESOURCE_STARTUP should consider SBD_PACEMAKER #141

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix: sbd-inquisitor: SBD_SYNC_RESOURCE_STARTUP should consider SBD_PA…
…CEMAKER

Currently, if `SBD_SYNC_RESOURCE_STARTUP=false` and
`SBD_PACEMAKER=false`, sbd prints a warning every time it runs: "Should
think about enabling SBD_SYNC_RESOURCE_STARTUP." But this warning can
never be addressed, since `SBD_SYNC_RESOURCE_STARTUP=true` doesn't work
with `SBD_PACEMAKER=false`.

Additionally, if `SBD_PACEMAKER=false` but
`SBD_SYNC_RESOURCE_STARTUP=true`, the `SBD_SYNC_RESOURCE_STARTUP=true`
will have no effect, since `SBD_PACEMAKER` controls whether sbd sends
the ping to pacemaker. (If pacemaker is also configured with
`SBD_SYNC_RESOURCE_STARTUP=true`, it will hang forever waiting for the
ping from sbd that never comes.)

Handle both of these cases by checking the values of
`SBD_SYNC_RESOURCE_STARTUP` and `SBD_PACEMAKER`:

* `SBD_SYNC_RESOURCE_STARTUP=true`, `SBD_PACEMAKER=true`: No change.
Startup syncs as expected.

* `SBD_SYNC_RESOURCE_STARTUP=false`, `SBD_PACEMAKER=true`: No change.
Sbd warns about enabling `SBD_SYNC_RESOURCE_STARTUP` as expected.

* `SBD_SYNC_RESOURCE_STARTUP=true`, `SBD_PACEMAKER=false`: Currently,
pacemaker would hang. With the fix, sbd aborts with an error.

* `SBD_SYNC_RESOURCE_STARTUP=false`, `SBD_PACEMAKER=false`: Currently,
sbd warns about enabling `SBD_SYNC_RESOURCE_STARTUP`. With the fix, the
behavior is the same as it was before `SBD_SYNC_RESOURCE_STARTUP` was
introduced: no warning.
  • Loading branch information
Isaac Pittman committed Jan 12, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 4deae6b24ebfc35bd318a3c334e8f1b1ace406cc
9 changes: 8 additions & 1 deletion src/sbd-inquisitor.c
Original file line number Diff line number Diff line change
@@ -1276,11 +1276,18 @@ int main(int argc, char **argv, char **envp)
goto out;
}
#else
if (!sync_resource_startup) {
if (!sync_resource_startup && check_pcmk) {
cl_log(LOG_WARNING, "SBD built against pacemaker supporting "
"pacemakerd-API. Should think about enabling "
"SBD_SYNC_RESOURCE_STARTUP.");
}

if (sync_resource_startup && !check_pcmk) {
fprintf(stderr, "Failed to sync resource-startup as "
"pacemaker checks are off.\n");
exit_status = -1;
goto out;
}
#endif
}