pacemaker/bug-728579_pacemaker-stonith-dev-id.patch
Yan Gao bac5bcc13a Accepting request 952937 from home:yan_gao:branches:network:ha-clustering:Factory
- Update to version 2.1.2+20220126.16c1bab10:
- controller: correctly match "node down" events
- controller: improve meta-data warnings
- scheduler: assert on memory allocation error
- pacemakerd: improve messages for subdaemon handling

- Update to version 2.1.2+20220126.57e783b4b:
- libstonithd: avoid controld shutdown hanging
- pacemakerd: have signal-handler take care of lost processes
- scheduler: avoid memory leak when displaying clones
- Rebase:
  * bug-806256_pacemaker-log-level-notice.patch

- Update to version 2.1.2+20220120.3f0398825:
- scheduler: implement utilization for bundles
- fencer: reset op result before grabbing new one (rh#1470834)
- schemas: update fence-event API schema for recent change (rh#1470834)
- fencing: display exit reasons with failed fencing events (rh#1470834)
- fencing: return exit reason with fencing history (rh#1470834)
- fencer: track full result in fencing history (rh#1470834)

- Update to version 2.1.2+20220119.2c937a4c0:
- ipc_client: use libqb async API for connect
- pacemakerd: keep tracking pacemakerd for liveness
- pacemakerd: tweak systemd unit respawn settings

- Update to version 2.1.2+20220119.eec504705:
- libcrmservice: improve exit reason for timeouts (rh#1470834)
- fencing: improve exit reason for fencing timeouts (rh#1470834)
- controller: improve exit reason for internal timeouts (rh#1470834)

OBS-URL: https://build.opensuse.org/request/show/952937
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=356
2022-02-09 12:32:34 +00:00

101 lines
3.7 KiB
Diff

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
Index: pacemaker-2.1.2+20211124.91f4bad83/daemons/fenced/fenced_commands.c
===================================================================
--- pacemaker-2.1.2+20211124.91f4bad83.orig/daemons/fenced/fenced_commands.c
+++ pacemaker-2.1.2+20211124.91f4bad83/daemons/fenced/fenced_commands.c
@@ -1071,6 +1071,7 @@ build_device_from_xml(xmlNode * msg)
"on target", 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 */
Index: pacemaker-2.1.2+20211124.91f4bad83/lib/fencing/st_actions.c
===================================================================
--- pacemaker-2.1.2+20211124.91f4bad83.orig/lib/fencing/st_actions.c
+++ pacemaker-2.1.2+20211124.91f4bad83/lib/fencing/st_actions.c
@@ -31,6 +31,7 @@ struct stonith_action_s {
char *action;
char *victim;
GHashTable *args;
+ char *dev_id;
int timeout;
int async;
void *userdata;
@@ -213,6 +214,7 @@ stonith__destroy_action(stonith_action_t
services_action_free(action->svc_action);
}
pcmk__reset_result(&(action->result));
+ free(action->dev_id);
free(action);
}
}
@@ -261,6 +263,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;
snprintf(buffer, sizeof(buffer), "pcmk_%s_retries", _action);
value = g_hash_table_lookup(device_args, buffer);
@@ -268,6 +272,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;
@@ -605,6 +614,10 @@ internal_stonith_action_execute(stonith_
SVC_ACTION_NON_BLOCKED,
"SVC_ACTION_NON_BLOCKED");
+ if (action->dev_id) {
+ svc_action->rsc = strdup(action->dev_id);
+ }
+
/* keep retries from executing out of control and free previous results */
if (is_retry) {
pcmk__reset_result(&(action->result));
Index: pacemaker-2.1.2+20211124.91f4bad83/lib/services/services_linux.c
===================================================================
--- pacemaker-2.1.2+20211124.91f4bad83.orig/lib/services/services_linux.c
+++ pacemaker-2.1.2+20211124.91f4bad83/lib/services/services_linux.c
@@ -29,6 +29,9 @@
#include "crm/services.h"
#include "crm/services_internal.h"
+#include "crm/stonith-ng.h"
+#include "crm/fencing/internal.h"
+
#include "services_private.h"
static void close_pipe(int fildes[]);
@@ -406,6 +409,15 @@ static void
add_action_env_vars(const svc_action_t *op)
{
void (*env_setter)(gpointer, gpointer, gpointer) = NULL;
+
+ if (pcmk__str_eq(op->standard, PCMK_RESOURCE_CLASS_STONITH, pcmk__str_casei)
+ && pcmk__str_eq(op->agent, "fence_legacy", pcmk__str_casei)
+ && op->rsc != NULL) {
+ const char *st_dev_id_key = CRM_META "_" F_STONITH_DEVICE;
+
+ setenv(st_dev_id_key, op->rsc, 1);
+ }
+
if (op->agent == NULL) {
env_setter = set_alert_env; /* we deal with alert handler */