cluster: RHEL6 - Revert "rgmanager: Support convalesce w/ central_processing"
Lon Hohberger
lon at fedoraproject.org
Thu Feb 3 16:23:20 UTC 2011
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=216c64116be3b5edad1ea7fcdcde298c67074b44
Commit: 216c64116be3b5edad1ea7fcdcde298c67074b44
Parent: b3e375c0554149173390b542de1ef3674da3d128
Author: Lon Hohberger <lhh at redhat.com>
AuthorDate: Wed Feb 2 20:17:45 2011 -0500
Committer: Lon Hohberger <lhh at redhat.com>
CommitterDate: Thu Feb 3 11:23:02 2011 -0500
Revert "rgmanager: Support convalesce w/ central_processing"
This reverts commit 3b03b46fe7d3c7d747db9a2b7721cc56aef458f2.
---
rgmanager/include/event.h | 1 -
rgmanager/src/daemons/service_op.c | 84 -----------------------
rgmanager/src/daemons/slang_event.c | 18 +-----
rgmanager/src/resources/default_event_script.sl | 4 -
4 files changed, 1 insertions(+), 106 deletions(-)
diff --git a/rgmanager/include/event.h b/rgmanager/include/event.h
index ad3fe39..a9a8235 100644
--- a/rgmanager/include/event.h
+++ b/rgmanager/include/event.h
@@ -124,7 +124,6 @@ void set_transition_throttling(int nsecs);
int service_op_start(char *svcName, int *target_list, int target_list_len,
int *new_owner);
int service_op_stop(char *svcName, int do_disable, int event_type);
-int service_op_convalesce(const char *svcName);
int service_op_migrate(char *svcName, int target_node);
diff --git a/rgmanager/src/daemons/service_op.c b/rgmanager/src/daemons/service_op.c
index f094129..112b267 100644
--- a/rgmanager/src/daemons/service_op.c
+++ b/rgmanager/src/daemons/service_op.c
@@ -186,90 +186,6 @@ service_op_stop(char *svcName, int do_disable, int event_type)
}
-int
-service_op_convalesce(const char *svcName)
-{
- SmMessageSt msg;
- int msg_ret;
- msgctx_t ctx;
- rg_state_t svcStatus;
- int msgtarget = my_id();
-
- /* Build the message header */
- msg.sm_hdr.gh_magic = GENERIC_HDR_MAGIC;
- msg.sm_hdr.gh_command = RG_ACTION_REQUEST;
- msg.sm_hdr.gh_arg1 = RG_ACTION_MASTER;
- msg.sm_hdr.gh_length = sizeof (SmMessageSt);
-
- msg.sm_data.d_action = RG_CONVALESCE;
-
- strncpy(msg.sm_data.d_svcName, svcName,
- sizeof(msg.sm_data.d_svcName));
- msg.sm_data.d_ret = 0;
- msg.sm_data.d_svcOwner = 0;
-
- /* Open a connection to the local node - it will decide what to
- do in this case. XXX inefficient; should queue requests
- locally and immediately forward requests otherwise */
-
- if (get_service_state_internal(svcName, &svcStatus) < 0)
- return RG_EFAIL;
- if (svcStatus.rs_owner > 0) {
- if (member_online(svcStatus.rs_owner)) {
- msgtarget = svcStatus.rs_owner;
- } else {
- /* If the owner is not online,
- mark the service as 'stopped' but
- otherwise, do nothing.
- */
- return svc_stop(svcName, RG_STOP);
- }
- }
-
- if (msg_open(MSG_CLUSTER, msgtarget, RG_PORT, &ctx, 2 * cluster_timeout)< 0) {
- logt_print(LOG_ERR,
- "#58: Failed opening connection to member #%d\n",
- my_id());
- return -1;
- }
-
- /* Encode */
- swab_SmMessageSt(&msg);
-
- /* Send stop message to the other node */
- if (msg_send(&ctx, &msg, sizeof (SmMessageSt)) <
- (int)sizeof (SmMessageSt)) {
- logt_print(LOG_ERR, "Failed to send complete message\n");
- msg_close(&ctx);
- return -1;
- }
-
- /* Check the response */
- do {
- msg_ret = msg_receive(&ctx, &msg,
- sizeof (SmMessageSt), 10);
- if ((msg_ret == -1 && errno != ETIMEDOUT) ||
- (msg_ret > 0)) {
- break;
- }
- } while(1);
-
- if (msg_ret != sizeof (SmMessageSt)) {
- logt_print(LOG_WARNING, "Strange response size: %d vs %d\n",
- msg_ret, (int)sizeof(SmMessageSt));
- return 0; /* XXX really UNKNOWN */
- }
-
- /* Got a valid response from other node. */
- msg_close(&ctx);
-
- /* Decode */
- swab_SmMessageSt(&msg);
-
- return msg.sm_data.d_ret;
-}
-
-
/*
service_op_migrate() - send a virtual machine to another host
in the cluster
diff --git a/rgmanager/src/daemons/slang_event.c b/rgmanager/src/daemons/slang_event.c
index 0b9f0d0..55f0341 100644
--- a/rgmanager/src/daemons/slang_event.c
+++ b/rgmanager/src/daemons/slang_event.c
@@ -86,8 +86,7 @@ static int
_user_restart = RG_RESTART,
_user_migrate = RG_MIGRATE,
_user_freeze = RG_FREEZE,
- _user_unfreeze = RG_UNFREEZE,
- _user_convalesce = RG_CONVALESCE;
+ _user_unfreeze = RG_UNFREEZE;
SLang_Intrin_Var_Type rgmanager_vars[] =
@@ -140,7 +139,6 @@ SLang_Intrin_Var_Type rgmanager_vars[] =
MAKE_VARIABLE((char *)"USER_MIGRATE", &_user_migrate, SLANG_INT_TYPE, 1),
MAKE_VARIABLE((char *)"USER_FREEZE", &_user_freeze, SLANG_INT_TYPE, 1),
MAKE_VARIABLE((char *)"USER_UNFREEZE", &_user_unfreeze,SLANG_INT_TYPE, 1),
- MAKE_VARIABLE((char *)"USER_CONVALESCE",&_user_convalesce,SLANG_INT_TYPE, 1),
/* Errors */
MAKE_VARIABLE((char *)"rg_error", &_rg_err, SLANG_INT_TYPE, 1),
@@ -446,18 +444,6 @@ sl_service_property(char *svcName, char *prop)
/**
usage:
- service_convalesce(name);
- */
-static int
-sl_convalesce_service(const char *svcname)
-{
- return service_op_convalesce(svcname);
-}
-
-
-/**
- usage:
-
stop_service(name, disable_flag);
*/
static int
@@ -1048,8 +1034,6 @@ static SLang_Intrin_Fun_Type rgmanager_slang[] =
SLANG_VOID_TYPE),
MAKE_INTRINSIC_0((char *)"service_stop", sl_stop_service,
SLANG_INT_TYPE),
- MAKE_INTRINSIC_S((char *)"service_convalesce", sl_convalesce_service,
- SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_start", sl_start_service,
SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_migrate", sl_migrate_service,
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index 4eae767..fad22ac 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -597,10 +597,6 @@ define default_user_event_handler()
ret = service_migrate(service_name, user_target);
- } else if (user_request == USER_CONVALESCE) {
-
- ret = service_convalesce(service_name);
-
}
return ret;
More information about the cluster-commits
mailing list