Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: crm by andrew from
([email protected])
2. Linux-HA CVS: include by andrew from
([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Mon, 3 Apr 2006 04:10:47 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/pengine
Modified Files:
complex.c regression.sh unpack.c
Log Message:
Allow admin's to specify a role they want a resource to be in
Useful when you want the CRM to stop a resource and leave it that way.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/complex.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -3 -r1.76 -r1.77
--- complex.c 27 Mar 2006 05:44:24 -0000 1.76
+++ complex.c 3 Apr 2006 10:10:46 -0000 1.77
@@ -1,4 +1,4 @@
-/* $Id: complex.c,v 1.76 2006/03/27 05:44:24 andrew Exp $ */
+/* $Id: complex.c,v 1.77 2006/04/03 10:10:46 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -180,6 +180,7 @@
XML_RSC_ATTR_MASTER_NODEMAX,
XML_RSC_ATTR_STICKINESS,
XML_RSC_ATTR_FAIL_STICKINESS,
+ XML_RSC_ATTR_TARGET_ROLE,
};
const char *rsc_attrs[] = {
@@ -332,13 +333,27 @@
}
value = g_hash_table_lookup(
- (*rsc)->parameters, "resource_failure_stickiness");
+ (*rsc)->parameters, XML_RSC_ATTR_FAIL_STICKINESS);
if(value != NULL) {
(*rsc)->fail_stickiness = char2score(value);
}
crm_debug_2("\tNode score per failure: %d%s",
(*rsc)->fail_stickiness, value == NULL?" (default)":"");
+
+ value = g_hash_table_lookup(
+ (*rsc)->parameters, XML_RSC_ATTR_TARGET_ROLE);
+
+ if(value != NULL) {
+ (*rsc)->next_role = text2role(value);
+ if((*rsc)->next_role == RSC_ROLE_UNKNOWN) {
+ pe_config_err("%s: Unknown value for "
+ XML_RSC_ATTR_TARGET_ROLE": %s",
+ (*rsc)->id, value);
+ }
+ }
+ crm_debug_2("\tDesired next state: %s",
+
(*rsc)->next_role!=RSC_ROLE_UNKNOWN?role2text((*rsc)->next_role):"default");
crm_debug_2("\tNotification of start/stop actions: %s",
(*rsc)->notify?"required":"not required");
@@ -350,7 +365,8 @@
}
void
-order_actions(action_t *lh_action, action_t *rh_action, order_constraint_t
*order)
+order_actions(
+ action_t *lh_action, action_t *rh_action, order_constraint_t *order)
{
action_wrapper_t *wrapper = NULL;
GListPtr list = NULL;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/regression.sh,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -3 -r1.75 -r1.76
--- regression.sh 29 Mar 2006 08:01:04 -0000 1.75
+++ regression.sh 3 Apr 2006 10:10:46 -0000 1.76
@@ -21,8 +21,6 @@
create_mode="true"
echo Generating test outputs for these tests...
-#do_test master-1 "Stopped -> Promote"
-
echo ""
echo Done.
@@ -53,6 +51,9 @@
do_test orphan-0 "Orphan ignore"
do_test orphan-1 "Orphan stop"
+do_test target-0 "Target Role : baseline"
+do_test target-1 "Target Role : test"
+
echo ""
do_test master-0 "Stopped -> Slave"
do_test master-1 "Stopped -> Promote"
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/unpack.c,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -3 -r1.174 -r1.175
--- unpack.c 31 Mar 2006 12:45:02 -0000 1.174
+++ unpack.c 3 Apr 2006 10:10:46 -0000 1.175
@@ -1,4 +1,4 @@
-/* $Id: unpack.c,v 1.174 2006/03/31 12:45:02 andrew Exp $ */
+/* $Id: unpack.c,v 1.175 2006/04/03 10:10:46 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -246,12 +246,20 @@
}
value = crm_element_value(a_default, XML_NVPAIR_ATTR_VALUE);
+#if CRM_DEPRECATED_SINCE_2_0_1
if(value && hash) {
if(g_hash_table_lookup(hash, name) == NULL) {
g_hash_table_insert(
hash, crm_strdup(name), crm_strdup(value));
}
}
+#else
+ if(value != NULL) {
+ pe_config_err("Creating nvpair %s for %s directly beneath"
+ " <crm_config> has been depreciated since 2.0.1"
+ " and is now disabled", ID(a_default), name);
+ }
+#endif
return value;
}
@@ -911,6 +919,7 @@
{
int fail_count = 0;
char *fail_attr = NULL;
+ const char *value = NULL;
const char *fail_val = NULL;
gboolean delete_resource = FALSE;
@@ -966,6 +975,18 @@
op_list = g_list_append(op_list, rsc_op);
);
+ value = g_hash_table_lookup(rsc->parameters, XML_RSC_ATTR_TARGET_ROLE);
+ if(value != NULL) {
+ enum rsc_role_e req_role = text2role(value);
+ if(req_role != RSC_ROLE_UNKNOWN && req_role != rsc->next_role){
+ crm_debug("%s: Overwriting calculated next role %s"
+ " with requested next role %s",
+ rsc->id, role2text(rsc->next_role),
+ role2text(req_role));
+ rsc->next_role = req_role;
+ }
+ }
+
if(op_list != NULL) {
saved_role = rsc->role;
on_fail = action_fail_ignore;
@@ -1264,10 +1285,15 @@
if(interval == 0 && safe_str_eq(task, CRMD_ACTION_STATUS)) {
is_probe = TRUE;
+
+ } else if(interval > 0 && rsc->role < RSC_ROLE_STARTED) {
+ crm_debug_2("Ignoring pre-start recurring action");
+ return FALSE;
}
if(rsc->orphan) {
- crm_debug_2("Skipping param check for orphan: %s %s", rsc->id,
task);
+ crm_debug_2("Skipping param check for orphan: %s %s",
+ rsc->id, task);
} else if(safe_str_eq(task, CRMD_ACTION_STOP)) {
crm_debug_2("Ignoring stop params: %s", id);
@@ -1384,7 +1410,7 @@
}
}
#endif
-
+
if(EXECRA_NOT_RUNNING == actual_rc_i) {
if(is_probe) {
/* treat these like stops */
@@ -1405,7 +1431,7 @@
} else {
if(rsc->role != RSC_ROLE_MASTER) {
crm_err("%s reported %s in master mode on %s",
- task, rsc->graph_name,
+ id, rsc->graph_name,
node->details->uname);
}
------------------------------
Message: 2
Date: Mon, 3 Apr 2006 04:10:47 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : include
Dir : linux-ha/include/crm
Modified Files:
msg_xml.h
Log Message:
Allow admin's to specify a role they want a resource to be in
Useful when you want the CRM to stop a resource and leave it that way.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/msg_xml.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- msg_xml.h 31 Mar 2006 11:50:24 -0000 1.48
+++ msg_xml.h 3 Apr 2006 10:10:46 -0000 1.49
@@ -1,4 +1,4 @@
-/* $Id: msg_xml.h,v 1.48 2006/03/31 11:50:24 andrew Exp $ */
+/* $Id: msg_xml.h,v 1.49 2006/04/03 10:10:46 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -139,6 +139,7 @@
#define XML_RSC_ATTR_MASTER_NODEMAX "master_node_max"
#define XML_RSC_ATTR_STATE "clone_state"
#define XML_RSC_ATTR_MANAGED "is_managed"
+#define XML_RSC_ATTR_TARGET_ROLE "target_role"
#define XML_RSC_ATTR_UNIQUE "globally_unique"
#define XML_RSC_ATTR_NOTIFY "notify"
#define XML_RSC_ATTR_STICKINESS "resource_stickiness"
------------------------------
Message: 3
Date: Mon, 3 Apr 2006 04:40:39 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/pengine
Modified Files:
unpack.c utils.c
Log Message:
Complain a whole lot more about deprecated options
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/unpack.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -3 -r1.175 -r1.176
--- unpack.c 3 Apr 2006 10:10:46 -0000 1.175
+++ unpack.c 3 Apr 2006 10:40:39 -0000 1.176
@@ -1,4 +1,4 @@
-/* $Id: unpack.c,v 1.175 2006/04/03 10:10:46 andrew Exp $ */
+/* $Id: unpack.c,v 1.176 2006/04/03 10:40:39 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -82,13 +82,7 @@
gboolean
unpack_config(crm_data_t * config, pe_working_set_t *data_set)
{
-/* const char *attr_filter[] = { */
-/* "default_resource_stickiness", */
-/* "transition_idle_timeout", */
-/* "stonith_enabled", */
-/* "symmetric_cluster" */
-/* }; */
-
+ const char *name = NULL;
const char *value = NULL;
GHashTable *config_hash = g_hash_table_new_full(
g_str_hash,g_str_equal, g_hash_destroy_str,g_hash_destroy_str);
@@ -99,20 +93,27 @@
config, "cluster_property_set", NULL, config_hash,
NULL, 0, data_set);
+ xml_child_iter_filter(
+ config, a_child, XML_CIB_TAG_NVPAIR,
+
+ name = crm_element_value(a_child, XML_NVPAIR_ATTR_NAME);
+
#if CRM_DEPRECATED_SINCE_2_0_1
- param_value(config_hash, config, "transition_idle_timeout");
- param_value(config_hash, config, "default_resource_stickiness");
- param_value(config_hash, config, "default_resource_failure_stickiness");
- param_value(config_hash, config, "stonith_enabled");
- param_value(config_hash, config, "symmetric_cluster");
- param_value(config_hash, config, "no_quorum_policy");
- param_value(config_hash, config, "stop_orphan_resources");
- param_value(config_hash, config, "stop_orphan_actions");
- param_value(config_hash, config, "remove_after_stop");
- param_value(config_hash, config, "is_managed_default");
- param_value(config_hash, config, "short_resource_names");
- param_value(config_hash, config, "stonith_action");
+ value = crm_element_value(a_child, XML_NVPAIR_ATTR_VALUE);
+ if(g_hash_table_lookup(config_hash, name) == NULL) {
+ g_hash_table_insert(
+ config_hash,crm_strdup(name),crm_strdup(value));
+ }
+ pe_config_err("Creating <nvpair id=%s name=%s/> directly"
+ "beneath <crm_config> has been depreciated since"
+ " 2.0.1%s", ID(a_child), name);
+#else
+ pe_config_err("Creating <nvpair id=%s name=%s/> directly"
+ "beneath <crm_config> has been depreciated since"
+ " 2.0.1 and is now disabled", ID(a_child), name);
#endif
+ );
+
get_cluster_pref("transition_idle_timeout");
if(value != NULL) {
long tmp = crm_get_msec(value);
@@ -222,47 +223,6 @@
return TRUE;
}
-const char *
-param_value(GHashTable *hash, crm_data_t * parent, const char *name)
-{
- const char *value = NULL;
- const char *pref_name = NULL;
- crm_data_t * a_default = NULL;
-
- if(parent != NULL) {
- crm_validate_data(parent);
- xml_child_iter_filter(
- parent, a_child, XML_CIB_TAG_NVPAIR,
- pref_name = crm_element_value(a_child,
XML_NVPAIR_ATTR_NAME);
- if(safe_str_eq(name, pref_name)) {
- a_default = a_child;
- break;
- }
- );
- }
-
- if(a_default == NULL) {
- return NULL;
- }
-
- value = crm_element_value(a_default, XML_NVPAIR_ATTR_VALUE);
-#if CRM_DEPRECATED_SINCE_2_0_1
- if(value && hash) {
- if(g_hash_table_lookup(hash, name) == NULL) {
- g_hash_table_insert(
- hash, crm_strdup(name), crm_strdup(value));
- }
- }
-#else
- if(value != NULL) {
- pe_config_err("Creating nvpair %s for %s directly beneath"
- " <crm_config> has been depreciated since 2.0.1"
- " and is now disabled", ID(a_default), name);
- }
-#endif
- return value;
-}
-
gboolean
unpack_nodes(crm_data_t * xml_nodes, pe_working_set_t *data_set)
{
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/utils.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -3 -r1.128 -r1.129
--- utils.c 31 Mar 2006 12:05:37 -0000 1.128
+++ utils.c 3 Apr 2006 10:40:39 -0000 1.129
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.128 2006/03/31 12:05:37 andrew Exp $ */
+/* $Id: utils.c,v 1.129 2006/04/03 10:40:39 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -898,19 +898,25 @@
if(xml_obj != NULL) {
value = crm_element_value(xml_obj, "on_fail");
}
-#if CRM_DEPRECATED_SINCE_2_0_2
if(value == NULL && safe_str_eq(action->task, CRMD_ACTION_STOP)) {
value = g_hash_table_lookup(
action->rsc->parameters, "on_stopfail");
if(value != NULL) {
- crm_err("The \"on_stopfail\" attribute in %s is
deprecated",
- action->rsc->id);
- crm_err("Please use specify the \"on_fail\" attribute
on the"
- " \"stop\" operation instead");
-
+#if CRM_DEPRECATED_SINCE_2_0_2
+ pe_config_err("The \"on_stopfail\" attribute used in"
+ " %s has been deprecated since 2.0.2",
+ action->rsc->id);
+#else
+ pe_config_err("The \"on_stopfail\" attribute used in"
+ " %s has been deprecated since 2.0.2"
+ " and is now disabled", action->rsc->id);
+ value = NULL;
+#endif
+ pe_config_err("Please use specify the \"on_fail\""
+ " attribute on the \"stop\" operation"
+ " instead");
}
}
-#endif
if(value == NULL) {
} else if(safe_str_eq(value, "block")) {
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 29, Issue 7
*******************************************