[PATCH 8/9] votequorum: drop votequorum_leave

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

this was a compatibility function for cman_tool only.

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
:100644 100644 e17aeb6... 448edc3... M	include/corosync/ipc_votequorum.h
:100644 100644 8e1cb84... 45ffddc... M	include/corosync/votequorum.h
:100644 100644 1746845... c18a64a... M	lib/libvotequorum.versions
:100644 100644 240ada2... 21468fe... M	lib/votequorum.c
:100644 100644 fe4ea6b... 5b75297... M	man/Makefile.am
:100644 100644 2ee5473... 4c779ec... M	man/index.html
:100644 000000 ad7bda4... 0000000... D	man/votequorum_leaving.3
:100644 100644 6ab64fc... a27f07d... M	services/votequorum.c
 include/corosync/ipc_votequorum.h |    1 -
 include/corosync/votequorum.h     |    6 ---
 lib/libvotequorum.versions        |    1 -
 lib/votequorum.c                  |   40 ---------------------
 man/Makefile.am                   |    1 -
 man/index.html                    |    4 --
 man/votequorum_leaving.3          |   67 -----------------------------------
 services/votequorum.c             |   69 +------------------------------------
 8 files changed, 1 insertions(+), 188 deletions(-)

diff --git a/include/corosync/ipc_votequorum.h b/include/corosync/ipc_votequorum.h
index e17aeb6..448edc3 100644
--- a/include/corosync/ipc_votequorum.h
+++ b/include/corosync/ipc_votequorum.h
@@ -47,7 +47,6 @@ enum req_votequorum_types {
 	MESSAGE_REQ_VOTEQUORUM_QDISK_UNREGISTER,
 	MESSAGE_REQ_VOTEQUORUM_QDISK_POLL,
 	MESSAGE_REQ_VOTEQUORUM_QDISK_GETINFO,
-	MESSAGE_REQ_VOTEQUORUM_LEAVING,
 	MESSAGE_REQ_VOTEQUORUM_TRACKSTART,
 	MESSAGE_REQ_VOTEQUORUM_TRACKSTOP
 };
