21ab4e
From 9cc644d4da31a4a2e384454b73caffd510016e71 Mon Sep 17 00:00:00 2001
21ab4e
From: Samikshan Bairagya <samikshan@gmail.com>
21ab4e
Date: Wed, 5 Apr 2017 18:03:10 +0530
21ab4e
Subject: [PATCH 612/616] glusterd: Add client details to get-state output
21ab4e
21ab4e
This commit optionally adds client details corresponding to the
21ab4e
locally running bricks to the get-state output. Since getting
21ab4e
the client details involves sending RPC requests to the respective
21ab4e
local bricks, this is a relatively more costly operation. These
21ab4e
client details would be added to the get-state output only if the
21ab4e
get-state command is invoked with the 'detail' option.
21ab4e
21ab4e
This commit therefore also changes the get-state CLI usage. The
21ab4e
modified usage is as follows:
21ab4e
21ab4e
 # gluster get-state [<daemon>] [[odir </path/to/output/dir/>] \
21ab4e
[file <filename>]] [detail]
21ab4e
21ab4e
>Reviewed-on: https://review.gluster.org/17003
21ab4e
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
21ab4e
>Smoke: Gluster Build System <jenkins@build.gluster.org>
21ab4e
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
21ab4e
>Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
21ab4e
Change-Id: I42cd4ef160f9e96d55a08a10d32c8ba44e4cd3d8
21ab4e
BUG: 1488020
21ab4e
Signed-off-by: Samikshan Bairagya <samikshan@gmail.com>
21ab4e
Reviewed-on: https://code.engineering.redhat.com/gerrit/117172
21ab4e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
Tested-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
---
21ab4e
 cli/src/cli-cmd-global.c                           |   3 +-
21ab4e
 cli/src/cli-cmd-parser.c                           |  37 +++-
21ab4e
 doc/gluster.8                                      |   2 +-
21ab4e
 rpc/xdr/src/cli1-xdr.x                             |   4 +
21ab4e
 .../cli/bug-1353156-get-state-cli-validations.t    |  33 ++--
21ab4e
 xlators/mgmt/glusterd/src/glusterd-handler.c       | 194 +++++++++++++++++++++
21ab4e
 xlators/mgmt/glusterd/src/glusterd-messages.h      |  10 +-
21ab4e
 xlators/mgmt/glusterd/src/glusterd-syncop.h        |   4 +
21ab4e
 8 files changed, 262 insertions(+), 25 deletions(-)
21ab4e
21ab4e
diff --git a/cli/src/cli-cmd-global.c b/cli/src/cli-cmd-global.c
21ab4e
index f4544da..4312d24 100644
21ab4e
--- a/cli/src/cli-cmd-global.c
21ab4e
+++ b/cli/src/cli-cmd-global.c
21ab4e
@@ -47,7 +47,8 @@ struct cli_cmd global_cmds[] = {
21ab4e
            cli_cmd_ganesha_cbk,
21ab4e
           "Enable/disable NFS-Ganesha support",
21ab4e
         },
21ab4e
-        { "get-state [<daemon>] [odir </path/to/output/dir/>] [file <filename>]",
21ab4e
+        { "get-state [<daemon>] [odir </path/to/output/dir/>] "
21ab4e
+          "[file <filename>]] [detail]",
21ab4e
           cli_cmd_get_state_cbk,
21ab4e
           "Get local state representation of mentioned daemon",
21ab4e
         },
21ab4e
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
21ab4e
index 6f65840..a068beb 100644
21ab4e
--- a/cli/src/cli-cmd-parser.c
21ab4e
+++ b/cli/src/cli-cmd-parser.c
21ab4e
@@ -946,11 +946,11 @@ cli_cmd_get_state_parse (struct cli_state *state,
21ab4e
 {
21ab4e
         dict_t    *dict                 = NULL;
21ab4e
         int        ret                  = -1;
21ab4e
-        uint32_t   cmd                  = 0;
21ab4e
         char      *odir                 = NULL;
21ab4e
         char      *filename             = NULL;
21ab4e
         char      *daemon_name          = NULL;
21ab4e
         int        count                = 0;
21ab4e
+        uint32_t   cmd                  = 0;
21ab4e
 
21ab4e
         GF_VALIDATE_OR_GOTO ("cli", options, out);
21ab4e
         GF_VALIDATE_OR_GOTO ("cli", words, out);
21ab4e
@@ -959,7 +959,7 @@ cli_cmd_get_state_parse (struct cli_state *state,
21ab4e
         if (!dict)
21ab4e
                 goto out;
21ab4e
 
21ab4e
-        if (wordcount < 1 || wordcount > 6) {
21ab4e
+        if (wordcount < 1 || wordcount > 7) {
21ab4e
                 *op_errstr = gf_strdup ("Problem parsing arguments."
21ab4e
                                         " Check usage.");
21ab4e
                 goto out;
21ab4e
@@ -990,16 +990,28 @@ cli_cmd_get_state_parse (struct cli_state *state,
21ab4e
                                 }
21ab4e
                         } else {
21ab4e
                                 if (count > 1) {
21ab4e
-                                        *op_errstr = gf_strdup ("Problem "
21ab4e
-                                                        "parsing arguments. "
21ab4e
+                                        if (count == wordcount-1 &&
21ab4e
+                                            !strcmp (words[count], "detail")) {
21ab4e
+                                                cmd = GF_CLI_GET_STATE_DETAIL;
21ab4e
+                                                continue;
21ab4e
+                                        } else {
21ab4e
+                                                *op_errstr = gf_strdup ("Problem"
21ab4e
+                                                        " parsing arguments. "
21ab4e
                                                         "Check usage.");
21ab4e
-                                        ret = -1;
21ab4e
-                                        goto out;
21ab4e
+                                                ret = -1;
21ab4e
+                                                goto out;
21ab4e
+                                        }
21ab4e
 
21ab4e
                                 }
21ab4e
                                 if (strcmp (words[count], "glusterd") == 0) {
21ab4e
                                         continue;
21ab4e
                                 } else {
21ab4e
+                                        if (count == wordcount-1 &&
21ab4e
+                                            !strcmp (words[count], "detail")) {
21ab4e
+                                                cmd = GF_CLI_GET_STATE_DETAIL;
21ab4e
+                                                continue;
21ab4e
+                                        }
21ab4e
+
21ab4e
                                         *op_errstr = gf_strdup ("glusterd is "
21ab4e
                                                  "the only supported daemon.");
21ab4e
                                         ret = -1;
21ab4e
@@ -1041,6 +1053,19 @@ cli_cmd_get_state_parse (struct cli_state *state,
21ab4e
                                 goto out;
21ab4e
                         }
21ab4e
                 }
21ab4e
+
21ab4e
+                if (cmd) {
21ab4e
+                        ret = dict_set_uint32 (dict, "getstate-cmd", cmd);
21ab4e
+                        if (ret) {
21ab4e
+                                *op_errstr = gf_strdup ("Command failed. Please"
21ab4e
+                                                        " check log file for"
21ab4e
+                                                        " more details.");
21ab4e
+                                gf_log (THIS->name, GF_LOG_ERROR, "Setting "
21ab4e
+                                        "get-state command type to dictionary "
21ab4e
+                                        "failed");
21ab4e
+                                goto out;
21ab4e
+                        }
21ab4e
+                }
21ab4e
         }
21ab4e
 
21ab4e
  out:
21ab4e
diff --git a/doc/gluster.8 b/doc/gluster.8
21ab4e
index c9a9d50..c7b6f22 100644
21ab4e
--- a/doc/gluster.8
21ab4e
+++ b/doc/gluster.8
21ab4e
@@ -269,7 +269,7 @@ Selects <HOSTNAME:BRICKNAME> as the source for all the files that are in split-b
21ab4e
 Selects the split-brained <FILE> present in <HOSTNAME:BRICKNAME> as source and completes heal.
21ab4e
 .SS "Other Commands"
21ab4e
 .TP
21ab4e
-\fB\ get-state [<daemon>] [odir </path/to/output/dir/>] [file <filename>] \fR
21ab4e
+\fB\ get-state [<daemon>] [[odir </path/to/output/dir/>] [file <filename>]] [detail] \fR
21ab4e
 Get local state representation of mentioned daemon and store data in provided path information
21ab4e
 .TP
21ab4e
 \fB\ help \fR
21ab4e
diff --git a/rpc/xdr/src/cli1-xdr.x b/rpc/xdr/src/cli1-xdr.x
21ab4e
index 78b54ce..c90d564 100644
21ab4e
--- a/rpc/xdr/src/cli1-xdr.x
21ab4e
+++ b/rpc/xdr/src/cli1-xdr.x
21ab4e
@@ -131,6 +131,10 @@ enum gf1_cli_info_op {
21ab4e
         GF_CLI_INFO_CLEAR = 4
21ab4e
 };
21ab4e
 
21ab4e
+enum gf_cli_get_state_op {
21ab4e
+        GF_CLI_GET_STATE_DETAIL = 1
21ab4e
+};
21ab4e
+
21ab4e
 enum gf1_cli_top_op {
21ab4e
         GF_CLI_TOP_NONE = 0,
21ab4e
         GF_CLI_TOP_OPEN,
21ab4e
diff --git a/tests/bugs/cli/bug-1353156-get-state-cli-validations.t b/tests/bugs/cli/bug-1353156-get-state-cli-validations.t
21ab4e
index 6ab7a08..f6e72a5 100644
21ab4e
--- a/tests/bugs/cli/bug-1353156-get-state-cli-validations.t
21ab4e
+++ b/tests/bugs/cli/bug-1353156-get-state-cli-validations.t
21ab4e
@@ -77,7 +77,15 @@ TEST positive_test $CLI get-state odir $ODIR file gdstate
21ab4e
 
21ab4e
 TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate
21ab4e
 
21ab4e
-TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate
21ab4e
+TEST positive_test $CLI get-state detail
21ab4e
+
21ab4e
+TEST positive_test $CLI get-state glusterd detail
21ab4e
+
21ab4e
+TEST positive_test $CLI get-state odir $ODIR detail
21ab4e
+
21ab4e
+TEST positive_test $CLI get-state glusterd odir $ODIR detail
21ab4e
+
21ab4e
+TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate detail
21ab4e
 
21ab4e
 TEST ! $CLI get-state glusterfsd odir $ODIR;
21ab4e
 ERRSTR=$($CLI get-state glusterfsd odir $ODIR 2>&1 >/dev/null);
21ab4e
@@ -111,19 +119,12 @@ TEST ! $CLI get-state glusterd foo bar;
21ab4e
 ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null);
21ab4e
 EXPECT 'Problem' get_parsing_arguments_part $ERRSTR;
21ab4e
 
21ab4e
-cleanup;
21ab4e
+TEST ! $CLI get-state glusterd detail file gdstate;
21ab4e
+ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null);
21ab4e
+EXPECT 'Problem' get_parsing_arguments_part $ERRSTR;
21ab4e
+
21ab4e
+TEST ! $CLI get-state glusterd foo bar detail;
21ab4e
+ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null);
21ab4e
+EXPECT 'Problem' get_parsing_arguments_part $ERRSTR;
21ab4e
 
21ab4e
-# I've cleaned this up as much as I can - making sure the gdstates directory
21ab4e
-# gets cleaned up, checking whether the CLI command actually succeeded before
21ab4e
-# parsing its output, etc. - but it still fails in Jenkins.  Specifically, the
21ab4e
-# first get-state request that hits the server (i.e. doesn't bail out with a
21ab4e
-# parse error first) succeeds, but any others time out.  They don't even get as
21ab4e
-# far as the glusterd log message that says we received a get-state request.
21ab4e
-# There doesn't seem to be a core file, so glusterd doesn't seem to have
21ab4e
-# crashed, but it's not responding either.  Even worse, the problem seems to be
21ab4e
-# environment-dependent; Jenkins is the only place I've seen it, and that's
21ab4e
-# just about the worst environment ever for debugging anything.
21ab4e
-#
21ab4e
-# I'm marking this test bad so progress can be made elsewhere.  If anybody else
21ab4e
-# thinks this functionality is important, and wants to make it debuggable, good
21ab4e
-# luck to you.
21ab4e
+cleanup;
21ab4e
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
21ab4e
index f649099..8a781f8 100644
21ab4e
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
21ab4e
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
21ab4e
@@ -4997,6 +4997,8 @@ glusterd_handle_get_vol_opt (rpcsvc_request_t *req)
21ab4e
         return glusterd_big_locked_handler (req, __glusterd_handle_get_vol_opt);
21ab4e
 }
21ab4e
 
21ab4e
+extern struct rpc_clnt_program gd_brick_prog;
21ab4e
+
21ab4e
 static int
21ab4e
 glusterd_print_global_options (dict_t *opts, char *key, data_t *val, void *data)
21ab4e
 {
21ab4e
@@ -5081,6 +5083,178 @@ out:
21ab4e
 }
21ab4e
 
21ab4e
 static int
21ab4e
+glusterd_print_client_details (FILE *fp, dict_t *dict,
21ab4e
+                               glusterd_volinfo_t *volinfo, int volcount,
21ab4e
+                               glusterd_brickinfo_t *brickinfo, int brickcount)
21ab4e
+{
21ab4e
+        int              ret = -1;
21ab4e
+        xlator_t        *this = NULL;
21ab4e
+        int              brick_index = -1;
21ab4e
+        int              client_count = 0;
21ab4e
+        char             key[1024] = {0,};
21ab4e
+        char            *clientname = NULL;
21ab4e
+        uint64_t         bytesread = 0;
21ab4e
+        uint64_t         byteswrite = 0;
21ab4e
+        uint32_t         opversion = 0;
21ab4e
+
21ab4e
+        glusterd_pending_node_t     *pending_node = NULL;
21ab4e
+        rpc_clnt_t                  *rpc = NULL;
21ab4e
+        struct syncargs              args = {0,};
21ab4e
+        gd1_mgmt_brick_op_req       *brick_req = NULL;
21ab4e
+
21ab4e
+        this = THIS;
21ab4e
+        GF_VALIDATE_OR_GOTO ("glusterd", this, out);
21ab4e
+
21ab4e
+        GF_VALIDATE_OR_GOTO (this->name, dict, out);
21ab4e
+
21ab4e
+        if (gf_uuid_compare (brickinfo->uuid, MY_UUID) ||
21ab4e
+                             !glusterd_is_brick_started (brickinfo)) {
21ab4e
+                ret = 0;
21ab4e
+                goto out;
21ab4e
+        }
21ab4e
+
21ab4e
+        brick_index++;
21ab4e
+        pending_node = GF_CALLOC (1, sizeof (*pending_node),
21ab4e
+                                  gf_gld_mt_pending_node_t);
21ab4e
+        if (!pending_node) {
21ab4e
+                ret = -1;
21ab4e
+                gf_msg (this->name, GF_LOG_ERROR, ENOMEM, GD_MSG_NO_MEMORY,
21ab4e
+                        "Unable to allocate memory");
21ab4e
+                goto out;
21ab4e
+        }
21ab4e
+
21ab4e
+        pending_node->node = brickinfo;
21ab4e
+        pending_node->type = GD_NODE_BRICK;
21ab4e
+        pending_node->index = brick_index;
21ab4e
+
21ab4e
+        rpc = glusterd_pending_node_get_rpc (pending_node);
21ab4e
+        if (!rpc) {
21ab4e
+                ret = -1;
21ab4e
+                gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_RPC_FAILURE,
21ab4e
+                        "Failed to retrieve rpc object");
21ab4e
+                goto out;
21ab4e
+        }
21ab4e
+
21ab4e
+        brick_req = GF_CALLOC (1, sizeof (*brick_req),
21ab4e
+                               gf_gld_mt_mop_brick_req_t);
21ab4e
+        if (!brick_req) {
21ab4e
+                ret = -1;
21ab4e
+                gf_msg (this->name, GF_LOG_ERROR, ENOMEM, GD_MSG_NO_MEMORY,
21ab4e
+                        "Unable to allocate memory");
21ab4e
+                goto out;
21ab4e
+        }
21ab4e
+
21ab4e
+        brick_req->op = GLUSTERD_BRICK_STATUS;
21ab4e
+        brick_req->name = "";
21ab4e
+
21ab4e
+        ret = dict_set_int32 (dict, "cmd", GF_CLI_STATUS_CLIENTS);
21ab4e
+        if (ret)
21ab4e
+                goto out;
21ab4e
+
21ab4e
+        ret = dict_set_str (dict, "volname", volinfo->volname);
21ab4e
+        if (ret)
21ab4e
+                goto out;
21ab4e
+
21ab4e
+        ret = dict_allocate_and_serialize (dict, &brick_req->input.input_val,
21ab4e
+                                           &brick_req->input.input_len);
21ab4e
+        if (ret)
21ab4e
+                goto out;
21ab4e
+
21ab4e
+        GD_SYNCOP (rpc, (&args), NULL, gd_syncop_brick_op_cbk, brick_req,
21ab4e
+                   &gd_brick_prog, brick_req->op, xdr_gd1_mgmt_brick_op_req);
21ab4e
+
21ab4e
+        if (args.op_ret)
21ab4e
+                goto out;
21ab4e
+
21ab4e
+        ret = dict_get_int32 (args.dict, "clientcount", &client_count);
21ab4e
+        if (ret) {
21ab4e
+                gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
21ab4e
+                        "Couldn't get client count");
21ab4e
+                goto out;
21ab4e
+        }
21ab4e
+
21ab4e
+        fprintf (fp, "Volume%d.Brick%d.client_count: %d\n",
21ab4e
+                 volcount, brickcount, client_count);
21ab4e
+
21ab4e
+        if (client_count == 0) {
21ab4e
+                ret = 0;
21ab4e
+                goto out;
21ab4e
+        }
21ab4e
+
21ab4e
+        int i;
21ab4e
+        for (i = 1; i <= client_count; i++) {
21ab4e
+                memset (key, 0, sizeof (key));
21ab4e
+                snprintf (key, sizeof (key), "client%d.hostname", i-1);
21ab4e
+                ret = dict_get_str (args.dict, key, &clientname);
21ab4e
+                if (ret) {
21ab4e
+                        gf_msg (this->name, GF_LOG_ERROR, 0,
21ab4e
+                                GD_MSG_DICT_GET_FAILED,
21ab4e
+                                "Failed to get client hostname");
21ab4e
+                        goto out;
21ab4e
+                }
21ab4e
+
21ab4e
+                memset (key, 0, sizeof (key));
21ab4e
+                snprintf (key, sizeof (key), "Client%d.hostname", i);
21ab4e
+                fprintf (fp, "Volume%d.Brick%d.%s: %s\n",
21ab4e
+                         volcount, brickcount, key, clientname);
21ab4e
+
21ab4e
+                memset (key, 0, sizeof (key));
21ab4e
+                snprintf (key, sizeof (key), "client%d.bytesread", i-1);
21ab4e
+                ret = dict_get_uint64 (args.dict, key, &bytesread);
21ab4e
+                if (ret) {
21ab4e
+                        gf_msg (this->name, GF_LOG_ERROR, 0,
21ab4e
+                                GD_MSG_DICT_GET_FAILED,
21ab4e
+                                "Failed to get bytesread from client");
21ab4e
+                        goto out;
21ab4e
+                }
21ab4e
+
21ab4e
+                memset (key, 0, sizeof (key));
21ab4e
+                snprintf (key, sizeof (key), "Client%d.bytesread", i);
21ab4e
+                fprintf (fp, "Volume%d.Brick%d.%s: %"PRIu64"\n",
21ab4e
+                         volcount, brickcount, key, bytesread);
21ab4e
+
21ab4e
+                memset (key, 0, sizeof (key));
21ab4e
+                snprintf (key, sizeof (key), "client%d.byteswrite", i-1);
21ab4e
+                ret = dict_get_uint64 (args.dict, key, &byteswrite);
21ab4e
+                if (ret) {
21ab4e
+                        gf_msg (this->name, GF_LOG_ERROR, 0,
21ab4e
+                                GD_MSG_DICT_GET_FAILED,
21ab4e
+                                "Failed to get byteswrite from client");
21ab4e
+                        goto out;
21ab4e
+                }
21ab4e
+
21ab4e
+                memset (key, 0, sizeof (key));
21ab4e
+                snprintf (key, sizeof (key), "Client%d.byteswrite", i);
21ab4e
+                fprintf (fp, "Volume%d.Brick%d.%s: %"PRIu64"\n",
21ab4e
+                         volcount, brickcount, key, byteswrite);
21ab4e
+
21ab4e
+                memset (key, 0, sizeof (key));
21ab4e
+                snprintf (key, sizeof (key), "client%d.opversion", i-1);
21ab4e
+                ret = dict_get_uint32 (args.dict, key, &opversion);
21ab4e
+                if (ret) {
21ab4e
+                        gf_msg (this->name, GF_LOG_ERROR, 0,
21ab4e
+                                GD_MSG_DICT_GET_FAILED,
21ab4e
+                                "Failed to get client opversion");
21ab4e
+                        goto out;
21ab4e
+                }
21ab4e
+
21ab4e
+                memset (key, 0, sizeof (key));
21ab4e
+                snprintf (key, sizeof (key), "Client%d.opversion", i);
21ab4e
+                fprintf (fp, "Volume%d.Brick%d.%s: %"PRIu32"\n",
21ab4e
+                         volcount, brickcount, key, opversion);
21ab4e
+        }
21ab4e
+
21ab4e
+out:
21ab4e
+        if (pending_node)
21ab4e
+                GF_FREE (pending_node);
21ab4e
+
21ab4e
+        if (brick_req)
21ab4e
+                GF_FREE (brick_req);
21ab4e
+
21ab4e
+        return ret;
21ab4e
+}
21ab4e
+
21ab4e
+static int
21ab4e
 glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
21ab4e
 {
21ab4e
         int32_t                      ret = -1;
21ab4e
@@ -5105,6 +5279,7 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
21ab4e
         time_t                       now = 0;
21ab4e
         char                         timestamp[16] = {0,};
21ab4e
         int                          start_index = 0;
21ab4e
+        uint32_t                     get_state_cmd = 0;
21ab4e
 
21ab4e
         char    *vol_type_str = NULL;
21ab4e
         char    *hot_tier_type_str = NULL;
21ab4e
@@ -5227,6 +5402,12 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
21ab4e
         }
21ab4e
         rcu_read_unlock ();
21ab4e
 
21ab4e
+        ret = dict_get_uint32 (dict, "getstate-cmd", &get_state_cmd);
21ab4e
+        if (ret) {
21ab4e
+                gf_msg_debug (this->name, 0, "get-state command type not set");
21ab4e
+                ret = 0;
21ab4e
+        }
21ab4e
+
21ab4e
         count = 0;
21ab4e
         fprintf (fp, "\n[Volumes]\n");
21ab4e
 
21ab4e
@@ -5340,6 +5521,19 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
21ab4e
                                       count <= volinfo->tier_info.hot_brick_count ?
21ab4e
                                       "Hot" : "Cold");
