[sheepdog] [PATCH 1/4] Revert "collie: add cluster recover info command"

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Sep 11 10:25:29 CEST 2012


With the new manual recovery design, we need to increment epoch even
when object recovery is disabled, so the command "cluster recover
info" is no longer required.

This reverts commit d652f24f00bef5045233083ff704b252a54beffe.

Conflicts:

	include/internal_proto.h
	sheep/ops.c

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 collie/cluster.c         |   61 ----------------------------------------------
 include/internal_proto.h |    1 -
 sheep/ops.c              |   15 -----------
 3 files changed, 0 insertions(+), 77 deletions(-)

diff --git a/collie/cluster.c b/collie/cluster.c
index 4226ce6..7ebbb83 100644
--- a/collie/cluster.c
+++ b/collie/cluster.c
@@ -343,65 +343,6 @@ The cluster may need to be force recovered if:\n\
   - some nodes fail to start after a cluster shutdown.\n\n\
 Are you sure you want to continue? [yes/no]: "
 
-static int cluster_info_recover(int argc, char **argv)
-{
-	int fd, ret = EXIT_SYSFAIL;
-	struct sd_req hdr;
-	struct sd_rsp *rsp = (struct sd_rsp *)&hdr;
-	unsigned rlen, wlen;
-	void *buf;
-	int i, nr_nodes;
-	const char *status[] = {"enable", "disable"};
-
-	wlen = 0;
-	rlen = SD_MAX_NODES * sizeof(struct sd_node);
-
-	buf = malloc(rlen);
-	if (!buf)
-		return EXIT_SYSFAIL;
-
-	fd = connect_to(sdhost, sdport);
-	if (fd < 0)
-		goto out;
-
-	sd_init_req(&hdr, SD_OP_INFO_RECOVER);
-	hdr.data_length = rlen;
-
-	ret = exec_req(fd, &hdr, buf, &wlen, &rlen);
-	close(fd);
-
-	if (ret) {
-		fprintf(stderr, "Failed to connect\n");
-		goto out;
-	}
-
-	if (rsp->result != SD_RES_SUCCESS) {
-		fprintf(stderr, "failed: %s\n", sd_strerror(rsp->result));
-		ret = EXIT_FAILURE;
-		goto out;
-	}
-	nr_nodes = rsp->data_length/sizeof(struct sd_node);
-
-	printf("Status: %s\n", status[rsp->__pad[0]]);
-	printf("Joining nodes in inner temporary list:\n"
-	       "--------------------------------------\n"
-	       "Id               Host:Port\n");
-	for (i = 0; i < nr_nodes; i++) {
-		char ipaddr[128];
-		struct sd_node *rnodes;
-
-		rnodes = (struct sd_node *)buf;
-		addr_to_str(ipaddr, sizeof(ipaddr), rnodes[i].nid.addr,
-			    rnodes[i].nid.port);
-		printf("%2d               %s\n", i, ipaddr);
-	}
-
-
-out:
-	free(buf);
-	return EXIT_SUCCESS;
-}
-
 static int cluster_force_recover(int argc, char **argv)
 {
 	int ret;
@@ -468,8 +409,6 @@ static int cluster_enable_recover(int argc, char **argv)
 
 /* Subcommand list of recover */
 static struct subcommand cluster_recover_cmd[] = {
-	{"info", NULL, NULL, "show the status of recovery to user",
-	 NULL, 0, cluster_info_recover},
 	{"force", NULL, NULL, "force recover cluster immediately",
 	 NULL, 0, cluster_force_recover},
 	{"enable", NULL, NULL, "enable automatic recovery and "
diff --git a/include/internal_proto.h b/include/internal_proto.h
index ec27cfc..f894d00 100644
--- a/include/internal_proto.h
+++ b/include/internal_proto.h
@@ -62,7 +62,6 @@
 #define SD_OP_SET_CACHE_SIZE 0xA7
 #define SD_OP_ENABLE_RECOVER 0xA8
 #define SD_OP_DISABLE_RECOVER 0xA9
-#define SD_OP_INFO_RECOVER 0xAA
 #define SD_OP_GET_VDI_COPIES 0xAB
 #define SD_OP_COMPLETE_RECOVERY 0xAC
 #define SD_OP_FLUSH_NODES 0xAD
diff --git a/sheep/ops.c b/sheep/ops.c
index 4c3e9ac..ad7766a 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -350,16 +350,6 @@ static int cluster_disable_recover(const struct sd_req *req,
 	return SD_RES_SUCCESS;
 }
 
-static int local_info_recover(const struct sd_req *req,
-			      struct sd_rsp *rsp, void *data)
-{
-	rsp->__pad[0] = sys->disable_recovery;
-	rsp->data_length = nr_joining_nodes * sizeof(struct sd_node);
-	memcpy(data, joining_nodes, rsp->data_length);
-
-	return SD_RES_SUCCESS;
-}
-
 static int cluster_get_vdi_attr(struct request *req)
 {
 	const struct sd_req *hdr = &req->rq;
@@ -1233,11 +1223,6 @@ static struct sd_op_template sd_ops[] = {
 		.type = SD_OP_TYPE_CLUSTER,
 		.process_main = cluster_disable_recover,
 	},
-	[SD_OP_INFO_RECOVER] = {
-		.name = "INFO_RECOVER",
-		.type = SD_OP_TYPE_LOCAL,
-		.process_main = local_info_recover,
-	},
 
 	[SD_OP_FLUSH_PEER] = {
 		.name = "FLUSH_PEER",
-- 
1.7.2.5




More information about the sheepdog mailing list