diff options
author | Amar Tumballi <amar@gluster.com> | 2011-06-08 09:28:49 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-08 11:17:12 -0700 |
commit | 19f375da5b43f940131623b2f33675aa2b3f5c8a (patch) | |
tree | 29f5e51139deb1cfc2462a2a1ef64a100e2c1c4f /xlators/mgmt/glusterd/src/glusterd-store.c | |
parent | fe4eb7c3ac96218fe151633c5ccd34b7c0bea783 (diff) |
fix multiple transport portmap issues in client handshake
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2294 (Currently there is no way through cli to make a volume listen on both the transports (socket/rdma))
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2294
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index ab1dad82744..f589a8dfcec 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -319,6 +319,10 @@ glusterd_store_brickinfo_write (int fd, glusterd_brickinfo_t *brickinfo) ret = glusterd_store_save_value (fd, GLUSTERD_STORE_KEY_BRICK_PORT, value); + snprintf (value, sizeof(value), "%d", brickinfo->rdma_port); + ret = glusterd_store_save_value (fd, GLUSTERD_STORE_KEY_BRICK_RDMA_PORT, + value); + out: gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); return ret; @@ -1448,6 +1452,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); |