Skip to contentSkip to conversation

Cluster Project branch, RHEL4, updated. gfs-kernel_2_6_9_76-42-g69a3d82

Cluster-devel [email protected] 1 participant 1 message Apr 15, 2008

lore
Share & tools
lore
#0 lore raw

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=69a3d82a661d0c67dadfc0c02a6839c94ab0cdfb

The branch, RHEL4 has been updated

       via  69a3d82a661d0c67dadfc0c02a6839c94ab0cdfb (commit)
       via  24945860f4de6118437688aa3e4b7bb3e3edbbf0 (commit)
       via  070de9cc3db1a66d427a2aaaef0dbf71d4d404b9 (commit)
       via  179da28103b843845cad5eaec61a48855b5cf807 (commit)
       via  7c3f3ad887d460c2bd92a7a398048be58f1b4a07 (commit)
       via  d35287124adf15a981703c3e0785fa7c644223c1 (commit)
       via  fed6e7804f9b092b09a1d243abd03eb87747e566 (commit)
       via  71a51fb8ed4c91c5963665940afca5fc44f42559 (commit)
       via  652fe516bfa1efd5ceff9e1551e8dabc573e294d (commit)
       via  0d3a7a758217efbfec3a662269856a30d68fdd63 (commit)
       via  00a395dd63da4728c30b61a04a71224a4f05b82d (commit)
      from  5f03c06d964894819c182b5112af75e5ee44a256 (commit)

Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.

- Log ----------------------------------------------------------------- commit 69a3d82a661d0c67dadfc0c02a6839c94ab0cdfb

Author: Lon Hohberger <[email protected]>
Date:   Tue Apr 15 11:02:33 2008 -0400

[rgmanager] Fix several bugzillas (see below)

- 245381 - restart counter/thresholds before switching to relocation during service recovery
- 247772 - one service following another (event scripting ability). This isn't fixed in the usual way, as this feature has limited use. Instead, we allow an alternative method of operation for rgmanager in which administrators can define event triggers for whatever they would like. (Called "RIND")
- 247945 - rgmanager restarting services when noncritical parameters are changed
- 247980 - strong / weak service dependencies. These are trivial. Weak dependencies are only allowed with the event scripting as noted for 247772
- 250101 - RG event API (internals change). This was required for RIND to operate as well as 247980
- 439948 - clushutdown reference in clusvcadm man page
- 440006 - rgmanager stuck on stop in some cases
- 440645 - quotaoff causes hanges in some circumstances
- 441577 - Symlinks in mount point path cause erroneous failures

commit 24945860f4de6118437688aa3e4b7bb3e3edbbf0

Author: Lon Hohberger <[email protected]>
Date:   Tue Apr 8 00:32:04 2008 -0400

[rgmanager] Fix minor crash bug

commit 070de9cc3db1a66d427a2aaaef0dbf71d4d404b9

Author: Lon Hohberger <[email protected]>
Date:   Fri Apr 4 13:54:28 2008 -0400

[rgmanager] Fixes for RIND

commit 179da28103b843845cad5eaec61a48855b5cf807

Author: Lon Hohberger <[email protected]>
Date:   Fri Apr 4 11:20:09 2008 -0400

[rgmanager] More RIND merges.

commit 7c3f3ad887d460c2bd92a7a398048be58f1b4a07

Author: Lon Hohberger <[email protected]>
Date:   Tue Apr 1 16:25:08 2008 -0400

[rgmanager] Fix clusvcadm build

commit d35287124adf15a981703c3e0785fa7c644223c1

Author: Lon Hohberger <[email protected]>
Date:   Tue Apr 1 16:23:17 2008 -0400

[rgmanager] Fix build

commit fed6e7804f9b092b09a1d243abd03eb87747e566

Author: Lon Hohberger <[email protected]>
Date:   Tue Apr 1 16:22:15 2008 -0400

[rgmanager] Remove extraneous copy of event_script.txt

commit 71a51fb8ed4c91c5963665940afca5fc44f42559

Author: Lon Hohberger <[email protected]>
Date:   Tue Apr 1 16:17:55 2008 -0400

[rgmanager] Misc fixes. Update auto testing

commit 652fe516bfa1efd5ceff9e1551e8dabc573e294d

Author: Lon Hohberger <[email protected]>
Date:   Tue Apr 1 12:54:15 2008 -0400

[rgmanager] Make RIND build on RHEL4 branch

commit 0d3a7a758217efbfec3a662269856a30d68fdd63

Author: Lon Hohberger <[email protected]>
Date:   Mon Mar 10 09:58:08 2008 -0400

Merge, part 2

commit 00a395dd63da4728c30b61a04a71224a4f05b82d

