• R/O
  • SSH

pm_diskd: Commit

※ リポジトリは、pm-diskd ブランチが https://github.com/linux-ha-japan/pm_diskd-1.0 へ、pm-diskd-2.0ブランチが https://github.com/linux-ha-japan/pm_diskd へ移行しました。

Pacemaker 対応ディスク故障監視機能。

Pacemaker-1.0公式リポジトリのクローンに対し、パッチ作成用のブランチを作成して管理する。
ブランチ名: pm-diskd

初回 hg clone 実行後は、hg update -r pm-diskd を実行すること。

Heartbeat-2.1.4 用 hb-diskd(*) のPacemaker対応版
(*) http://sourceforge.jp/projects/linux-ha/releases/?package_id=10555


Commit MetaInfo

Revisioncbca081b7f85dd88b2ab8a3a8266d2a32b548dd7 (tree)
Time2010-03-17 20:39:19
AuthorAndrew Beekhof <andrew@beek...>
CommiterAndrew Beekhof

Log Message

Low: PE: Considate and unify logging of fencing causes

Change Summary

Incremental Difference

diff -r 8debc1902e13 -r cbca081b7f85 lib/pengine/unpack.c
--- a/lib/pengine/unpack.c Wed Mar 17 12:37:46 2010 +0100
+++ b/lib/pengine/unpack.c Wed Mar 17 12:39:19 2010 +0100
@@ -45,6 +45,19 @@
4545 resource_t *rsc, node_t *node, xmlNode *xml_op,
4646 enum action_fail_response *failed, pe_working_set_t *data_set);
4747
48+static void pe_fence_node(pe_working_set_t *data_set, node_t *node, const char *reason)
49+{
50+ CRM_CHECK(node, return);
51+ if(node->details->unclean == FALSE) {
52+ if(is_set(data_set->flags, pe_flag_stonith_enabled)) {
53+ crm_warn("Node %s will be fenced %s", node->details->uname, reason);
54+ } else {
55+ crm_warn("Node %s is unclean %s", node->details->uname, reason);
56+ }
57+ }
58+ node->details->unclean = TRUE;
59+}
60+
4861
4962 gboolean
5063 unpack_config(xmlNode *config, pe_working_set_t *data_set)
@@ -362,9 +375,7 @@
362375 /* Everything else should flow from this automatically
363376 * At least until the PE becomes able to migrate off healthy resources
364377 */
365- crm_notice("Marking node %s for STONITH: The cluster does not have quorum",
366- this_node->details->uname);
367- this_node->details->unclean = TRUE;
378+ pe_fence_node(data_set, this_node, "because the cluster does not have quorum");
368379 }
369380
370381 if(this_node->details->online || is_set(data_set->flags, pe_flag_stonith_enabled)) {
@@ -382,7 +393,7 @@
382393 }
383394
384395 static gboolean
385-determine_online_status_no_fencing(xmlNode * node_state, node_t *this_node)
396+determine_online_status_no_fencing(pe_working_set_t *data_set, xmlNode * node_state, node_t *this_node)
386397 {
387398 gboolean online = FALSE;
388399 const char *join_state = crm_element_value(node_state, XML_CIB_ATTR_JOINSTATE);
@@ -418,10 +429,7 @@
418429
419430 } else {
420431 /* mark it unclean */
421- this_node->details->unclean = TRUE;
422-
423- crm_warn("Node %s is partially & un-expectedly down",
424- this_node->details->uname);
432+ pe_fence_node(data_set, this_node, "because it is partially and/or un-expectedly down");
425433 crm_info("\tha_state=%s, ccm_state=%s,"
426434 " crm_state=%s, join_state=%s, expected=%s",
427435 crm_str(ha_state), crm_str(ccm_state),
@@ -432,7 +440,7 @@
432440 }
433441
434442 static gboolean
435-determine_online_status_fencing(xmlNode * node_state, node_t *this_node)
443+determine_online_status_fencing(pe_working_set_t *data_set, xmlNode * node_state, node_t *this_node)
436444 {
437445 gboolean online = FALSE;
438446 gboolean do_terminate = FALSE;
@@ -465,8 +473,7 @@
465473 if(safe_str_eq(join_state, CRMD_JOINSTATE_MEMBER)) {
466474 online = TRUE;
467475 if(do_terminate) {
468- crm_notice("Forcing node %s to be terminated", this_node->details->uname);
469- this_node->details->unclean = TRUE;
476+ pe_fence_node(data_set, this_node, "because termination was requested");
470477 this_node->details->shutdown = TRUE;
471478 }
472479
@@ -500,8 +507,7 @@
500507 crm_str(ha_state), crm_str(ccm_state),
501508 crm_str(crm_state), crm_str(join_state),
502509 crm_str(exp_state));
503- this_node->details->unclean = TRUE;
504-
510+ pe_fence_node(data_set, this_node, "because it is un-expectedly down");
505511 }
506512
507513 } else if(crm_is_true(ccm_state) == FALSE
@@ -537,10 +543,7 @@
537543
538544 } else if(this_node->details->expected_up) {
539545 /* mark it unclean */
540- this_node->details->unclean = TRUE;
541-
542- crm_warn("Node %s (%s) is un-expectedly down",
543- this_node->details->uname, this_node->details->id);
546+ pe_fence_node(data_set, this_node, "because it is un-expectedly down");
544547 crm_info("\tha_state=%s, ccm_state=%s,"
545548 " crm_state=%s, join_state=%s, expected=%s",
546549 crm_str(ha_state), crm_str(ccm_state),
@@ -584,11 +587,11 @@
584587
585588 if(is_set(data_set->flags, pe_flag_stonith_enabled) == FALSE) {
586589 online = determine_online_status_no_fencing(
587- node_state, this_node);
590+ data_set, node_state, this_node);
588591
589592 } else {
590593 online = determine_online_status_fencing(
591- node_state, this_node);
594+ data_set, node_state, this_node);
592595 }
593596
594597 if(online) {
@@ -936,7 +939,7 @@
936939 /* treat it as if it is still running
937940 * but also mark the node as unclean
938941 */
939- node->details->unclean = TRUE;
942+ pe_fence_node(data_set, node, "to recover from resource failure(s)");
940943 break;
941944
942945 case action_fail_standby:
Show on old repository browser