summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c26
-rw-r--r--rpc/xdr/src/portmap-xdr.x1
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c12
3 files changed, 34 insertions, 5 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 54b8215c967..9c9cca2060c 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -2832,6 +2832,8 @@ int
glusterfs_mgmt_pmap_signin(glusterfs_ctx_t *ctx)
{
call_frame_t *frame = NULL;
+ xlator_list_t **trav_p;
+ xlator_t *top;
pmap_signin_req req = {
0,
};
@@ -2861,10 +2863,26 @@ glusterfs_mgmt_pmap_signin(glusterfs_ctx_t *ctx)
req.brick = cmd_args->brick_name;
req.port = cmd_args->brick_port;
-
- ret = mgmt_submit_request(&req, frame, ctx, &clnt_pmap_prog, GF_PMAP_SIGNIN,
- mgmt_pmap_signin_cbk,
- (xdrproc_t)xdr_pmap_signin_req);
+ req.pid = (int)getpid(); /* only glusterd2 consumes this */
+
+ if (ctx->active) {
+ top = ctx->active->first;
+ for (trav_p = &top->children; *trav_p; trav_p = &(*trav_p)->next) {
+ req.brick = (*trav_p)->xlator->name;
+ ret = mgmt_submit_request(&req, frame, ctx, &clnt_pmap_prog,
+ GF_PMAP_SIGNIN, mgmt_pmap_signin_cbk,
+ (xdrproc_t)xdr_pmap_signin_req);
+ if (ret < 0) {
+ gf_log(THIS->name, GF_LOG_WARNING,
+ "failed to send sign in request; brick = %s", req.brick);
+ }
+ }
+ } else {
+ ret = mgmt_submit_request(&req, frame, ctx, &clnt_pmap_prog,
+ GF_PMAP_SIGNIN, mgmt_pmap_signin_cbk,
+ (xdrproc_t)xdr_pmap_signin_req);
+ }
+ /* unfortunately, the caller doesn't care about the returned value */
out:
if (need_emancipate && ret < 0)
diff --git a/rpc/xdr/src/portmap-xdr.x b/rpc/xdr/src/portmap-xdr.x
index 66a86a1dae1..e360911bc07 100644
--- a/rpc/xdr/src/portmap-xdr.x
+++ b/rpc/xdr/src/portmap-xdr.x
@@ -40,6 +40,7 @@ struct pmap_brick_by_port_rsp {
struct pmap_signin_req {
string brick<>;
int port;
+ int pid;
};
struct pmap_signin_rsp {
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 4129147daf8..9a6623c2bd0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -4478,8 +4478,18 @@ client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
}
}
+ /* if the client is part of 'gfproxyd' server, then we need to keep the
+ volume name as 'gfproxyd-<volname>', for better portmapper options */
+ subvol = volname;
+ ret = dict_get_str_boolean(set_dict, "gfproxy-server", 0);
+ if (ret > 0) {
+ namelen = strlen(volinfo->volname) + SLEN("gfproxyd-") + 1;
+ subvol = alloca(namelen);
+ snprintf(subvol, namelen, "gfproxyd-%s", volname);
+ }
+
ret = -1;
- xl = volgen_graph_add_as(graph, "debug/io-stats", volname);
+ xl = volgen_graph_add_as(graph, "debug/io-stats", subvol);
if (!xl)
goto out;