Author: Lon Hohberger <[email protected]>
Date:   Mon Mar 10 09:56:40 2008 -0400

Commit phase 1 of update from rhel5 branch

-----------------------------------------------------------------------

Summary of changes:

 rgmanager/event-script.txt                         |  311 +++++
 rgmanager/include/clulog.h                         |    2 +-
 rgmanager/include/event.h                          |  147 +++
 rgmanager/include/res-ocf.h                        |   20 +
 rgmanager/include/resgroup.h                       |   60 +-
 rgmanager/include/reslist.h                        |   64 +-
 rgmanager/include/restart_counter.h                |   32 +
 rgmanager/include/rg_queue.h                       |   24 +-
 rgmanager/include/sets.h                           |   39 +
 rgmanager/man/clusvcadm.8                          |   13 +-
 rgmanager/src/clulib/Makefile                      |    3 +-
 rgmanager/src/clulib/rg_strings.c                  |  208 +++-
 rgmanager/src/clulib/sets.c                        |  370 ++++++
 rgmanager/src/clulib/signals.c                     |   18 +
 rgmanager/src/clulib/tmgr.c                        |  128 ++
 rgmanager/src/clulib/vft.c                         |   87 +-
 rgmanager/src/daemons/Makefile                     |   11 +-
 rgmanager/src/daemons/event_config.c               |  540 ++++++++
 rgmanager/src/daemons/fo_domain.c                  |  117 ++-
 rgmanager/src/daemons/groups.c                     |  575 ++++++++--
 rgmanager/src/daemons/main.c                       |  167 ++--
 rgmanager/src/daemons/members.c                    |   41 +
 rgmanager/src/daemons/reslist.c                    |   94 ++-
 rgmanager/src/daemons/resrules.c                   |  143 ++-
 rgmanager/src/daemons/restart_counter.c            |  205 ++++
 rgmanager/src/daemons/restree.c                    |  542 ++++-----
 rgmanager/src/daemons/rg_event.c                   |  500 ++++++++
 rgmanager/src/daemons/rg_forward.c                 |  110 ++
 rgmanager/src/daemons/rg_state.c                   |  427 +++++---
 rgmanager/src/daemons/rg_thread.c                  |    5 +
 rgmanager/src/daemons/service_op.c                 |  207 ++++
 rgmanager/src/daemons/slang_event.c                | 1286 ++++++++++++++++++++
 rgmanager/src/daemons/test.c                       |  101 ++-
 .../daemons/tests/delta-test001-test002.expected   |   34 +
 .../daemons/tests/delta-test002-test003.expected   |   48 +-
 .../daemons/tests/delta-test003-test004.expected   |   52 +-
 .../daemons/tests/delta-test004-test005.expected   |   53 +-
 .../daemons/tests/delta-test005-test006.expected   |   56 +-
 .../daemons/tests/delta-test006-test007.expected   |   56 +-
 .../daemons/tests/delta-test007-test008.expected   |   68 +-
 .../daemons/tests/delta-test008-test009.expected   |   89 +-
 .../daemons/tests/delta-test009-test010.expected   |   98 +-
 .../daemons/tests/delta-test010-test011.expected   |  135 ++-
 .../daemons/tests/delta-test011-test012.expected   |  157 ++-
 .../daemons/tests/delta-test012-test013.expected   |  160 ++-
 .../daemons/tests/delta-test013-test014.expected   |  224 +++--
 .../daemons/tests/delta-test014-test015.expected   |  264 +++--
 .../daemons/tests/delta-test015-test016.expected   |  256 +++--
 .../daemons/tests/delta-test016-test017.expected   |  309 ++++--
 .../daemons/tests/delta-test017-test018.expected   |  558 +++++++++
 rgmanager/src/daemons/tests/runtests.sh            |    6 +-
 rgmanager/src/daemons/tests/test001.expected       |   21 +
 rgmanager/src/daemons/tests/test002.expected       |   21 +
 rgmanager/src/daemons/tests/test003.expected       |   33 +-
 rgmanager/src/daemons/tests/test004.expected       |   33 +-
 rgmanager/src/daemons/tests/test005.expected       |   36 +-
 rgmanager/src/daemons/tests/test006.expected       |   36 +-
 rgmanager/src/daemons/tests/test007.expected       |   36 +-
 rgmanager/src/daemons/tests/test008.expected       |   52 +-
 rgmanager/src/daemons/tests/test009.expected       |   53 +-
 rgmanager/src/daemons/tests/test010.expected       |   63 +-
 rgmanager/src/daemons/tests/test011.expected       |   88 +-
 rgmanager/src/daemons/tests/test012.expected       |   89 +-
 rgmanager/src/daemons/tests/test013.expected       |   89 +-
 rgmanager/src/daemons/tests/test014.expected       |  147 ++-
 rgmanager/src/daemons/tests/test015.expected       |  147 ++-
 rgmanager/src/daemons/tests/test016.expected       |  147 ++-
 rgmanager/src/daemons/tests/test017.expected       |  176 ++-
 rgmanager/src/daemons/tests/test018.expected       |  291 +++++
 rgmanager/src/resources/Makefile                   |    9 +-
 rgmanager/src/resources/clusterfs.sh               |   61 +-
 rgmanager/src/resources/default_event_script.sl    |  314 +++++
 rgmanager/src/resources/fs.sh                      |   53 +-
 rgmanager/src/resources/netfs.sh                   |    2 +-
 rgmanager/src/resources/ocf-shellfuncs             |    4 +
 rgmanager/src/resources/script.sh                  |    2 +-
 rgmanager/src/resources/service.sh                 |  104 ++-
 rgmanager/src/resources/svclib_nfslock             |   28 +
 .../src/resources/utils/named-parse-config.pl      |   26 +
 rgmanager/src/resources/utils/ra-skelet.sh         |    2 +-
 rgmanager/src/utils/clusvcadm.c                    |   45 +-
 81 files changed, 9563 insertions(+), 1865 deletions(-)
 create mode 100644 rgmanager/event-script.txt
 create mode 100644 rgmanager/include/event.h
 create mode 100644 rgmanager/include/restart_counter.h
 create mode 100644 rgmanager/include/sets.h
 create mode 100644 rgmanager/src/clulib/sets.c
 create mode 100644 rgmanager/src/clulib/tmgr.c
 create mode 100644 rgmanager/src/daemons/event_config.c
 create mode 100644 rgmanager/src/daemons/restart_counter.c
 create mode 100644 rgmanager/src/daemons/rg_event.c
 create mode 100644 rgmanager/src/daemons/service_op.c
 create mode 100644 rgmanager/src/daemons/slang_event.c
 create mode 100644 rgmanager/src/daemons/tests/delta-test017-test018.expected
 create mode 100644 rgmanager/src/daemons/tests/test018.expected
 create mode 100644 rgmanager/src/resources/default_event_script.sl
 create mode 100644 rgmanager/src/resources/utils/named-parse-config.pl
rgmanager/event-script.txt new file +311 -0
new file mode 100644
index 0000000..00a8b4c
@@ -0,0 +1,311 @@
+TODO:
+* Return correct error codes to clusvcadm (currently it always returns
+  "Unknown")
+* Write glue for 'migrate' operations and migrate-enabled services
+
+Basic configuration specification:
+
+  <rm>
+    <events>
+      <event class="node"/>        <!-- all node events -->
+      <event class="node"
+             node="bar"/>     <!-- events concerning 'bar' -->
+      <event class="node"
+             node="foo"
+             node_state="up"/>     <!-- 'up' events for 'foo' -->
+      <event class="node"
+             node_id="3"
+             node_state="down"/>   <!-- 'down' events for node ID 3 -->
+
+          (note, all service ops and such deal with node ID, not
+           with node names)
+
+      <event class="service"/>     <!-- all service events-->
+      <event class="service"
+             service_name="A"/>    <!-- events concerning 'A' -->
+      <event class="service"
+             service_name="B"
+	     service_state="started"/> <!-- when 'B' is started... -->
+      <event class="service"
+             service_name="B"
+	     service_state="started"/>
+	     service_owner="3"/> <!-- when 'B' is started on node 3... -->
+
+      <event class="service"
+             priority="1"
+	     service_state="started"/>
+	     service_owner="3"/> <!-- when 'B' is started on node 3, do this
+				      before the other event handlers ... -->
+
+
+    </events>
+    ...
+  </rm>
+
+General globals available from all scripts:
+
+   node_self - local node ID
+   event_type - event class, either:
+       EVENT_NONE - unspecified / unknown
+       EVENT_NODE - node transition
+       EVENT_SERVICE - service transition
+       EVENT_USER - a user-generated request
+       EVENT_CONFIG - [NOT CONFIGURABLE]
+
+Node event globals (i.e. when event_type == EVENT_NODE):
+  
+   node_id - node ID which is transitioning
+   node_name - name of node which is transitioning
+   node_state - new node state (NODE_ONLINE or NODE_OFFLINE, or if you prefer,
+                1 or 0, respectively)
+   node_clean - 0 if the node has not been fenced, 1 if the node has been
+                fenced
+
+Service event globals (i.e. when event_type == EVENT_SERVICE):
+
+   service_name - Name of service which transitioned
+   service_state - new state of service
+   service_owner - new owner of service (or <0 if service is no longer
+		   running)
+   service_last_owner - Last owner of service if known.  Used for when
+                   service_state = "recovering" generally, in order to
+                   apply restart/relocate/disable policy.
+
+User event globals (i.e. when event_type == EVENT_USER):
+
+   service_name - service to perform request upon
+   user_request - request to perform (USER_ENABLE, USER_DISABLE,
+                   USER_STOP, USER_RELOCATE, [TODO] USER_MIGRATE)
+   user_target - target node ID if applicable
+
+
+Scripting functions - Informational:
+
+  node_list = nodes_online();
+
+	Returns a list of all online nodes.
+
+  service_list = service_list();
+
+	Returns a list of all configured services.
+
+  (restarts, last_owner, owner, state) = service_status(service_name);
+
+	Returns the state, owner, last_owner, and restarts.  Note that
+	all return values are optional, but are right-justified per S-Lang
+	specification.  This means if you only want the 'state', you can use:
+	
+	(state) = service_status(service_name);
+
+	However, if you need the restart count, you must provide all four 
+	return values as above.
+
+  (nofailback, restricted, ordered, node_list) =
+		service_domain_info(service_name);
+
+	Returns the failover domain specification, if it exists, for the
+	specified service name.  The node list returned is an ordered list
+	according to priority levels.  In the case of unordered domains, 
+	the ordering of the returned list is pseudo-random.
+
+Scripting functions - Operational:
+
+  err = service_start(service_name, node_list, [avoid_list]);
+
+	Start a non-running, (but runnable, i.e. not failed)
+	service on the first node in node_list.  Failing that, start it on
+	the second node in node_list and so forth.  One may also specify
+	an avoid list, but it's better to just use the subtract() function
+	below.  If the start is successful, the node ID running the service
+	is returned.  If the start is unsuccessful, a value < 0 is returned.
+
+  err = service_stop(service_name, [0 = stop, 1 = disable]);
+
+	Stop a running service.  The second parameter is optional, and if
+	non-zero is specified, the service will enter the disabled state.
+
+  ... stuff that's not done but needs to be:
+
+  err = service_relocate(service_name, node_list);
+
+	Move a running service to the specified node_list in order of
+	preference.  In the case of VMs, this is actually a migrate-or-
+	relocate operation.
+
+Utility functions - Node list manipulation
+
+  node_list = union(left_node_list, right_node_list);
+
+	Calculates the union between the two node list, removing duplicates
+	and preserving ordering according to left_node_list.  Any added
+	values from right_node_list will appear in their order, but
+	after left_node_list in the returned list.
+
+  node_list = intersection(left_node_list, right_node_list);
+
+	Calculates the intersection (items in both lists) between the two
+	node lists, removing duplicates and preserving ordering according
+	to left_node_list.  Any added values from right_node_list will
+	appear in their order, but after left_node_list in the returned list.
+
+  node_list = delta(left_node_list, right_node_list);
+
+	Calculates the delta (items not in both lists) between the two
+	node lists, removing duplicates and preserving ordering according
+	to left_node_list.  Any added values from right_node_list will
+	appear in their order, but after left_node_list in the returned list.
+
+  node_list = subtract(left_node_list, right_node_list);
+
+	Removes any duplicates as well as items specified in right_node_list
+	from left_node_list.  Example:
+
+	all_nodes = nodes_online();
+	allowed_nodes = subtract(nodes_online, node_to_avoid);
+
+  node_list = shuffle(node_list_old);
+
+	Rearranges the contents of node_list_old randomly and returns a
+	new node list.
+
+Utility functions - Logging:
+
+  debug(item1, item2, ...);	LOG_DEBUG level
+  info(...);			LOG_INFO level
+  notice(...);			LOG_NOTICE level
+  warning(...);			LOG_WARNING level
+  err(...);			LOG_ERR level
+  crit(...);			LOG_CRIT level
+  alert(...);			LOG_ALERT level
+  emerg(...);			LOG_EMERG level
+
+	items - These can be strings, integer lists, or integers.  Logging
+		string lists is not supported.
+
+	level - the level is consistent with syslog(8)
+
+  stop_processing();
+
+	Calling this function will prevent further event scripts from being
+	executed on a particular event.  Call this script if, for example,
+	you do not wish for the default event handler to process the event.
+
+	Note: This does NOT terminate the caller script; that is, the
+	script being executed will run to completion.
+
+Event scripts are written in a language called S-Lang; documentation specifics
+about the language are available@http://www.s-lang.org
+
+Example script (creating a follows-but-avoid-after-start behavior):
+%
+% If the main queue server and replication queue server are on the same
+% node, relocate the replication server somewhere else if possible.
+%
+define my_sap_event_trigger()
+{
+	variable state, owner_rep, owner_main;
+	variable nodes, allowed;
+
+	%
+	% If this was a service event, don't execute the default event
+	% script trigger after this script completes.
+	%
+	if (event_type == EVENT_SERVICE) {
+		stop_processing();
+	}
+
+	(owner_main, state) = service_status("service:main_queue");
+	(owner_rep, state) = service_status("service:replication_server");
+
+	if ((event_type == EVENT_NODE) and (owner_main == node_id) and
+	    (node_state == NODE_OFFLINE) and (owner_rep >= 0)) {
+		%
+		% uh oh, the owner of the main server died.  Restart it
+		% on the node running the replication server
+		%
+		notice("Starting Main Queue Server on node ", owner_rep);
+		()=service_start("service:main_queue", owner_rep);
+		return;
+	}
+
+	%
+	% S-Lang doesn't short-circuit prior to 2.1.0
+	%
+	if ((owner_main >= 0) and
+	    ((owner_main == owner_rep) or (owner_rep < 0))) {
+
+		%
+		% Get all online nodes
+		%
+		nodes = nodes_online();
+
+		%
+		% Drop out the owner of the main server
+		%
+		allowed = subtract(nodes, owner_main);
+		if ((owner_rep >= 0) and (length(allowed) == 0)) {
+			%
+			% Only one node is online and the rep server is
+			% already running.  Don't do anything else.
+			%
+			return;
+		}
+
+		if ((length(allowed) == 0) and (owner_rep < 0)) {
+			%
+			% Only node online is the owner ... go ahead
+			% and start it, even though it doesn't increase
+			% availability to do so.
+			%
+			allowed = owner_main;
+		}
+
+		%
+		% Move the replication server off the node that is
+		% running the main server if a node's available.
+		%
+		if (owner_rep >= 0) {
+			()=service_stop("service:replication_server");
+		}
+		()=service_start("service:replication_server", allowed);
+	}
+
+	return;
+}
+
+my_sap_event_trigger();
+
+
+Relevant <rm> section from cluster.conf:
+
+        <rm central_processing="1">
+                <events>
+                        <event name="main-start" class="service"
+				service="service:main_queue"
+				service_state="started"
+				file="/tmp/sap.sl"/>
+                        <event name="rep-start" class="service"
+				service="service:replication_server"
+				service_state="started"
+				file="/tmp/sap.sl"/>
+                        <event name="node-up" node_state="up"
+				class="node"
+				file="/tmp/sap.sl"/>
+
+                </events>
+                <failoverdomains>
+                        <failoverdomain name="all" ordered="1" restricted="1">
+                                <failoverdomainnode name="molly"
+priority="2"/>
+                                <failoverdomainnode name="frederick"
+priority="1"/>
+                        </failoverdomain>
+                </failoverdomains>
+                <resources/>
+                <service name="main_queue"/>
+                <service name="replication_server" autostart="0"/>
+		<!-- replication server is started when main-server start
+		     event completes -->
+        </rm>
+
+
rgmanager/include/clulog.h +1 -1
index 856d83c..e6b7ff8 100644
@@ -38,7 +38,7 @@ extern "C" {
 #include <syslog.h>
 #include <sys/types.h>
 
-#define LOGLEVEL_DFLT         LOG_INFO
+#define LOGLEVEL_DFLT         LOG_NOTICE
 #define MAX_LOGMSG_LEN        512
 
 /*
rgmanager/include/event.h new file +147 -0

147 lines not on this page · raw message

rgmanager/include/res-ocf.h +20 -0
index 4459b67..b55bf44 100644
@@ -31,6 +31,7 @@
 #define OCF_RESOURCE_INSTANCE_STR "OCF_RESOURCE_INSTANCE"
 #define OCF_CHECK_LEVEL_STR "OCF_CHECK_LEVEL"
 #define OCF_RESOURCE_TYPE_STR "OCF_RESOURCE_TYPE"
+#define OCF_REFCNT_STR "OCF_RESKEY_RGMANAGER_meta_refcnt"
 
 /*
    LSB return codes 
@@ -45,4 +46,23 @@
 #define OCF_RA_NOT_RUNNING	7
 #define OCF_RA_MAX		7
 
+/*
+      Resource operations - not ocf-specified
+ */
+#define RS_START	(0)
+#define RS_STOP		(1)
+#define RS_STATUS	(2)
+#define RS_RESINFO	(3)
+#define RS_RESTART	(4)
+#define RS_RELOAD	(5)
+#define RS_CONDRESTART  (6)
+#define	RS_RECOVER	(7)
+#define RS_CONDSTART	(8)	/** Start if flagged with RF_NEEDSTART */
+#define RS_CONDSTOP	(9)	/** STOP if flagged with RF_NEEDSTOP */
+#define RS_MONITOR	(10)
+#define RS_META_DATA	(11)
+#define RS_VALIDATE	(12)
+#define RS_MIGRATE	(13)
+#define RS_RECONFIG	(14)
+
 #endif
rgmanager/include/resgroup.h +47 -13

126 lines not on this page · raw message

rgmanager/include/reslist.h +31 -33

134 lines not on this page · raw message

rgmanager/include/restart_counter.h new file +32 -0
new file mode 100644
index 0000000..2f158ad
@@ -0,0 +1,32 @@
+/*
+  Copyright Red Hat, Inc. 2007
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License version 2 as published
+  by the Free Software Foundation.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; see the file COPYING.  If not, write to the
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  MA 02139, USA.
+*/
+/* Time-based restart counters for rgmanager */
+
+#ifndef _RESTART_COUNTER_H
+#define _RESTART_COUNTER_H
+
+typedef void *restart_counter_t;
+
+int restart_add(restart_counter_t arg);
+int restart_clear(restart_counter_t arg);
+int restart_count(restart_counter_t arg);
+int restart_treshold_exceeded(restart_counter_t arg);
+restart_counter_t restart_init(time_t expire_timeout, int max_restarts);
+int restart_cleanup(restart_counter_t arg);
+
+#endif
rgmanager/include/rg_queue.h +22 -2
index ac26ce8..d40793e 100644
@@ -1,9 +1,27 @@
+/*
+  Copyright Red Hat, Inc. 2004-2007
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License version 2 as published
+  by the Free Software Foundation.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; see the file COPYING.  If not, write to the
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  MA 02139, USA.
+*/
 #ifndef _RG_QUEUE_H
 #define _RG_QUEUE_H
 #include <list.h>
 #include <stdint.h>
 #include <sys/time.h>
 #include <unistd.h>
+#include <magmamsg.h>
 
 
 /** 
@@ -15,12 +33,12 @@ typedef struct _request {
 	uint32_t	rr_request;		/** Request */
 	uint32_t	rr_errorcode;		/** Error condition */
 	uint32_t	rr_orig_request;	/** Original request */
-	uint32_t	rr_resp_fd;		/** FD to send response */
 	uint64_t	rr_target;		/** Target node */
 	uint32_t	rr_arg0;		/** Integer argument */
 	uint32_t	rr_arg1;		/** Integer argument */
+	uint32_t	rr_arg2;		/** Integer argument */
 	uint32_t	rr_line;		/** Line no */
-	uint32_t	_pad_;			/** pad */
+	uint32_t	rr_resp_fd;		/** FD to send response */
 	char 		*rr_file;		/** Who made req */
 	time_t		rr_when;		/** time to execute */
 } request_t;
