summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-06-17 06:10:53 +0000
committerAnand Avati <avati@gluster.com>2011-06-19 02:16:34 -0700
commita6fd403a15ffead93daba8a737cd7c6d6a943744 (patch)
tree618fd1c03ead241bb4605a774e55c14425c2c026 /xlators/mgmt/glusterd/src/glusterd-store.c
parent3d6efb17f12fa23482936ec7a5a666bbf9c0f78b (diff)
fix multiple transport related portmap issues in client handshake
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2258 (enhance gluster volume rebalance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2258
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index b55204f31a9..153329f9e1e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -157,6 +157,12 @@ glusterd_store_create_brick (glusterd_volinfo_t *volinfo,
if (ret)
gf_log ("", GF_LOG_TRACE, "failed to write brick->port");
+ snprintf (buf, sizeof(buf), "%s=%d", GLUSTERD_STORE_KEY_BRICK_RDMA_PORT,
+ brickinfo->rdma_port);
+ ret = write (shandle->fd, buf, strlen (buf));
+ if (ret)
+ gf_log ("", GF_LOG_TRACE, "failed to write brick->rdma_port");
+
ret = 0;
snprintf (buf, sizeof (buf), "%s-%d",GLUSTERD_STORE_KEY_VOL_BRICK,
@@ -269,7 +275,6 @@ glusterd_store_remove_bricks (glusterd_volinfo_t *volinfo)
closedir (dir);
ret = rmdir (brickdir);
-
out:
gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
return ret;
@@ -364,6 +369,7 @@ glusterd_store_create_volume (glusterd_volinfo_t *volinfo)
if (ret)
goto out;
*/
+
snprintf (buf, sizeof (buf), "%d", volinfo->sub_count);
ret = glusterd_store_save_value (volinfo->shandle,
GLUSTERD_STORE_KEY_VOL_SUB_COUNT, buf);
@@ -1081,6 +1087,14 @@ glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo)
pmap = pmap_registry_get (THIS);
if (pmap->last_alloc <= brickinfo->port)
pmap->last_alloc = brickinfo->port + 1;
+ } else if (!strncmp (key, GLUSTERD_STORE_KEY_BRICK_RDMA_PORT,
+ strlen (GLUSTERD_STORE_KEY_BRICK_RDMA_PORT))) {
+ gf_string2int (value, &brickinfo->rdma_port);
+ /* This is required to have proper ports
+ assigned to bricks after restart */
+ pmap = pmap_registry_get (THIS);
+ if (pmap->last_alloc <= brickinfo->rdma_port)
+ pmap->last_alloc = brickinfo->rdma_port + 1;
} else {
gf_log ("", GF_LOG_ERROR, "Unknown key: %s",
key);