All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: [Patch 3/3] tabled: drop StorageNode clause
Date: Sun, 3 Jan 2010 00:56:47 -0700	[thread overview]
Message-ID: <20100103005647.6596b320@redhat.com> (raw)

We rely on CLD for builds (on all platforms), so we do not need the
StorageNode clause anymore.

Signed-Off-By: Pete Zaitcev <zaitcev@redhat.com>

---
 doc/etc.tabled.conf |   14 +------
 server/config.c     |   77 +-----------------------------------------
 2 files changed, 6 insertions(+), 85 deletions(-)

commit 1f98d01875661d4994f58435970ea4e6b4612248
Author: Master <zaitcev@niphredil.zaitcev.lan>
Date:   Sun Jan 3 00:31:29 2010 -0700

    Drop StorageNode from configuration.

diff --git a/doc/etc.tabled.conf b/doc/etc.tabled.conf
index 7aeaae4..9c0cb5f 100644
--- a/doc/etc.tabled.conf
+++ b/doc/etc.tabled.conf
@@ -15,20 +15,12 @@
 <TDBRepPort>8083</TDBRepPort>
 
 <!--
-  The clauses <StorageNode> and <CLD> are not to be used in production
-  configurations. Tabled finds CLD from SRV records in DNS, and then finds
-  storage nodes from CLD. We only use these clauses in order to bootstrap
+  The clause <CLD> is not to be used in production configurations.
+  Normally, tabled finds CLD from SRV records in DNS, and then finds
+  storage nodes from CLD. We only use such clauses in order to bootstrap
   a build of tabled. Consider them undocumented and a subject to change
   or removal at any time.
   -->
-<StorageNode>
-  <Port>8082</Port>
-  <Host>b12.phx2.my.com</Host>
-</StorageNode>
-<StorageNode>
-  <Port>8082</Port>
-  <Host>b13.phx2.my.com</Host>
-</StorageNode>
 <CLD>
   <Port>8081</Port>
   <Host>localhost</Host>
diff --git a/server/config.c b/server/config.c
index c537224..037176d 100644
--- a/server/config.c
+++ b/server/config.c
@@ -37,11 +37,6 @@ struct config_context {
 	bool		in_listen;
 	struct listen_cfg tmp_listen;
 
-	bool		in_storage;
-	unsigned int	stor_nid;
-	char		*stor_port;
-	char		*stor_host;
-
 	bool		in_cld;
 	unsigned short	cld_port;
 	char		*cld_host;
@@ -64,14 +59,6 @@ static void cfg_elm_start (GMarkupParseContext *context,
 			applog(LOG_ERR, "Nested Listen in configuration");
 		}
 	}
-	else if (!strcmp(element_name, "StorageNode")) {
-		if (!cc->in_storage) {
-			cc->in_storage = true;
-			cc->stor_nid++;
-		} else {
-			applog(LOG_ERR, "Nested StorageNode in configuration");
-		}
-	}
 	else if (!strcmp(element_name, "CLD")) {
 		if (!cc->in_cld) {
 			cc->in_cld = true;
@@ -116,44 +103,6 @@ static void cfg_elm_end_listen(struct config_context *cc)
 	memset(&cc->tmp_listen, 0, sizeof(struct listen_cfg));
 }
 
-static void cfg_elm_end_storage(struct config_context *cc)
-{
-	struct geo dummy_loc;
-
-	if (cc->text) {
-		applog(LOG_WARNING, "Extra text in StorageNode element: \"%s\"",
-		       cc->text);
-		free(cc->text);
-		cc->text = NULL;
-		goto end;
-	}
-
-	if (!cc->stor_host) {
-		applog(LOG_WARNING, "No host for StorageNode element");
-		goto end;
-	}
-	if (!cc->stor_port) {
-		applog(LOG_WARNING, "No port for StorageNode element");
-		goto end;
-	}
-
-	memset(&dummy_loc, 0, sizeof(struct geo));
-	stor_add_node(cc->stor_nid, cc->stor_host, cc->stor_port, &dummy_loc);
-	/*
-	 * We don't call stor_update_cb here because doing it so early
-	 * hangs TDB replication for some reason (and produces a process
-	 * that needs -9 to kill).
-	 *
-	 * Instead, there's a little plug in cldu.c that does it.
-	 */
-
-end:
-	free(cc->stor_host);
-	cc->stor_host = NULL;
-	free(cc->stor_port);
-	cc->stor_port = NULL;
-}
-
 static void cfg_elm_end_cld(struct config_context *cc)
 {
 	if (cc->text) {
@@ -262,11 +211,6 @@ static void cfg_elm_end (GMarkupParseContext *context,
 		cc->in_listen = false;
 	}
 
-	else if (!strcmp(element_name, "StorageNode")) {
-		cfg_elm_end_storage(cc);
-		cc->in_storage = false;
-	}
-
 	else if (!strcmp(element_name, "CLD")) {
 		cfg_elm_end_cld(cc);
 		cc->in_cld = false;
@@ -291,17 +235,6 @@ static void cfg_elm_end (GMarkupParseContext *context,
 				free(cc->text);
 			}
 			cc->text = NULL;
-		} else if (cc->in_storage) {
-			n = strtol(cc->text, NULL, 10);
-			if (n > 0 && n < 65536) {
-				free(cc->stor_port);
-				cc->stor_port = cc->text;
-			} else {
-				applog(LOG_WARNING,
-				       "Port '%s' invalid, ignoring", cc->text);
-				free(cc->text);
-			}
-			cc->text = NULL;
 		} else if (cc->in_cld) {
 			n = strtol(cc->text, NULL, 10);
 			if (n > 0 && n < 65536)
@@ -313,7 +246,7 @@ static void cfg_elm_end (GMarkupParseContext *context,
 			cc->text = NULL;
 		} else {
 			applog(LOG_WARNING,
-			       "Port element not in Listen or StorageNode");
+			       "Port element not in Listen or CLD");
 			return;
 		}
 
@@ -325,16 +258,12 @@ static void cfg_elm_end (GMarkupParseContext *context,
 			return;
 		}
 
-		if (cc->in_storage) {
-			free(cc->stor_host);
-			cc->stor_host = cc->text;
-			cc->text = NULL;
-		} else if (cc->in_cld) {
+		if (cc->in_cld) {
 			free(cc->cld_host);
 			cc->cld_host = cc->text;
 			cc->text = NULL;
 		} else {
-			applog(LOG_WARNING, "Host element not in StorageNode");
+			applog(LOG_WARNING, "Host element not in CLD");
 		}
 	}
 

                 reply	other threads:[~2010-01-03  7:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100103005647.6596b320@redhat.com \
    --to=zaitcev@redhat.com \
    --cc=hail-devel@vger.kernel.org \
    --cc=jeff@garzik.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.