@@ -41,5 +59,7 @@ int rq_queue_empty(request_t **q);
 void rq_free(request_t *foo);
 
 void forward_request(request_t *req);
+void forward_message(int fd, void *msg, uint64_t nodeid);
+
 
 #endif
rgmanager/include/sets.h new file +39 -0
new file mode 100644
index 0000000..8cc271b
@@ -0,0 +1,39 @@
+/*
+  Copyright Red Hat, Inc. 2007
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License version 2 as published
+  by the Free Software Foundation.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; see the file COPYING.  If not, write to the
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  MA 02139, USA.
+*/
+/**
+ @file sets.h - Header file for sets.c
+ @author Lon Hohberger <[email protected]>
+ */
+#ifndef _SETS_H
+#define _SETS_H
+
+#include <stdint.h>
+typedef uint64_t set_type_t;
+
+int s_add(set_type_t *, int *, set_type_t);
+int s_union(set_type_t *, int, set_type_t *,
+	    int, set_type_t **, int *);
+
+int s_intersection(set_type_t *, int, set_type_t *,
+		   int, set_type_t **, int *);
+int s_delta(set_type_t *, int, set_type_t *,
+	    int, set_type_t **, int *);
+int s_subtract(set_type_t *, int, set_type_t *, int, set_type_t **, int *);
+int s_shuffle(set_type_t *, int);
+
+#endif
rgmanager/man/clusvcadm.8 +4 -9
index dcc5691..20ae823 100644
@@ -49,12 +49,8 @@ service
 Lock the local resource group manager.  This should only be used if the 
 administrator intends to perform a global, cluster-wide shutdown.  This
 prevents starting resource groups on the local node, allowing 
