pacemaker/bug-728579_pacemaker-stonith-dev-id.patch

80 lines
2.7 KiB
Diff
Raw Normal View History

commit 1e01228825eb8d4449edfbb1a1fa0c38fab4d5e6
Author: Gao,Yan <ygao@suse.com>
Date: Thu Sep 6 15:14:58 2012 +0800
Medium: stonith: Expose IDs of stonith resources to stonith agents through "$CRM_meta_st_device_id" environment variable
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
Index: pacemaker-1.1.17+20170926.4328c6a65/fencing/commands.c
===================================================================
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
--- pacemaker-1.1.17+20170926.4328c6a65.orig/fencing/commands.c
+++ pacemaker-1.1.17+20170926.4328c6a65/fencing/commands.c
@@ -925,6 +925,7 @@ build_device_from_xml(xmlNode * msg)
device->id, device->on_target_actions);
}
+ g_hash_table_insert(device->params, strdup(CRM_META "_" F_STONITH_DEVICE), strdup(device->id));
device->work = mainloop_add_trigger(G_PRIORITY_HIGH, stonith_device_dispatch, device);
/* TODO: Hook up priority */
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
Index: pacemaker-1.1.17+20170926.4328c6a65/lib/fencing/st_client.c
===================================================================
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
--- pacemaker-1.1.17+20170926.4328c6a65.orig/lib/fencing/st_client.c
+++ pacemaker-1.1.17+20170926.4328c6a65/lib/fencing/st_client.c
@@ -54,6 +54,7 @@ struct stonith_action_s {
char *action;
char *victim;
char *args;
+ char *dev_id;
int timeout;
int async;
void *userdata;
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
@@ -666,6 +667,7 @@ stonith_action_destroy(stonith_action_t
free(action->args);
free(action->action);
free(action->victim);
+ free(action->dev_id);
free(action);
}
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
@@ -693,6 +695,8 @@ stonith_action_create(const char *agent,
if (device_args) {
char buffer[512];
const char *value = NULL;
+ const char *st_dev_id_key = CRM_META "_" F_STONITH_DEVICE;
+ const char *st_dev_id_value = NULL;
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
snprintf(buffer, sizeof(buffer), "pcmk_%s_retries", _action);
value = g_hash_table_lookup(device_args, buffer);
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
@@ -700,6 +704,11 @@ stonith_action_create(const char *agent,
if (value) {
action->max_retries = atoi(value);
}
+
+ st_dev_id_value = g_hash_table_lookup(device_args, st_dev_id_key);
+ if (st_dev_id_value) {
+ action->dev_id = strdup(st_dev_id_value);
+ }
}
return action;
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
@@ -881,6 +890,8 @@ internal_stonith_action_execute(stonith_
if (!pid) {
/* child */
+ const char *st_dev_id_key = CRM_META "_" F_STONITH_DEVICE;
+
setpgid(0, 0);
close(1);
Accepting request 532208 from home:yan_gao:branches:network:ha-clustering:Factory:Test - Log: Reduce verbosity of developer logging - PE: We most definitely need to probe connection resources - PE: Ensure the bundle nodes get set with the correct discovery mode - PE: Implement probing of container remote nodes - attrd: Tweak log messages for clarity - crm_resource: Do not send history erasure commands for nodes where this is none - PE: Resources in bundles should also respect failcounts - PE: Do not send notifications to unclean bundles - PE: Prevent graph loops when fencing the host out from underneath a bundle - Tools: Allow bundle resources to read/write master scores based on the same logic as attrd (cf34f4c) - PE: bundle: Send an additional host list when container-attribute-target=host - PE: Correctly interpret colocation with bundles - PE/attrd: Allow bundle resources to read/write attributes based on the physical host rather than the container name - Upstream version cs: 4328c6a65424d1caf9785107664ec1b7fc824664 - Rebase: * bug-728579_pacemaker-stonith-dev-id.patch - Fix: -Wformat-truncation=2: prevent format truncation - snprintf: use correct signedness in print format specifiers - snprintf: use sizeof(X) as size + prevent off-by-ones - crmd,libcrmcommon,libcluster,tools: handle PID as string properly - tools: use right size for string buffer in fake_transition.c - crm_resource: fix a memleak - pengine: sprintf -> snprintf - libcrmcommon: fix possible infloop in buffer_print - crm_snprintf_offset like parts: fix off-by-ones - attrd: improve update messages - stonithd,lrmd,pengine: spelling/formatting corrections - build: install ifspeed resource agent - libcrmservices: avoid assert for HB resource with no parameters OBS-URL: https://build.opensuse.org/request/show/532208 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=273
2017-10-06 15:22:51 +02:00
@@ -903,6 +914,10 @@ internal_stonith_action_execute(stonith_
close(p_write_fd);
Accepting request 362987 from home:yan_gao:branches:network:ha-clustering:Factory:Test - cpg: Ensure group name is never unset - remote: Simplify calls to accept() and inet_ntop() by using "struct sockaddr_storage" (bsc#964183) - remote: cl#5269 - Notify other clients of a new connection only if the handshake has completed (bsc#967388) - remote: Correctly display the IP address of the remote client (bsc#964183) - spec: declare also BSD license as suitable - libservices: Add error handling for pipe() failed. - libservices: Check resource agent is executable or not before pipe open. - crmd: Prevent use-after-free when an unexpected remote client takes over (bsc#964183) - pacemakerd: Correction of the stonithd process judgment of pacemakerd. - crmd: Do not turn on stonith-watchdog-timeout automatically if SBD is detected - remote: Correctly check for SBD configuration consistency - resources: Fix state file metadata in Dummy, Stateful and HealthCPU resource agents - systemd: Modified so that the cluster to stop before the rsyslog - common: Correctly locate sbd via its pidfile - common: Assume processes are active if we get EACCESS - Fencing: Simplify watchdog integration - crmd: Only poopulate stonith-watchdog-timeout if SBD is active - remote: Ensure SBD is consistently configured on remote nodes - remote: Allow cluster and remote LRM API versions to diverge - cib: Do not send notifications when the dryrun flag is present - Upstream version cs: cf67796823c4429714857411e614cfacfbc59d89 - crm_shadow: fix broken --display command - ipc: Respect the parameter of pick_ipc_buffer() but don't let it affect the global value - libcluster: crm_peer_uname() should return NULL if uuid is invalid - remote: recover from remote node fencing more quickly - crmd: update node state for migrated pacemaker_remote nodes - crmd: update node state for stopped pacemaker_remote nodes - crmd: update node state for started pacemaker_remote nodes - crmd: add new message type for updating pacemaker_remote node state OBS-URL: https://build.opensuse.org/request/show/362987 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=233
2016-02-29 15:41:59 +01:00
close(p_stderr_fd);
+ if (action->dev_id) {
+ setenv(st_dev_id_key, action->dev_id, 1);
+ }
+
/* keep retries from executing out of control */
if (is_retry) {
sleep(1);