21ab4e
                         }
21ab4e
+
21ab4e
+                        if (get_state_cmd != GF_CLI_GET_STATE_DETAIL)
21ab4e
+                                continue;
21ab4e
+
21ab4e
+                        ret = glusterd_print_client_details (fp, dict,
21ab4e
+                                                             volinfo, count_bkp,
21ab4e
+                                                             brickinfo, count);
21ab4e
+                        if (ret) {
21ab4e
+                                gf_msg (this->name, GF_LOG_ERROR, 0,
21ab4e
+                                        GD_MSG_CLIENTS_GET_STATE_FAILED,
21ab4e
+                                        "Failed to get client details");
21ab4e
+                                goto out;
21ab4e
+                        }
21ab4e
                 }
21ab4e
 
21ab4e
                 count = count_bkp;
21ab4e
diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h
21ab4e
index 36e6ed9..0548bd2 100644
21ab4e
--- a/xlators/mgmt/glusterd/src/glusterd-messages.h
21ab4e
+++ b/xlators/mgmt/glusterd/src/glusterd-messages.h
21ab4e
@@ -41,7 +41,7 @@
21ab4e
 
21ab4e
 #define GLUSTERD_COMP_BASE      GLFS_MSGID_GLUSTERD
21ab4e
 
21ab4e
-#define GLFS_NUM_MESSAGES       606
21ab4e
+#define GLFS_NUM_MESSAGES       599
21ab4e
 