-services will not fail over during the shutdown of the cluster.  Generally,
-administrators should use the
-.B
-clushutdown(8)
-command to accomplish this.  Once the cluster quorum is dissolved, this
-state is reset.
+services will not fail over during the shutdown of the cluster.
+Once the cluster quorum is dissolved, this state is reset.
 .IP "\-m <member>"
 When used in conjunction with either the
 .B
@@ -88,11 +84,10 @@ service
 until a member transition or until it is enabled again.
 .IP \-u
 Unlock the cluster's service managers.  This allows services to transition
-again.  It will be necessary to re-enable all services in the stopped state
-if this is run after \fB clushutdown(8)\fR.
+again. 
 
 .IP \-v
 Display version information and exit.
 
 .SH "SEE ALSO"
-clustat(8), clushutdown(8)
+clustat(8)
rgmanager/src/clulib/Makefile +2 -1
index 343c2e9..5531e82 100644
@@ -30,7 +30,8 @@ install: all
 uninstall:
 
 libclulib.a: clulog.o daemon_init.o signals.o msgsimple.o \
-		vft.o gettid.o rg_strings.o wrap_lock.o
+		vft.o gettid.o rg_strings.o wrap_lock.o \
+		sets.o
 	${AR} cru $@ $^
 	ranlib $@
 
