summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-12-30 16:37:05 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-01-30 18:26:57 -0800
commitc4d7c50a7354ad92e76ea72fccc86e0732e75c49 (patch)
treecd09f392cfc3fa5958cd3e7cd2af52aafb75c889 /xlators/mgmt/glusterd
parent5907d0b4d097cc625c7205963197d9b7e9b40573 (diff)
snapd: Do not persist snapd port
Backport of http://review.gluster.org/#/c/13118/ Currently snapd persists the port it uses to sign-in with glusterd, without checking if that particular port is being used by any other process. As a result, it might erroneously sign out any other process using the same port. Hence forcing snapd to ignore the persisted port, and using a new one while coming up. Change-Id: Ibb9ec3762aac445f03d96e85660585be4ab27bcb BUG: 1294797 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/13119 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapd-svc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
index 2ec7200d1da..2df94eb92bb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
@@ -294,18 +294,19 @@ glusterd_snapdsvc_start (glusterd_svc_t *svc, int flags)
"--brick-name", snapd_id,
"-S", svc->conn.sockpath, NULL);
- snapd_port = volinfo->snapd.port;
+
+ snapd_port = pmap_registry_alloc (THIS);
if (!snapd_port) {
- snapd_port = pmap_registry_alloc (THIS);
- if (!snapd_port) {
- snprintf (msg, sizeof (msg), "Could not allocate port "
- "for snapd service for volume %s",
- volinfo->volname);
- runner_log (&runner, this->name, GF_LOG_DEBUG, msg);
- ret = -1;
- goto out;
- }
+ snprintf (msg, sizeof (msg), "Could not allocate port "
+ "for snapd service for volume %s",
+ volinfo->volname);
+ runner_log (&runner, this->name, GF_LOG_DEBUG, msg);
+ ret = -1;
+ goto out;
}
+
+ volinfo->snapd.port = snapd_port;
+
runner_add_arg (&runner, "--brick-port");
runner_argprintf (&runner, "%d", snapd_port);
runner_add_arg (&runner, "--xlator-option");
@@ -326,7 +327,6 @@ glusterd_snapdsvc_start (glusterd_svc_t *svc, int flags)
}
synclock_lock (&priv->big_lock);
}
- volinfo->snapd.port = snapd_port;
out:
return ret;