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: lib by andrew from
([email protected])
2. Linux-HA CVS: crm by andrew from
([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 26 Jan 2006 03:24:06 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/crm/cib
Modified Files:
cib_client.c cib_native.c
Log Message:
Most transient clients connect, make a blocking call and exit.
Optimize this sequence of events to speed up the CIB a little.
Periodically dump some stats about what the CIB has been doing.
Number of queries, local vs. forwarded, updates vs. queries, passed vs. failed
Fix for a segfault - bug 1051 (a recent bad cleanup introduced it)
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/cib/cib_client.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- cib_client.c 25 Oct 2005 14:02:14 -0000 1.47
+++ cib_client.c 26 Jan 2006 10:24:06 -0000 1.48
@@ -662,6 +662,9 @@
case cib_msg_field_add:
error_msg = "failed adding field to cib message";
break;
+ case cib_id_check:
+ error_msg = "id-collision detected";
+ break;
case cib_operation:
error_msg = "invalid operation";
break;
@@ -910,7 +913,6 @@
return 0;
}
-
crm_data_t*
get_cib_copy(cib_t *cib)
{
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/cib/cib_native.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -3 -r1.51 -r1.52
--- cib_native.c 16 Jan 2006 09:21:44 -0000 1.51
+++ cib_native.c 26 Jan 2006 10:24:06 -0000 1.52
@@ -114,10 +114,23 @@
native->command_channel = init_client_ipc_comms_nodispatch(
cib_channel_rw);
- } else {
+ } else if(type == cib_query) {
cib->state = cib_connected_query;
native->command_channel = init_client_ipc_comms_nodispatch(
cib_channel_ro);
+
+ } else if(type == cib_query_synchronous) {
+ cib->state = cib_connected_query;
+ native->command_channel = init_client_ipc_comms_nodispatch(
+ cib_channel_ro_synchronous);
+
+ } else if(type == cib_command_synchronous) {
+ cib->state = cib_connected_query;
+ native->command_channel = init_client_ipc_comms_nodispatch(
+ cib_channel_rw_synchronous);
+
+ } else {
+ return cib_not_connected;
}
if(native->command_channel == NULL) {
@@ -130,6 +143,9 @@
rc = cib_authentication;
}
+ if(type == cib_query_synchronous || type == cib_command_synchronous) {
+ return rc;
+ }
if(rc == cib_ok) {
crm_debug_4("Connecting callback channel");
@@ -315,39 +331,21 @@
return ch->ops->get_recv_select_fd(ch);
}
-int
-cib_native_perform_op(
- cib_t *cib, const char *op, const char *host, const char *section,
- crm_data_t *data, crm_data_t **output_data, int call_options)
+static HA_Message *
+cib_create_op(
+ int call_id, const char *op, const char *host, const char *section,
+ crm_data_t *data, int call_options)
{
int rc = HA_OK;
-
- struct ha_msg *op_msg = NULL;
- struct ha_msg *op_reply = NULL;
-
- cib_native_opaque_t *native = cib->variant_opaque;
-
- if(cib->state == cib_disconnected) {
- return cib_not_connected;
- }
-
- if(output_data != NULL) {
- *output_data = NULL;
- }
-
- if(op == NULL) {
- crm_err("No operation specified");
- rc = cib_operation;
- }
-
+ HA_Message *op_msg = NULL;
op_msg = ha_msg_new(8);
if (op_msg == NULL) {
crm_err("No memory to create HA_Message");
- return cib_create_msg;
+ return NULL;
}
if(rc == HA_OK) {
- rc = ha_msg_add(op_msg, F_TYPE, "cib");
+ rc = ha_msg_add(op_msg, F_TYPE, T_CIB);
}
if(rc == HA_OK) {
rc = ha_msg_add(op_msg, F_CIB_OPERATION, op);
@@ -359,17 +357,18 @@
rc = ha_msg_add(op_msg, F_CIB_SECTION, section);
}
if(rc == HA_OK) {
- rc = ha_msg_add_int(op_msg, F_CIB_CALLID, cib->call_id);
+ rc = ha_msg_add_int(op_msg, F_CIB_CALLID, call_id);
}
if(rc == HA_OK) {
crm_debug_4("Sending call options: %.8lx, %d",
(long)call_options, call_options);
rc = ha_msg_add_int(op_msg, F_CIB_CALLOPTS, call_options);
}
+#if 0
if(rc == HA_OK && cib->call_timeout > 0) {
rc = ha_msg_add_int(op_msg, F_CIB_TIMEOUT, cib->call_timeout);
}
-
+#endif
if(rc == HA_OK && data != NULL) {
const char *tag = crm_element_name(data);
crm_data_t *cib = data;
@@ -395,13 +394,48 @@
crm_err("Failed to create CIB operation message");
crm_log_message(LOG_ERR, op_msg);
crm_msg_del(op_msg);
- return cib_create_msg;
+ return NULL;
}
if(call_options & cib_inhibit_bcast) {
CRM_DEV_ASSERT((call_options & cib_scope_local));
}
+ return op_msg;
+}
+int
+cib_native_perform_op(
+ cib_t *cib, const char *op, const char *host, const char *section,
+ crm_data_t *data, crm_data_t **output_data, int call_options)
+{
+ int rc = HA_OK;
+
+ struct ha_msg *op_msg = NULL;
+ struct ha_msg *op_reply = NULL;
+
+ cib_native_opaque_t *native = cib->variant_opaque;
+
+ if(cib->state == cib_disconnected) {
+ return cib_not_connected;
+ }
+
+ if(output_data != NULL) {
+ *output_data = NULL;
+ }
+
+ if(op == NULL) {
+ crm_err("No operation specified");
+ rc = cib_operation;
+ }
+
+ if(rc == HA_OK) {
+ op_msg = cib_create_op(
+ cib->call_id, op, host, section, data, call_options);
+ if(op_msg == NULL) {
+ rc = cib_create_msg;
+ }
+ }
+
cib->call_id++;
/* prevent call_id from being negative (or zero) and conflicting
* with the cib_errors enum
------------------------------
Message: 2
Date: Thu, 26 Jan 2006 04:29:23 -0700 (MST)
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/cib
Modified Files:
messages.c
Log Message:
Include the config section... duh
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/messages.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- messages.c 26 Jan 2006 10:05:15 -0000 1.62
+++ messages.c 26 Jan 2006 11:29:22 -0000 1.63
@@ -1,4 +1,4 @@
-/* $Id: messages.c,v 1.62 2006/01/26 10:05:15 andrew Exp $ */
+/* $Id: messages.c,v 1.63 2006/01/26 11:29:22 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -663,37 +663,30 @@
/* make changes to a temp copy then activate */
if(section == NULL) {
- crm_data_t *sub_input = NULL;
+ int lpc = 0;
const char *type = NULL;
- copy_in_properties(*result_cib, input);
+ crm_data_t *sub_input = NULL;
+
/* order is no longer important here */
- if(result == cib_ok) {
- type = XML_CIB_TAG_NODES;
- sub_input = get_object_root(type, input);
- result = updateList(
- *result_cib, sub_input, failed, cib_update_op,
- type);
- }
- if(result == cib_ok) {
- type = XML_CIB_TAG_RESOURCES;
- sub_input = get_object_root(type, input);
- result = updateList(
- *result_cib, sub_input, failed, cib_update_op,
- type);
- }
- if(result == cib_ok) {
- type = XML_CIB_TAG_CONSTRAINTS;
- sub_input = get_object_root(type, input);
- result = updateList(
- *result_cib, sub_input, failed, cib_update_op,
- type);
- }
- if(result == cib_ok) {
- type = XML_CIB_TAG_STATUS;
- sub_input = get_object_root(type, input);
- result = updateList(
- *result_cib, sub_input, failed, cib_update_op,
- type);
+ const char *type_list[] = {
+ XML_CIB_TAG_NODES,
+ XML_CIB_TAG_CONSTRAINTS,
+ XML_CIB_TAG_RESOURCES,
+ XML_CIB_TAG_STATUS,
+ XML_CIB_TAG_CRMCONFIG
+ };
+
+ copy_in_properties(*result_cib, input);
+ for(lpc = 0; lpc < DIMOF(type_list); lpc++) {
+ type = type_list[lpc];
+
+ if(result == cib_ok) {
+ crm_debug_2("Processing section=%s", type);
+ sub_input = get_object_root(type, input);
+ result = updateList(
+ *result_cib, sub_input, failed,
+ cib_update_op, type);
+ }
}
} else {
------------------------------
Message: 3
Date: Thu, 26 Jan 2006 04:36:58 -0700 (MST)
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:
ptest.c
Log Message:
Switch a number of CLI tools to use the new syncronous connections
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/ptest.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- ptest.c 11 Jan 2006 12:47:55 -0000 1.69
+++ ptest.c 26 Jan 2006 11:36:58 -0000 1.70
@@ -1,4 +1,4 @@
-/* $Id: ptest.c,v 1.69 2006/01/11 12:47:55 andrew Exp $ */
+/* $Id: ptest.c,v 1.70 2006/01/26 11:36:58 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -210,7 +210,7 @@
int rc = cib_ok;
cib_conn = cib_new();
rc = cib_conn->cmds->signon(
- cib_conn, "ptest", cib_command);
+ cib_conn, "ptest", cib_command_synchronous);
if(rc == cib_ok) {
crm_info("Reading XML from: live cluster");
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 26, Issue 58
********************************************