rgmanager/src/clulib/rg_strings.c +176 -32

211 lines not on this page · raw message

rgmanager/src/clulib/sets.c new file +370 -0

370 lines not on this page · raw message

rgmanager/src/clulib/signals.c +18 -0
index 1d49ee5..fa9f4a6 100644
@@ -1,3 +1,21 @@
+/*
+  Copyright Red Hat, Inc. 2003-2006
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; see the file COPYING.  If not, write to the
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  MA 02139, USA.
+*/
 #include <signal.h>
 #include <stdlib.h>
 #include <string.h>
rgmanager/src/clulib/tmgr.c new file +128 -0

128 lines not on this page · raw message

rgmanager/src/clulib/vft.c +52 -35

170 lines not on this page · raw message

rgmanager/src/daemons/Makefile +7 -4
index f4413b7..55b37d5 100644
@@ -17,12 +17,13 @@ include ${top_srcdir}/make/defines.mk
 INCLUDE += -I $(top_srcdir)/include
 
 CFLAGS+= -g -I${incdir} -I/usr/include/libxml2 -L${libdir}
+CFLAGS+= -I/usr/include/slang
 
 CFLAGS+= -g -Wstrict-prototypes -Wshadow -fPIC -D_GNU_SOURCE
 
 CFLAGS+= -L ../clulib 
 
