forked from l-mb/sbd
-
Notifications
You must be signed in to change notification settings - Fork 33
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
avoid some probably unnecessary watchdog-reboots with pacemaker_remot… #14
Open
wenningerk
wants to merge
1
commit into
ClusterLabs:main
Choose a base branch
from
wenningerk:pacemaker_remote_stuff
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,18 +94,79 @@ mon_timer_reconnect(gpointer data) | |
cl_log(LOG_INFO, "CIB reconnect successful"); | ||
} | ||
|
||
notify_parent(); | ||
return FALSE; | ||
} | ||
|
||
static void | ||
mon_cib_connection_destroy(gpointer user_data) | ||
{ | ||
if (cib) { | ||
cib->cmds->signoff(cib); | ||
set_servant_health(pcmk_health_transient, LOG_WARNING, "Disconnected from CIB"); | ||
timer_id_reconnect = g_timeout_add(reconnect_msec, mon_timer_reconnect, NULL); | ||
int new_servant_health = pcmk_health_transient; | ||
xmlNode *cib_copy = NULL; | ||
pe_working_set_t data_set; | ||
node_t *node; | ||
|
||
/* use leftover info to check if we are running | ||
* on a remote-node without active resources | ||
*/ | ||
if (current_cib) { | ||
cib_copy = copy_xml(current_cib); | ||
if (cli_config_update(&cib_copy, NULL, FALSE)) { | ||
last_refresh = time(NULL); | ||
set_working_set_defaults(&data_set); | ||
data_set.input = cib_copy; | ||
data_set.flags |= pe_flag_have_stonith_resource; | ||
cluster_status(&data_set); | ||
compute_status(&data_set); | ||
node = pe_find_node(data_set.nodes, local_uname); | ||
if ((node != NULL) && | ||
(node->details->type == node_remote) && | ||
(node->details->running_rsc == NULL)) { | ||
|
||
if (data_set.no_quorum_policy != no_quorum_suicide) { | ||
new_servant_health = pcmk_health_online; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be wary of re-using "online" here, pcmk_health_pending might be better or invent a new one that means "safely disconnected dont shoot!" |
||
cl_log(LOG_INFO, | ||
"found remote node without remaining resources"); | ||
} else { | ||
/* Assuming reason for setting no-quorum-policy | ||
* to suicide is hope to regain connectivity | ||
* by rebooting or simply for the case there | ||
* might be something wrong with ourself. | ||
* Alternative would be to make configurable | ||
* independently for remote-nodes in sbd-config, | ||
* via cluster-property or even on a per | ||
* remote-node basis as resource-attribute. | ||
*/ | ||
cl_log(LOG_INFO, | ||
"found remote node without remaining resources - " | ||
"still suiciding derived from no-quorum-policy"); | ||
} | ||
} else { | ||
cl_log(LOG_INFO, "assuming that there are still " | ||
"resources to be handled"); | ||
} | ||
cleanup_calculations(&data_set); | ||
} else { | ||
cl_log(LOG_INFO, "cli_config_update failed"); | ||
} | ||
} else { | ||
cl_log(LOG_INFO, "found cib on destroy but current_cib is empty"); | ||
} | ||
cib->cmds->signoff(cib); | ||
set_servant_health(new_servant_health, LOG_WARNING, | ||
"Disconnected from CIB"); | ||
timer_id_reconnect = g_timeout_add(reconnect_msec, | ||
mon_timer_reconnect, NULL); | ||
} | ||
cib_connected = 0; | ||
if (current_cib) { | ||
/* cleanup the copy and prevent status being evaluated | ||
* again based on the old data | ||
*/ | ||
free_xml(current_cib); | ||
current_cib = NULL; | ||
} | ||
return; | ||
} | ||
|
||
|
@@ -204,6 +265,18 @@ compute_status(pe_working_set_t * data_set) | |
|
||
updates++; | ||
|
||
if (node != NULL) { | ||
if (node->details->type == node_remote) { | ||
cl_log(LOG_INFO, | ||
"'%s' is a remote-node that has %sresources running", | ||
local_uname, (node->details->running_rsc == NULL)?"no ":""); | ||
} else { | ||
cl_log(LOG_INFO, "'%s' is a full cluster-node", local_uname); | ||
} | ||
} else { | ||
cl_log(LOG_INFO, "didn't find ourself (%s) in cib", local_uname); | ||
} | ||
|
||
if (data_set->dc_node == NULL) { | ||
set_servant_health(pcmk_health_transient, LOG_INFO, "We don't have a DC right now."); | ||
notify_parent(); | ||
|
@@ -406,8 +479,10 @@ servant_pcmk(const char *diskname, int mode, const void* argp) | |
} while (exit_code == -ENOTCONN); | ||
|
||
if (exit_code != 0) { | ||
cl_log(LOG_WARNING, "Failed connecting to the cib"); | ||
clean_up(-exit_code); | ||
} | ||
cl_log(LOG_INFO, "Connected to cib"); | ||
} | ||
|
||
mainloop = g_main_new(FALSE); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make a copy if you're going to free the original at the end anyway?