21ab4e
 #define GLFS_MSGID_END          (GLUSTERD_COMP_BASE + GLFS_NUM_MESSAGES + 1)
21ab4e
 /* Messaged with message IDs */
21ab4e
@@ -4849,6 +4849,14 @@
21ab4e
  */
21ab4e
 #define GD_MSG_BRICKPROC_NEW_FAILED                (GLUSTERD_COMP_BASE + 606)
21ab4e
 
21ab4e
+/*!
21ab4e
+ * @messageid
21ab4e
+ * @diagnosis
21ab4e
+ * @recommendedaction
21ab4e
+ *
21ab4e
+ */
21ab4e
+#define GD_MSG_CLIENTS_GET_STATE_FAILED            (GLUSTERD_COMP_BASE + 599)
21ab4e
+
21ab4e
 /*------------*/
21ab4e
 
21ab4e
 #define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
21ab4e
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.h b/xlators/mgmt/glusterd/src/glusterd-syncop.h
21ab4e
index f3425c2..6c5fbf9 100644
21ab4e
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.h
21ab4e
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.h
21ab4e
@@ -49,6 +49,10 @@
21ab4e
         }                                                                      \
21ab4e
 } while (0)
21ab4e
 
21ab4e
+int32_t
21ab4e
+gd_syncop_brick_op_cbk (struct rpc_req *req, struct iovec *iov,
21ab4e
+                        int count, void *myframe);
21ab4e
+
21ab4e
 int gd_syncop_submit_request (struct rpc_clnt *rpc, void *req, void *local,
21ab4e
                               void *cookie, rpc_clnt_prog_t *prog, int procnum,
21ab4e
                               fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
21ab4e
-- 
21ab4e
1.8.3.1
21ab4e