-LDFLAGS+= -lclulib -lxml2 -lmagmamsg -lmagma -lpthread -ldl
+LDFLAGS+= -lclulib -lxml2 -lmagmamsg -lmagma -lpthread -ldl -lslang
 TARGETS=clurgmgrd clurmtabd rg_test
 
 all: ${TARGETS}
@@ -40,8 +41,9 @@ uninstall:
 
 clurgmgrd: rg_thread.o rg_locks.o main.o groups.o rg_state.o \
 		rg_queue.o members.o rg_forward.o reslist.o \
-		resrules.o restree.o fo_domain.o nodeevent.o \
-		watchdog.o
+		resrules.o restree.o fo_domain.o \
+		watchdog.o restart_counter.o event_config.o \
+		slang_event.o rg_event.o service_op.o
 	$(CC) -o $@ $^ $(INCLUDE) $(CFLAGS) $(LDFLAGS) -lccs
 
 #
@@ -59,7 +61,8 @@ clurgmgrd: rg_thread.o rg_locks.o main.o groups.o rg_state.o \
 # packages should run 'make check' as part of the build process.
 #
 rg_test: rg_locks-noccs.o test-noccs.o reslist-noccs.o \
-		resrules-noccs.o restree-noccs.o fo_domain-noccs.o
+		resrules-noccs.o restree-noccs.o fo_domain-noccs.o \
+		event_config-noccs.o restart_counter.o
 	$(CC) -o $@ $^ $(INCLUDE) $(CFLAGS) -llalloc $(LDFLAGS)
 
 clurmtabd: clurmtabd.o clurmtabd_lib.o
rgmanager/src/daemons/event_config.c new file +540 -0

540 lines not on this page · raw message

rgmanager/src/daemons/fo_domain.c +109 -8

189 lines not on this page · raw message

rgmanager/src/daemons/groups.c +495 -80

426 lines not on this page · raw message

rgmanager/src/daemons/main.c +94 -73

167 lines not on this page · raw message

rgmanager/src/daemons/members.c +41 -0

41 lines not on this page · raw message

rgmanager/src/daemons/reslist.c +75 -19

94 lines not on this page · raw message

rgmanager/src/daemons/resrules.c +108 -35

143 lines not on this page · raw message

rgmanager/src/daemons/restart_counter.c new file +205 -0

