cluster/rgmanager ChangeLog TODO include/res-o ...
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: lhh at sourceware.org 2007-12-18 17:52:56
Modified files:
rgmanager : ChangeLog TODO
rgmanager/include: res-ocf.h resgroup.h reslist.h
restart_counter.h rg_locks.h rg_queue.h
rgmanager/src/clulib: Makefile members.c rg_strings.c vft.c rgmanager/src/daemons: Makefile fo_domain.c groups.c main.c
resrules.c rg_event.c rg_forward.c rg_state.c rg_thread.c test.c
rgmanager/src/resources: default_event_script.sl service.sh rgmanager/src/utils: clustat.c
Added files:
rgmanager : event-script.txt
rgmanager/include: ds.h event.h sets.h rgmanager/src/clulib: sets.c
rgmanager/src/daemons: event_config.c service_op.c slang_event.c
Log message:
Merge RIND 0.8.1 + bugfixes from HEAD to RHEL5 branch
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/event-script.txt.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/ChangeLog.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.31.2.31&r2=1.31.2.32
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/TODO.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8&r2=1.8.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/ds.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/event.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/sets.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/res-ocf.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.16.2&r2=1.1.16.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/resgroup.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.8&r2=1.15.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/reslist.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.7&r2=1.15.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/restart_counter.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/rg_locks.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/rg_queue.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/sets.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.10.2.3&r2=1.10.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/members.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/rg_strings.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.5&r2=1.5.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/vft.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.17.2.4&r2=1.17.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/event_config.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/service_op.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.2.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/slang_event.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.3.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.14.2.4&r2=1.14.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/fo_domain.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.11.2.1&r2=1.11.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/groups.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.25.2.13&r2=1.25.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.34.2.10&r2=1.34.2.11
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/resrules.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.16.2.8&r2=1.16.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_event.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_forward.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.3&r2=1.8.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_state.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.24.2.14&r2=1.24.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_thread.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.9&r2=1.15.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/test.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.6&r2=1.6.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/default_event_script.sl.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/service.sh.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.8&r2=1.7.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/utils/clustat.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.25.2.9&r2=1.25.2.10
/cvs/cluster/cluster/rgmanager/event-script.txt,v --> standard output revision 1.1.2.1
- renamed from rgmanager/event-script.txt +306 -0
@@ -0,0 +1,306 @@ +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); + +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/ChangeLog +5 -0
@@ -1,3 +1,8 @@ +2007-12-18 Lon Hohberger <[email protected]> + * Merge RIND 0.8.1 + bugfixes from head branch to RHEL5 + branch. Must be explicitly enabled by administrators in + cluster.conf. Migration (clusvcadm -M) not supported yet. + 2007-11-30 Lon Hohberger <[email protected]> * src/resources/clusterfs.sh: Retry mount up to 3 times to avoid race condition during another process mounting a GFS volume
rgmanager/TODO +0 -5
@@ -1,5 +0,0 @@ -* Make live-migration of resources work; preferrably so that admins -can manually migrate Xen VMs to other nodes without telling the cluster -about it. That is, the cluster should be able to acquire running VMs -and update its state accordingly. -* Test against a working Xen build and shake out bugs
/cvs/cluster/cluster/rgmanager/include/ds.h,v --> standard output revision 1.1.2.1
- renamed from rgmanager/include/ds.h +13 -0
@@ -0,0 +1,13 @@ +#ifndef _DS_H +#define _DS_H + +int ds_init(void); +int ds_key_init(char *keyid, int maxsize, int timeout); +int ds_key_finish(char *keyid); +int ds_write(char *keyid, void *buf, size_t maxlen); +int ds_read(char *keyid, void *buf, size_t maxlen); +int ds_finish(void); + +#define DS_MIN_SIZE 512 + +#endif
/cvs/cluster/cluster/rgmanager/include/event.h,v --> standard output revision 1.1.2.1
- renamed from rgmanager/include/event.h +145 -0
145 lines not on this page · raw message
/cvs/cluster/cluster/rgmanager/include/sets.h,v --> standard output revision 1.1.2.1
- renamed from rgmanager/include/sets.h +39 -0
@@ -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 int 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/include/res-ocf.h +1 -0
@@ -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_RECFNT_STR "OCF_RESKEY_RGMANAGER_meta_refcnt"/* LSB return codes
rgmanager/include/resgroup.h +23 -2
@@ -50,9 +50,16 @@#define RG_PORT 177 + +/* Constants moved to src/clulib/constants.c */ +/* DO NOT EDIT */ #define RG_MAGIC 0x11398fed#define RG_ACTION_REQUEST /* Message header */ 0x138582 +/* Argument to RG_ACTION_REQUEST */ +#define RG_ACTION_MASTER 0xfe0db143 +#define RG_ACTION_USER 0x3f173bfd +/* */ #define RG_EVENT 0x138583/* Requests */
@@ -109,6 +116,7 @@#define DEFAULT_CHECK_INTERVAL 10const char *rg_state_str (int val); +int rg_state_str_to_id (const char *val);const char *agent_op_str (int val);int eval_groups (int local,uint32_t nodeid,int nodeStatus);
@@ -118,19 +126,22 @@int group_op (char *rgname,int op);void rg_init (void ); -/* FOOM */ +/* Basic service operations */ int svc_start (char *svcName,int req);int svc_stop (char *svcName,int error);int svc_status (char *svcName); +int svc_status_inquiry (char *svcName);int svc_disable (char *svcName);int svc_fail (char *svcName);int svc_migrate (char *svcName,int target); +int check_restart (char *svcName); +int rt_enqueue_request (const char *resgroupname,int request,msgctx_t *resp_ctx,int max,uint32_t target,int arg0,int arg1);void send_response (int ret,int node,request_t *req); -void send_ret (msgctx_t *ctx,char *name,int ret,int req); +void send_ret (msgctx_t *ctx,char *name,int ret,int req,int newowner);/* do this op on all resource groups. The handler for the request will sort out whether or not it's a valid request given the state */
@@ -141,6 +152,7 @@/* from rg_state.c */ int set_rg_state (char *name,rg_state_t *svcblk);int get_rg_state (char *servicename,rg_state_t *svcblk); +int get_rg_state_local (char *servicename,rg_state_t *svcblk);uint32_t best_target_node (cluster_member_list_t *allowed,uint32_t owner,char *rg_name,int lock);
@@ -165,6 +177,14 @@int my_id (void );/* Return codes */ +#define RG_EEXCL -16/* Service not runnable due to +the fact that it is tagged +exclusive and there are no +empty nodes. */ +#define RG_EDOMAIN -15/* Service not runnable given the +set of nodes and its failover +domain */ +#define RG_ESCRIPT -14/* S/Lang script failed */ #define RG_EFENCE -13/* Fencing operation pending */ #define RG_ENODE -12/* Node is dead/nonexistent */ //#define RG_EFROZEN -11 /* Forward compat. with -HEAD */
@@ -182,6 +202,7 @@#define RG_YES 1#define RG_NO 2 +const char *rg_strerror (int val);
rgmanager/include/reslist.h +4 -1
@@ -139,7 +139,7 @@list_head ();char *fdn_name;int fdn_prio; -int _pad_;/* align */ +int fdn_nodeid;/* on rhel4 this will be 64-bit int */ } fod_node_t; typedef struct _fod {
@@ -202,6 +202,8 @@void print_domains (fod_t **domains);int node_should_start (int nodeid,cluster_member_list_t *membership,char *rg_name,fod_t **domains); +int node_domain_set (fod_t *domain,int **ret,int *retlen); +int node_domain_set_safe (char *domainname,int **ret,int *retlen,int *flags);/*
@@ -210,6 +212,7 @@resource_t *find_resource_by_ref (resource_t **reslist,char *type,char *ref);resource_t *find_root_by_ref (resource_t **reslist,char *ref);resource_rule_t *find_rule_by_type (resource_rule_t **rulelist,char *type); +void res_build_name (char *,size_t ,resource_t *);/* Internal functions; shouldn't be needed.
rgmanager/include/restart_counter.h +19 -0
@@ -1,3 +1,22 @@ +/* +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
rgmanager/include/rg_locks.h +17 -0
@@ -1,3 +1,20 @@ +/* +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_LOCKS_H#define __RG_LOCKS_H
rgmanager/include/rg_queue.h +20 -1
@@ -1,3 +1,20 @@ +/* +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>
@@ -19,7 +36,7 @@uint32_t rr_target;/** Target node */ uint32_t rr_arg0;/** Integer argument */ uint32_t rr_arg1;/** Integer argument */ -uint32_t rr_arg3;/** Integer argument */ +uint32_t rr_arg2;/** Integer argument */ uint32_t rr_line;/** Line no */ msgctx_t * rr_resp_ctx;/** FD to send response */ char *rr_file;/** Who made req */
@@ -42,5 +59,7 @@void rq_free (request_t *foo);void forward_request (request_t *req); +void forward_message (msgctx_t *ctx,void *msg,int nodeid); +#endif
/cvs/cluster/cluster/rgmanager/src/clulib/sets.c,v --> standard output revision 1.1.2.1
- renamed from rgmanager/src/clulib/sets.c +370 -0
370 lines not on this page · raw message
rgmanager/src/clulib/Makefile +1 -1
@@ -34,7 +34,7 @@ libclulib.a: clulog.o daemon_init.o signals.o msgsimple.o \ gettid.o rg_strings.o message.o members.o fdops.o \ lock.o cman.o vft.o msg_cluster.o msg_socket.o \ - wrap_lock.o tmgr.o + wrap_lock.o tmgr.o sets.o constants.o ${AR} cru $@ $^ ranlib $@
rgmanager/src/clulib/members.c +44 -0
50 lines not on this page · raw message
rgmanager/src/clulib/rg_strings.c +26 -0
@@ -26,6 +26,9 @@const struct string_val rg_error_strings[] = { + {RG_EEXCL ,"Service not runnable: cannot run exclusive" }, + {RG_EDOMAIN ,"Service not runnable: restricted failover domain offline" }, + {RG_ESCRIPT ,"S/Lang Script Error" }, {RG_EFENCE ,"Fencing operation pending; try again later" }, {RG_ENODE ,"Target node dead / nonexistent" }, {RG_ERUN ,"Service is already running" },
@@ -126,6 +129,21 @@ } +static inline int +rg_search_table_by_str (const struct string_val *table,const char *val) +{ +int x; + +for (x =0 ; table[x].str !=NULL ; x++) { +if (!strcasecmp (table[x].str, val)) +return table[x].val; + } + +return -1 ; +} + + +const char *rg_strerror (int val) {
@@ -139,6 +157,14 @@ } +int +rg_state_str_to_id (const char *val) +{ +return rg_search_table_by_str (rg_state_strings, val); +} + + +const char *rg_req_str (int val) {
rgmanager/src/clulib/vft.c +37 -40
92 lines not on this page · raw message
/cvs/cluster/cluster/rgmanager/src/daemons/event_config.c,v --> standard output revision 1.1.2.1
- renamed from rgmanager/src/daemons/event_config.c +541 -0
541 lines not on this page · raw message
/cvs/cluster/cluster/rgmanager/src/daemons/service_op.c,v --> standard output revision 1.2.2.1
- renamed from rgmanager/src/daemons/service_op.c +204 -0
204 lines not on this page · raw message
/cvs/cluster/cluster/rgmanager/src/daemons/slang_event.c,v --> standard output revision 1.3.2.1
- renamed from rgmanager/src/daemons/slang_event.c +1249 -0
993 lines not on this page · raw message
rgmanager/src/daemons/Makefile +11 -7
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/fo_domain.c +101 -2
103 lines not on this page · raw message
rgmanager/src/daemons/groups.c +185 -6
191 lines not on this page · raw message
rgmanager/src/daemons/main.c +81 -28
109 lines not on this page · raw message
rgmanager/src/daemons/resrules.c +1 -0
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/rg_event.c +514 -44
558 lines not on this page · raw message
rgmanager/src/daemons/rg_forward.c +131 -2
133 lines not on this page · raw message
rgmanager/src/daemons/rg_state.c +46 -20
66 lines not on this page · raw message
rgmanager/src/daemons/rg_thread.c +9 -3
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/test.c +9 -0
Lines of this file are not shown. View the raw message.
rgmanager/src/resources/default_event_script.sl +16 -1
Lines of this file are not shown. View the raw message.
rgmanager/src/resources/service.sh +2 -0
Lines of this file are not shown. View the raw message.
rgmanager/src/utils/clustat.c +2 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.