※ リポジトリは、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
Revision | cbca081b7f85dd88b2ab8a3a8266d2a32b548dd7 (tree) |
---|---|
Time | 2010-03-17 20:39:19 |
Author | Andrew Beekhof <andrew@beek...> |
Commiter | Andrew Beekhof |
Low: PE: Considate and unify logging of fencing causes
@@ -45,6 +45,19 @@ | ||
45 | 45 | resource_t *rsc, node_t *node, xmlNode *xml_op, |
46 | 46 | enum action_fail_response *failed, pe_working_set_t *data_set); |
47 | 47 | |
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 | + | |
48 | 61 | |
49 | 62 | gboolean |
50 | 63 | unpack_config(xmlNode *config, pe_working_set_t *data_set) |
@@ -362,9 +375,7 @@ | ||
362 | 375 | /* Everything else should flow from this automatically |
363 | 376 | * At least until the PE becomes able to migrate off healthy resources |
364 | 377 | */ |
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"); | |
368 | 379 | } |
369 | 380 | |
370 | 381 | if(this_node->details->online || is_set(data_set->flags, pe_flag_stonith_enabled)) { |
@@ -382,7 +393,7 @@ | ||
382 | 393 | } |
383 | 394 | |
384 | 395 | 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) | |
386 | 397 | { |
387 | 398 | gboolean online = FALSE; |
388 | 399 | const char *join_state = crm_element_value(node_state, XML_CIB_ATTR_JOINSTATE); |
@@ -418,10 +429,7 @@ | ||
418 | 429 | |
419 | 430 | } else { |
420 | 431 | /* 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"); | |
425 | 433 | crm_info("\tha_state=%s, ccm_state=%s," |
426 | 434 | " crm_state=%s, join_state=%s, expected=%s", |
427 | 435 | crm_str(ha_state), crm_str(ccm_state), |
@@ -432,7 +440,7 @@ | ||
432 | 440 | } |
433 | 441 | |
434 | 442 | 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) | |
436 | 444 | { |
437 | 445 | gboolean online = FALSE; |
438 | 446 | gboolean do_terminate = FALSE; |
@@ -465,8 +473,7 @@ | ||
465 | 473 | if(safe_str_eq(join_state, CRMD_JOINSTATE_MEMBER)) { |
466 | 474 | online = TRUE; |
467 | 475 | 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"); | |
470 | 477 | this_node->details->shutdown = TRUE; |
471 | 478 | } |
472 | 479 |
@@ -500,8 +507,7 @@ | ||
500 | 507 | crm_str(ha_state), crm_str(ccm_state), |
501 | 508 | crm_str(crm_state), crm_str(join_state), |
502 | 509 | 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"); | |
505 | 511 | } |
506 | 512 | |
507 | 513 | } else if(crm_is_true(ccm_state) == FALSE |
@@ -537,10 +543,7 @@ | ||
537 | 543 | |
538 | 544 | } else if(this_node->details->expected_up) { |
539 | 545 | /* 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"); | |
544 | 547 | crm_info("\tha_state=%s, ccm_state=%s," |
545 | 548 | " crm_state=%s, join_state=%s, expected=%s", |
546 | 549 | crm_str(ha_state), crm_str(ccm_state), |
@@ -584,11 +587,11 @@ | ||
584 | 587 | |
585 | 588 | if(is_set(data_set->flags, pe_flag_stonith_enabled) == FALSE) { |
586 | 589 | online = determine_online_status_no_fencing( |
587 | - node_state, this_node); | |
590 | + data_set, node_state, this_node); | |
588 | 591 | |
589 | 592 | } else { |
590 | 593 | online = determine_online_status_fencing( |
591 | - node_state, this_node); | |
594 | + data_set, node_state, this_node); | |
592 | 595 | } |
593 | 596 | |
594 | 597 | if(online) { |
@@ -936,7 +939,7 @@ | ||
936 | 939 | /* treat it as if it is still running |
937 | 940 | * but also mark the node as unclean |
938 | 941 | */ |
939 | - node->details->unclean = TRUE; | |
942 | + pe_fence_node(data_set, node, "to recover from resource failure(s)"); | |
940 | 943 | break; |
941 | 944 | |
942 | 945 | case action_fail_standby: |