205 lines not on this page · raw message

rgmanager/src/daemons/restree.c +240 -302

542 lines not on this page · raw message

rgmanager/src/daemons/rg_event.c new file +500 -0

500 lines not on this page · raw message

rgmanager/src/daemons/rg_forward.c +110 -0

110 lines not on this page · raw message

rgmanager/src/daemons/rg_state.c +286 -141

427 lines not on this page · raw message

rgmanager/src/daemons/rg_thread.c +5 -0
index 0e7750d..e96982b 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/service_op.c new file +207 -0

207 lines not on this page · raw message

rgmanager/src/daemons/slang_event.c new file +1286 -0

1,286 lines not on this page · raw message

rgmanager/src/daemons/test.c +95 -6

101 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test001-test002.expected +34 -0
index 030c5c9..34eaf37 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/delta-test002-test003.expected +42 -6

48 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test003-test004.expected +45 -7

52 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test004-test005.expected +45 -8

53 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test005-test006.expected +48 -8

56 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test006-test007.expected +48 -8

56 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test007-test008.expected +52 -16

68 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test008-test009.expected +64 -25

89 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test009-test010.expected +68 -30

98 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test010-test011.expected +90 -45

135 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test011-test012.expected +102 -55

157 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test012-test013.expected +105 -55

160 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test013-test014.expected +150 -74

224 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test014-test015.expected +181 -83

264 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test015-test016.expected +173 -83

256 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test016-test017.expected +212 -97

309 lines not on this page · raw message

rgmanager/src/daemons/tests/delta-test017-test018.expected new file +558 -0

558 lines not on this page · raw message

rgmanager/src/daemons/tests/runtests.sh +3 -3
index 3fa0c5b..76b548b 100755

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/test001.expected +21 -0
index bc080ad..43d90e8 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/test002.expected +21 -0
index b21c247..09b160f 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/test003.expected +27 -6
index 0ff5d58..b39a24e 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/test004.expected +27 -6
index 334cc12..bc2a264 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/test005.expected +29 -7
index eea6f20..b05749a 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/test006.expected +29 -7
index 71714d8..2b77f91 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/test007.expected +29 -7
index 243f89f..ea4bcf1 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/daemons/tests/test008.expected +37 -15

52 lines not on this page · raw message

rgmanager/src/daemons/tests/test009.expected +38 -15

53 lines not on this page · raw message

rgmanager/src/daemons/tests/test010.expected +43 -20

63 lines not on this page · raw message

rgmanager/src/daemons/tests/test011.expected +57 -31

88 lines not on this page · raw message

rgmanager/src/daemons/tests/test012.expected +58 -31

89 lines not on this page · raw message

rgmanager/src/daemons/tests/test013.expected +58 -31

89 lines not on this page · raw message

rgmanager/src/daemons/tests/test014.expected +98 -49

147 lines not on this page · raw message

rgmanager/src/daemons/tests/test015.expected +98 -49

147 lines not on this page · raw message

rgmanager/src/daemons/tests/test016.expected +98 -49

147 lines not on this page · raw message

rgmanager/src/daemons/tests/test017.expected +113 -63

176 lines not on this page · raw message

rgmanager/src/daemons/tests/test018.expected new file +291 -0

291 lines not on this page · raw message

rgmanager/src/resources/Makefile +7 -2
index d543468..c1f4a71 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/resources/clusterfs.sh +41 -20

61 lines not on this page · raw message

rgmanager/src/resources/default_event_script.sl new file +314 -0

314 lines not on this page · raw message

rgmanager/src/resources/fs.sh +39 -14

53 lines not on this page · raw message

rgmanager/src/resources/netfs.sh +1 -1
index 15759bf..c683ee6 100755

Lines of this file are not shown. View the raw message.

rgmanager/src/resources/ocf-shellfuncs +4 -0
index eb0147f..98156c0 100755

Lines of this file are not shown. View the raw message.

rgmanager/src/resources/script.sh +1 -1
index 9a9455c..0141c80 100755

Lines of this file are not shown. View the raw message.

rgmanager/src/resources/service.sh +90 -14

104 lines not on this page · raw message

rgmanager/src/resources/svclib_nfslock +28 -0
index de996b1..2101e1e 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/resources/utils/named-parse-config.pl new file +26 -0
new file mode 100644
index 0000000..4ac39c3

Lines of this file are not shown. View the raw message.

rgmanager/src/resources/utils/ra-skelet.sh +1 -1
index 67630e2..5530ae6 100644

Lines of this file are not shown. View the raw message.

rgmanager/src/utils/clusvcadm.c +16 -29

45 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

hooks/post-receive
--
Cluster Project

Part of the diff is not shown here. View the raw message.