Bug 1382690

Summary: output of heal info and heal info --xml are not consistent (throwing different formats of output )
Product: Red Hat Gluster Storage Reporter: Nag Pavan Chilakam <nchilaka>
Component: replicateAssignee: Pranith Kumar K <pkarampu>
Status: CLOSED NOTABUG QA Contact: Nag Pavan Chilakam <nchilaka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.2CC: rhs-bugs, sabose, storage-qa-internal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-20 08:52:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Nag Pavan Chilakam 2016-10-07 12:20:14 UTC
Description of problem:
===================
(note this was run at the same time, so there was no change in setup b/w the two commands)
When we issue heal info command, it displays o/p as below

[root@dhcp35-179 ~]# gluster v heal afrvol info
Brick 10.70.35.179:/rhs/brick1/afrvol
Status: Transport endpoint is not connected
Number of entries: -

Brick 10.70.35.180:/rhs/brick1/afrvol
/ 
/hello1 
/hello2 
/hello5 
/hello6 
/hello7 
/hello8 
/hello10 
Status: Connected
Number of entries: 8

Brick 10.70.35.9:/rhs/brick1/afrvol
Status: Transport endpoint is not connected
Number of entries: -

Brick 10.70.35.153:/rhs/brick1/afrvol
/ 
/hello3 
/hello4 
/hello9 
Status: Connected
Number of entries: 4



But for the same listing using --xml , the entries even have gfid displayed.
as below


root@dhcp35-179 ~]# gluster v heal afrvol info --xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <healInfo>
    <bricks>
      <brick hostUuid="-">
        <name>10.70.35.179:/rhs/brick1/afrvol</name>
        <status>Transport endpoint is not connected</status>
        <numberOfEntries>-</numberOfEntries>
      </brick>
      <brick hostUuid="39e568ea-b190-4dae-aca0-0b9d83479438">
        <name>10.70.35.180:/rhs/brick1/afrvol</name>
        <file gfid="00000000-0000-0000-0000-000000000001">/</file>
        <file gfid="f4c970d0-a4f9-4c0a-ad02-0748c20b88e9">/hello1</file>
        <file gfid="296b971c-ecc3-4e79-a1a0-a5b4d315a218">/hello2</file>
        <file gfid="2a6c4c56-6b1f-4775-81cf-6ec6b8e17a77">/hello5</file>
        <file gfid="e28c1aae-d79e-4c76-8564-2b996148f814">/hello6</file>
        <file gfid="5ca405cd-9979-4205-aec9-c918a13aa27f">/hello7</file>
        <file gfid="b41dbd3e-8240-41c6-a47a-4aabff983299">/hello8</file>
        <file gfid="24255730-3c45-4aae-9107-9ab919b78f85">/hello10</file>
        <status>Connected</status>
        <numberOfEntries>8</numberOfEntries>
      </brick>
      <brick hostUuid="-">
        <name>10.70.35.9:/rhs/brick1/afrvol</name>
        <status>Transport endpoint is not connected</status>
        <numberOfEntries>-</numberOfEntries>
      </brick>
      <brick hostUuid="4411ff58-c305-4064-bc67-42538d0cbed5">
        <name>10.70.35.153:/rhs/brick1/afrvol</name>
        <file gfid="00000000-0000-0000-0000-000000000001">/</file>
        <file gfid="ff916223-6810-4df1-8687-bd3b87a443ca">/hello3</file>
        <file gfid="ecc9a62f-8a2f-43b4-9618-b04c7c3e2e25">/hello4</file>
        <file gfid="35fdf539-8e58-43b6-b94e-51a5c78d2294">/hello9</file>
        <status>Connected</status>
        <numberOfEntries>4</numberOfEntries>
      </brick>
    </bricks>
  </healInfo>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr/>
</cliOutput>
[root@dhcp35-179 ~]# 


I feel both the o/p must be consistent

Version-Release number of selected component (if applicable):

[root@dhcp35-191 ~]# rpm -qa|grep gluster
glusterfs-libs-3.8.4-1.el7rhgs.x86_64
glusterfs-fuse-3.8.4-1.el7rhgs.x86_64
glusterfs-debuginfo-3.8.4-1.el7rhgs.x86_64
glusterfs-3.8.4-1.el7rhgs.x86_64
glusterfs-api-3.8.4-1.el7rhgs.x86_64
glusterfs-cli-3.8.4-1.el7rhgs.x86_64
glusterfs-events-3.8.4-1.el7rhgs.x86_64
glusterfs-rdma-3.8.4-1.el7rhgs.x86_64
glusterfs-client-xlators-3.8.4-1.el7rhgs.x86_64
glusterfs-server-3.8.4-1.el7rhgs.x86_64
python-gluster-3.8.4-1.el7rhgs.noarch
glusterfs-devel-3.8.4-1.el7rhgs.x86_64


raised as part of qatp validation of bz#1366128 - "heal info --xml" not showing the brick name of offline bricks.

Comment 2 Pranith Kumar K 2016-10-14 16:41:53 UTC
Nag,
     We print the gfids in XML because there is a requirement from the UI that needs to process them and remove any duplicates if they want to, based on gfid, i.e. the system will process this information and remove any duplicates. Where as the heal info output is for humans to see, so we don't print the gfids if we can show the file-paths. That is the rationale for the difference in the outputs.

Sahina,
    We don't show gfids to the users even in the UI right?

Pranith

Comment 3 Sahina Bose 2016-10-20 08:30:44 UTC
Pranith - right. the gfids are not shown in the UI. the requirement was raised to avoid duplicate counts in the output.
Nag, xml output always has additional information as this is meant to be machine/script parseable - so I see no issue here.

Comment 4 Pranith Kumar K 2016-10-20 08:52:05 UTC
For now, closing the bug based on Sahina's inputs.