diff --git a/include/corosync/votequorum.h b/include/corosync/votequorum.h
index 8e1cb84..45ffddc 100644
--- a/include/corosync/votequorum.h
+++ b/include/corosync/votequorum.h
@@ -195,12 +195,6 @@ cs_error_t votequorum_trackstop (
 	votequorum_handle_t handle);
 
 /**
- * Set our LEAVING flag. we should exit soon after this
- */
-cs_error_t votequorum_leaving (
-	votequorum_handle_t handle);
-
-/**
  * Save and retrieve private data/context
  */
 cs_error_t votequorum_context_get (
diff --git a/lib/libvotequorum.versions b/lib/libvotequorum.versions
index 1746845..c18a64a 100644
--- a/lib/libvotequorum.versions
+++ b/lib/libvotequorum.versions
@@ -11,7 +11,6 @@ COROSYNC_VOTEQUORUM_1.0 {
 		votequorum_qdisk_unregister;
 		votequorum_qdisk_poll;
 		votequorum_qdisk_getinfo;
-		votequorum_leaving;
 		votequorum_trackstart;
 		votequorum_trackstop;
 		votequorum_context_get;
diff --git a/lib/votequorum.c b/lib/votequorum.c
index 240ada2..21468fe 100644
--- a/lib/votequorum.c
+++ b/lib/votequorum.c
@@ -448,46 +448,6 @@ error_exit:
 	return (error);
 }
 
-cs_error_t votequorum_leaving (
-	votequorum_handle_t handle)
-{
-	cs_error_t error;
-	struct votequorum_inst *votequorum_inst;
-	struct iovec iov;
-	struct req_lib_votequorum_general req_lib_votequorum_general;
-	struct res_lib_votequorum_status res_lib_votequorum_status;
-
-	error = hdb_error_to_cs(hdb_handle_get (&votequorum_handle_t_db, handle, (void *)&votequorum_inst));
-	if (error != CS_OK) {
-		return (error);
-	}
-
-
-	req_lib_votequorum_general.header.size = sizeof (struct req_lib_votequorum_general);
-	req_lib_votequorum_general.header.id = MESSAGE_REQ_VOTEQUORUM_LEAVING;
-
-	iov.iov_base = (char *)&req_lib_votequorum_general;
-	iov.iov_len = sizeof (struct req_lib_votequorum_general);
-
-        error = qb_to_cs_error(qb_ipcc_sendv_recv (
-		votequorum_inst->c,
-		&iov,
-		1,
-                &res_lib_votequorum_status,
-		sizeof (struct res_lib_votequorum_status), CS_IPC_TIMEOUT_MS));
-
-	if (error != CS_OK) {
-		goto error_exit;
-	}
-
-	error = res_lib_votequorum_status.header.error;
-
-error_exit:
-	hdb_handle_put (&votequorum_handle_t_db, handle);
-
-	return (error);
-}
-
 cs_error_t votequorum_trackstart (
 	votequorum_handle_t handle,
 	uint64_t context,
diff --git a/man/Makefile.am b/man/Makefile.am
index fe4ea6b..5b75297 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -101,7 +101,6 @@ dist_man_MANS = \
 	votequorum_finalize.3 \
 	votequorum_getinfo.3 \
 	votequorum_initialize.3 \
-	votequorum_leaving.3 \
 	votequorum_qdisk_getinfo.3 \
 	votequorum_qdisk_poll.3 \
 	votequorum_qdisk_register.3 \
diff --git a/man/index.html b/man/index.html
index 2ee5473..4c779ec 100644
--- a/man/index.html
+++ b/man/index.html
@@ -190,10 +190,6 @@
       Description of the votequorum interface.
       <br>
 
-      <a href="votequorum_leaving.3.html">votequorum_leaving(3)</a>:
-      Description of the votequorum interface.
-      <br>
-
       <a href="votequorum_setexpected.3.html">votequorum_setexpected(3)</a>:
       Description of the votequorum interface.
       <br>
diff --git a/man/votequorum_leaving.3 b/man/votequorum_leaving.3
deleted file mode 100644
index ad7bda4..0000000
--- a/man/votequorum_leaving.3
+++ /dev/null
@@ -1,67 +0,0 @@
-.\"/*
-.\" * Copyright (c) 2009 Red Hat, Inc.
-.\" *
-.\" * All rights reserved.
-.\" *
-.\" * Author: Christine Caulfield <ccaulfie@xxxxxxxxxx>
-.\" *
-.\" * This software licensed under BSD license, the text of which follows:
-.\" *
-.\" * Redistribution and use in source and binary forms, with or without
-.\" * modification, are permitted provided that the following conditions are met:
-.\" *
-.\" * - Redistributions of source code must retain the above copyright notice,
-.\" *   this list of conditions and the following disclaimer.
-.\" * - Redistributions in binary form must reproduce the above copyright notice,
-.\" *   this list of conditions and the following disclaimer in the documentation
-.\" *   and/or other materials provided with the distribution.
-.\" * - Neither the name of the MontaVista Software, Inc. nor the names of its
-.\" *   contributors may be used to endorse or promote products derived from this
-.\" *   software without specific prior written permission.
-.\" *
-.\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-.\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-.\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-.\" * THE POSSIBILITY OF SUCH DAMAGE.
-.\" */
-.TH VOTEQUORUM_LEAVING 3 2009-01-26 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
-.SH NAME
-votequorum_leaving \- Tell other nodes that we are leaving the cluster
-.SH SYNOPSIS
-.B #include <corosync/votequorum.h>
-.sp
-.BI "int votequorum_leaving(votequorum_handle_t " handle ");"
-.SH DESCRIPTION
-The
-.B votequorum_leaving
-function is used to tell the other nodes in the cluster that this node is leaving. They
-will (when the node actually leaves) reduce quorum to keep the cluster running without
-this node.
-.PP
-This function should only be called if it is known that the node is being shut down for
-a known reason and could be out of the cluster for an extended period of time.
-.PP
-Normal behaviour is for the cluster to reduce the total number of votes, but NOT expected_votes
-when a node leave the cluster, so the cluster could become inquorate. This is correct behaviour
-and is ther eto prevent split-brain.
-.PP
-Do NOT call this function unless you know what you are doing.
-.SH RETURN VALUE
-This call returns the CS_OK value if successful, otherwise an error is returned.
-.PP
-.SH ERRORS
-The errors are undocumented.
-.SH "SEE ALSO"
-.BR votequorum_overview (8),
-.BR votequorum_initialize (3),
-.BR votequorum_finalize (3),
-.BR votequorum_dispatch (3),
-.BR votequorum_fd_get (3),
-.PP
diff --git a/services/votequorum.c b/services/votequorum.c
index 6ab64fc..a27f07d 100644
--- a/services/votequorum.c
+++ b/services/votequorum.c
@@ -121,7 +121,6 @@ static int quorum;
 static int cluster_is_quorate;
 static int first_trans = 1;
 static unsigned int quorumdev_poll = DEFAULT_QDEV_POLL;
-static unsigned int leaving_timeout = DEFAULT_LEAVE_TMO;
 
 static uint8_t two_node = 0;
 static uint8_t wait_for_all = 0;
@@ -137,7 +136,6 @@ static struct cluster_node *us;
 static struct cluster_node *quorum_device = NULL;
 static char quorum_device_name[VOTEQUORUM_MAX_QDISK_NAME_LEN];
 static corosync_timer_handle_t quorum_device_timer;
-static corosync_timer_handle_t leaving_timer;
 static struct list_head cluster_members_list;
 static struct corosync_api_v1 *corosync_api;
 static struct list_head trackers_list;
@@ -209,8 +207,6 @@ static void message_handler_req_lib_votequorum_qdisk_poll (void *conn,
 static void message_handler_req_lib_votequorum_qdisk_getinfo (void *conn,
 							      const void *message);
 
-static void message_handler_req_lib_votequorum_leaving (void *conn,
-							const void *message);
 static void message_handler_req_lib_votequorum_trackstart (void *conn,
 							   const void *message);
 static void message_handler_req_lib_votequorum_trackstop (void *conn,
@@ -260,14 +256,10 @@ static struct corosync_lib_handler quorum_lib_service[] =
 		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	{ /* 7 */
-		.lib_handler_fn		= message_handler_req_lib_votequorum_leaving,
-		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
-	},
-	{ /* 8 */
 		.lib_handler_fn		= message_handler_req_lib_votequorum_trackstart,
 		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
-	{ /* 9 */
+	{ /* 8 */
 		.lib_handler_fn		= message_handler_req_lib_votequorum_trackstop,
 		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	}
@@ -417,7 +409,6 @@ struct req_exec_quorum_nodeinfo {
  */
 #define RECONFIG_PARAM_EXPECTED_VOTES 1
 #define RECONFIG_PARAM_NODE_VOTES     2
-#define RECONFIG_PARAM_LEAVING        3
 
 struct req_exec_quorum_reconfigure {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
@@ -447,10 +438,6 @@ static void read_quorum_config(void)
 		quorumdev_poll = DEFAULT_QDEV_POLL;
 	}
 
-	if (icmap_get_uint32("quorum.leaving_timeout", &leaving_timeout) != CS_OK) {
-		leaving_timeout = DEFAULT_LEAVE_TMO;
-	}
-
 	icmap_get_uint8("quorum.two_node", &two_node);
 
 	/*
@@ -1183,14 +1170,6 @@ static void message_handler_req_exec_votequorum_reconfigure (
 		recalculate_quorum(1, 0);  /* Allow decrease */
 		break;
 
-	case RECONFIG_PARAM_LEAVING:
-		if (req_exec_quorum_reconfigure->value == 1 && node->state == NODESTATE_MEMBER) {
-			node->state = NODESTATE_LEAVING;
-		}
-		if (req_exec_quorum_reconfigure->value == 0 && node->state == NODESTATE_LEAVING) {
-			node->state = NODESTATE_MEMBER;
-		}
-		break;
 	}
 
 	LEAVE();
@@ -1210,26 +1189,6 @@ static int quorum_lib_init_fn (void *conn)
 }
 
 /*
- * Someone called votequorum_leave AGES ago!
- * Assume they forgot to shut down the node.
- */
-static void leaving_timer_fn(void *arg)
-{
-	ENTER();
-
-	if (us->state == NODESTATE_LEAVING) {
-		us->state = NODESTATE_MEMBER;
-	}
-
-	/*
-	 * Tell everyone else we made a mistake
-	 */
-	quorum_exec_send_reconfigure(RECONFIG_PARAM_LEAVING, us->node_id, 0);
-
-	LEAVE();
-}
-
-/*
  * Message from the library
  */
 static void message_handler_req_lib_votequorum_getinfo (void *conn, const void *message)
@@ -1396,32 +1355,6 @@ error_exit:
 	LEAVE();
 }
 
-static void message_handler_req_lib_votequorum_leaving (void *conn, const void *message)
-{
-	struct res_lib_votequorum_status res_lib_votequorum_status;
-	cs_error_t error = CS_OK;
-
-	ENTER();
-
-	quorum_exec_send_reconfigure(RECONFIG_PARAM_LEAVING, us->node_id, 1);
-
-	/*
-	 * If we don't shut down in a sensible amount of time then cancel the
-	 * leave status.
-	 */
-	if (leaving_timeout) {
-		corosync_api->timer_add_duration((unsigned long long)leaving_timeout*1000000, NULL,
-						 leaving_timer_fn, &leaving_timer);
-	}
-
-	res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
-	res_lib_votequorum_status.header.id = MESSAGE_RES_VOTEQUORUM_STATUS;
-	res_lib_votequorum_status.header.error = error;
-	corosync_api->ipc_response_send(conn, &res_lib_votequorum_status, sizeof(res_lib_votequorum_status));
-
-	LEAVE();
-}
-
 static void quorum_device_timer_fn(void *arg)
 {
 	ENTER();
-- 
1.7.7.5

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux