summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-07-24 19:47:07 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-07-31 17:31:40 +0000
commitb81fc4a89b70336607e7734ca30e4152a415d237 (patch)
tree5d30b1473f87484d4965a9ad3bfed4aef15340e1
parent6c10351a99005c358ccca8b6c4ee21e009618dd9 (diff)
glusterd: highlight arbiter brick in get-state
>Reviewed-on: https://review.gluster.org/17864 >Reviewed-by: Ravishankar N <ravishankar@redhat.com> >Reviewed-by: Samikshan Bairagya <samikshan@gmail.com> >Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> >Smoke: Gluster Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> >(cherry picked from commit 555990188ae7fabd4ca36c07ddaa92a39dccc813) Fixes: #278 Change-Id: I1af5255127457a70e6362a2c20c53ee533e27c29 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/17875 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 3a6445d8ace..05587316246 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -5231,6 +5231,7 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
uint32_t get_state_cmd = 0;
uint64_t memtotal = 0;
uint64_t memfree = 0;
+ int start_index = 0;
char *vol_type_str = NULL;
char *hot_tier_type_str = NULL;
@@ -5429,7 +5430,30 @@ glusterd_get_state (rpcsvc_request_t *req, dict_t *dict)
brickinfo->path);
fprintf (fp, "Volume%d.Brick%d.hostname: %s\n",
count_bkp, count, brickinfo->hostname);
-
+ /* Determine which one is the arbiter brick */
+ if (volinfo->arbiter_count == 1) {
+ if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
+ if (volinfo->tier_info.cold_replica_count != 1) {
+ start_index =
+ volinfo->tier_info.hot_brick_count + 1;
+ if (count >= start_index &&
+ ((count - start_index + 1) %
+ volinfo->tier_info.cold_replica_count == 0)) {
+ fprintf (fp, "Volume%d.Brick%d."
+ "is_arbiter: 1\n",
+ count_bkp,
+ count);
+ }
+ }
+ } else {
+ if (count %
+ volinfo->replica_count == 0) {
+ fprintf (fp, "Volume%d.Brick%d."
+ "is_arbiter: 1\n",
+ count_bkp, count);
+ }
+ }
+ }
/* Add following information only for bricks
* local to current node */
if (gf_uuid_compare (brickinfo->uuid, MY_UUID))