summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-12-30 16:37:05 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-02-01 03:02:27 -0800
commit4267c14e1be513b6124ef0dca75029494844f711 (patch)
tree79b37f319bad42db22732a661a9ebdf07795912c /xlators
parentb8a7b648d8f16999b00768d56f029b955c390eb7 (diff)
snapd: Do not persist snapd port
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: 1294794 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/13118 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-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 764af57cd09..7cd6fdd6ac1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
@@ -295,18 +295,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");
@@ -327,7 +328,6 @@ glusterd_snapdsvc_start (glusterd_svc_t *svc, int flags)
}
synclock_lock (&priv->big_lock);
}
- volinfo->snapd.port = snapd_port;
out:
return ret;