Bug 1353156

Summary: [RFE] CLI to get local state representation for a cluster
Product: [Community] GlusterFS Reporter: Samikshan Bairagya <sbairagy>
Component: glusterdAssignee: Samikshan Bairagya <sbairagy>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: high    
Version: mainlineCC: amukherj, bugs, pcuzner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.9.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1353427 (view as bug list) Environment:
Last Closed: 2017-03-27 18:20:24 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1353427    
Attachments:
Description Flags
Example state representation for a 2 node cluster with 3 volumes as seen locally from one of the nodes none

Description Samikshan Bairagya 2016-07-06 10:04:04 UTC
Description of problem:

There is no existing CLI that can be used to get the current local state representation of the cluster as maintained in glusterd in a readable as well as parseable format. The existing "statedump" infrastructure dumps stats related to memory allocation for a daemon by passing SIGUSR1 to it. This while useful for debugging purposes, does not reflect the local state representation of the cluster.

Expected results:

# gluster get-state [DAEMON] odir <path/to/output/dir>

This would dump data points that reflect the local state representation of the cluster as maintained in glusterd (by default if no daemon name is specified) to a file (say glusterd-state) inside the specified output directory. The option for specifying the daemon name would leave room to add support for other daemons as well. This data if required can then be parsed by external applications to represent the cluster state as obtained from glusterd in any other model.

Comment 1 Vijay Bellur 2016-07-07 17:26:47 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#1) for review on master by Samikshan Bairagya (samikshan)

Comment 2 Vijay Bellur 2016-07-08 04:12:42 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#2) for review on master by Samikshan Bairagya (samikshan)

Comment 3 Vijay Bellur 2016-07-08 04:59:05 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#3) for review on master by Samikshan Bairagya (samikshan)

Comment 4 Vijay Bellur 2016-07-14 05:57:42 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#4) for review on master by Samikshan Bairagya (samikshan)

Comment 5 Vijay Bellur 2016-07-14 22:15:23 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#5) for review on master by Samikshan Bairagya (samikshan)

Comment 6 Vijay Bellur 2016-07-15 08:12:03 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#6) for review on master by Samikshan Bairagya (samikshan)

Comment 7 Vijay Bellur 2016-07-15 09:54:46 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#7) for review on master by Samikshan Bairagya (samikshan)

Comment 8 Vijay Bellur 2016-07-27 03:53:26 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#8) for review on master by Samikshan Bairagya (samikshan)

Comment 9 Vijay Bellur 2016-08-01 11:24:57 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#9) for review on master by Samikshan Bairagya (samikshan)

Comment 10 Vijay Bellur 2016-08-01 14:07:36 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#10) for review on master by Samikshan Bairagya (samikshan)

Comment 11 Vijay Bellur 2016-08-05 11:57:22 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#11) for review on master by Samikshan Bairagya (samikshan)

Comment 12 Vijay Bellur 2016-08-11 13:48:24 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#12) for review on master by Samikshan Bairagya (samikshan)

Comment 13 Vijay Bellur 2016-08-12 14:19:45 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#13) for review on master by Samikshan Bairagya (samikshan)

Comment 14 Vijay Bellur 2016-08-18 05:47:52 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#14) for review on master by Samikshan Bairagya (samikshan)

Comment 15 Vijay Bellur 2016-08-18 05:53:27 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#15) for review on master by Samikshan Bairagya (samikshan)

Comment 16 Worker Ant 2016-08-24 17:41:04 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#16) for review on master by Samikshan Bairagya (samikshan)

Comment 17 Worker Ant 2016-08-26 08:55:50 UTC
REVIEW: http://review.gluster.org/14873 (glusterd/cli: cli to get local state representation from glusterd) posted (#17) for review on master by Samikshan Bairagya (samikshan)

Comment 18 Worker Ant 2016-08-26 15:23:42 UTC
COMMIT: http://review.gluster.org/14873 committed in master by Atin Mukherjee (amukherj) 
------
commit 4a3454753f6e4ddc309c8d1cb11a6e4e432c1da6
Author: Samikshan Bairagya <samikshan>
Date:   Thu Jul 7 20:33:02 2016 +0530

    glusterd/cli: cli to get local state representation from glusterd
    
    Currently there is no existing CLI that can be used to get the
    local state representation of the cluster as maintained in glusterd
    in a readable as well as parseable format.
    
    The CLI added has the following usage:
    
     # gluster get-state [daemon] [odir <path/to/output/dir>] [file <filename>]
    
    This would dump data points that reflect the local state
    representation of the cluster as maintained in glusterd (no other
    daemons are supported as of now) to a file inside the specified
    output directory. The default output directory and filename is
    /var/run/gluster and glusterd_state_<timestamp> respectively. The
    option for specifying the daemon name leaves room to add support for
    other daemons in the future. Following are the data points captured
    as of now to represent the state from the local glusterd pov:
    
     * Peer:
        - Primary hostname
        - uuid
        - state
        - connection status
        - List of hostnames
    
     * Volumes:
        - name, id, transport type, status
        - counts: bricks, snap, subvol, stripe, arbiter, disperse,
     redundancy
        - snapd status
        - quorum status
        - tiering related information
        - rebalance status
        - replace bricks status
        - snapshots
    
     * Bricks:
        - Path, hostname (for all bricks these info will be shown)
        - port, rdma port, status, mount options, filesystem type and
    signed in status for bricks running locally.
    
     * Services:
        - name, online status for initialised services
    
     * Others:
        - Base port, last allocated port
        - op-version
        - MYUUID
    
    Change-Id: I4a45cc5407ab92d8afdbbd2098ece851f7e3d618
    BUG: 1353156
    Signed-off-by: Samikshan Bairagya <samikshan>
    Reviewed-on: http://review.gluster.org/14873
    Reviewed-by: Avra Sengupta <asengupt>
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Atin Mukherjee <amukherj>

Comment 19 Samikshan Bairagya 2016-08-31 10:35:48 UTC
Created attachment 1196302 [details]
Example state representation for a 2 node cluster with 3 volumes as seen locally from one of the nodes

Comment 20 Shyamsundar 2017-03-27 18:20:24 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.9.0, please open a new bug report.

glusterfs-3.9.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/gluster-users/2016-November/029281.html
[2] https://www.gluster.org/pipermail/gluster-users/