diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2017-07-24 19:47:07 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-07-26 10:05:24 +0000 |
commit | 555990188ae7fabd4ca36c07ddaa92a39dccc813 (patch) | |
tree | 8ab6c9c764ce0b51052c42368bbc754eff16ae8f /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | e21c915679244ddc1fae886e52badf02b4d95efc (diff) |
glusterd: highlight arbiter brick in get-state
Fixes: #278
Change-Id: I1af5255127457a70e6362a2c20c53ee533e27c29
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
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>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 26 |
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 126d5f211d0..ba6f4afa94d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -5232,6 +5232,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; @@ -5459,7 +5460,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)) |