Bug 1329211

Summary: values for Number of Scrubbed files, Number of Unsigned files, Last completed scrub time and Duration of last scrub are shown as zeros in bit rot scrub status
Product: [Community] GlusterFS Reporter: Kotresh HR <khiremat>
Component: bitrotAssignee: Kotresh HR <khiremat>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact: bugs <bugs>
Priority: unspecified    
Version: mainlineCC: asrivast, bugs, knarra, mzywusko, rabhat, rcyriac, rhinduja, sanandpa, sankarshan, smohan, vagarwal, vshankar
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1299737
: 1332072 (view as bug list) Environment:
Last Closed: 2017-03-08 09:19:57 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: 1285226    
Bug Blocks: 1291546, 1299737, 1332072, 1332839    

Comment 1 Kotresh HR 2016-04-21 12:29:36 UTC
Description of problem:
When user runs "gluster volume bitrot <vol_name> scrub status" values for Number of Scrubbed files, Number of Unsigned files, Last completed scrub time and Duration of last scrub are shown as zero.

[root@linux1]# gluster vol bitrot vol1 scrub status

Volume name : vol1

State of scrub: Active

Scrub impact: lazy

Scrub frequency: hourly

Bitrot error log location: /var/log/glusterfs/bitd.log

Scrubber error log location: /var/log/glusterfs/scrub.log


=========================================================

Node name: localhost

Number of Scrubbed files: 0

Number of Unsigned files: 0

Last completed scrub time: 0

Duration of last scrub: 0

Error count: 1

Corrupted object's:

522a6019-bde9-4963-b1d6-bbdaf27c788a


=========================================================

Node name: 10.70.36.57

Number of Scrubbed files: 0

Number of Unsigned files: 0

Last completed scrub time: 0

Duration of last scrub: 0

Error count: 0

=========================================================


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


How reproducible:
Always

Steps to Reproduce:
1. create a volume and enable bitrot on that.
2. Run the command gluster volume bitrot <vol_name> scrub status

Actual results:
values for  Number of Scrubbed files, Number of Unsigned files, Last completed scrub time and Duration of last scrub are shown as zero.

Expected results:
actual Values should be shown for Number of Scrubbed files, Number of Unsigned files, Last completed scrub time and Duration of last scrub and not zeros.

Comment 2 Vijay Bellur 2016-04-21 12:54:24 UTC
REVIEW: http://review.gluster.org/14044 (features/bitrot: Introduce scrubber monitor thread) posted (#1) for review on master by Kotresh HR (khiremat)

Comment 3 Vijay Bellur 2016-04-28 19:04:47 UTC
REVIEW: http://review.gluster.org/14044 (features/bitrot: Introduce scrubber monitor thread) posted (#2) for review on master by Kotresh HR (khiremat)

Comment 4 Vijay Bellur 2016-04-29 15:23:06 UTC
REVIEW: http://review.gluster.org/14044 (features/bitrot: Introduce scrubber monitor thread) posted (#3) for review on master by Kotresh HR (khiremat)

Comment 5 Vijay Bellur 2016-04-29 15:23:11 UTC
REVIEW: http://review.gluster.org/14120 (glusterd/bitrot: Fix bit-rot scrub status) posted (#1) for review on master by Kotresh HR (khiremat)

Comment 6 Vijay Bellur 2016-04-29 15:23:16 UTC
REVIEW: http://review.gluster.org/14121 (glusterd/bitrot: Unmask scrub statistics) posted (#1) for review on master by Kotresh HR (khiremat)

Comment 7 Vijay Bellur 2016-04-29 15:32:40 UTC
REVIEW: http://review.gluster.org/14121 (cli/bitrot: Unmask scrub statistics) posted (#2) for review on master by Kotresh HR (khiremat)

Comment 8 Vijay Bellur 2016-04-29 19:21:56 UTC
REVIEW: http://review.gluster.org/14121 (cli/bitrot: Unmask scrub statistics) posted (#3) for review on master by Kotresh HR (khiremat)

Comment 9 Vijay Bellur 2016-04-29 19:22:01 UTC
REVIEW: http://review.gluster.org/14120 (glusterd/bitrot: Fix bit-rot scrub status) posted (#2) for review on master by Kotresh HR (khiremat)

Comment 10 Vijay Bellur 2016-04-29 19:22:06 UTC
REVIEW: http://review.gluster.org/14044 (features/bitrot: Introduce scrubber monitor thread) posted (#4) for review on master by Kotresh HR (khiremat)

Comment 11 Vijay Bellur 2016-04-29 21:04:59 UTC
REVIEW: http://review.gluster.org/14121 (cli/bitrot: Unmask scrub statistics) posted (#4) for review on master by Kotresh HR (khiremat)

Comment 12 Vijay Bellur 2016-04-29 21:05:05 UTC
REVIEW: http://review.gluster.org/14120 (glusterd/bitrot: Fix bit-rot scrub status) posted (#3) for review on master by Kotresh HR (khiremat)

Comment 13 Vijay Bellur 2016-04-29 21:05:11 UTC
REVIEW: http://review.gluster.org/14044 (features/bitrot: Introduce scrubber monitor thread) posted (#5) for review on master by Kotresh HR (khiremat)

Comment 14 Vijay Bellur 2016-04-30 11:51:21 UTC
REVIEW: http://review.gluster.org/14044 (features/bitrot: Introduce scrubber monitor thread) posted (#6) for review on master by Kotresh HR (khiremat)

Comment 15 Vijay Bellur 2016-05-02 04:21:14 UTC
COMMIT: http://review.gluster.org/14120 committed in master by Atin Mukherjee (amukherj) 
------
commit 3c01660f63a32e53395e9af13f33ee5439932cdf
Author: Kotresh HR <khiremat>
Date:   Wed Apr 20 23:49:39 2016 +0530

    glusterd/bitrot: Fix bit-rot scrub status
    
    Few of the dictionary values were not allocated and
    set. This patch allocates them and set.
    
    Change-Id: Ic61c1209b238e45219793fd8bec92235adfbd013
    BUG: 1329211
    Signed-off-by: Kotresh HR <khiremat>
    Reviewed-on: http://review.gluster.org/14120
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.com>
    Reviewed-by: Venky Shankar <vshankar>
    Reviewed-by: Atin Mukherjee <amukherj>

Comment 16 Vijay Bellur 2016-05-02 04:33:36 UTC
COMMIT: http://review.gluster.org/14044 committed in master by Venky Shankar (vshankar) 
------
commit db468e4361315a91aaeeaa14ff7e6b448e2c8599
Author: Kotresh HR <khiremat>
Date:   Fri Apr 29 17:45:31 2016 +0530

    features/bitrot: Introduce scrubber monitor thread
    
    The patch does following changes.
    
     1. Introduce scrubber monitor thread.
     2. Move scrub status related APIs to separate file
        and make part of libbitrot library.
    
    Problem:
         Earlier, each child of the scrubber was maintaining
    the state machine and hence there was no way to track
    the start and end time of scrubbing as each brick has
    it's own start and end time. Also each brick was maintaining
    it's own timer wheel instance. It was also not possible
    to get scrubbed files count per session as we could not
    get last child which finishes scrubbing to reset it to
    zero.
    
    Solution:
        Introduce scrubber monitor thread. It does following.
    
     1. Maintains the scrubber state machine. Earlier each
        child had it's own state machine. Now, only monitor
        maintains on behalf of all it's children.
     2. Maintains the timer wheel instance. Earlier each
        child had it's own timer wheel instance. Now, only
        monitor maintains on behalf of all it's children.
    
    As a result, we can track the scrub statistics easily
    and correctly.
    
    Change-Id: Ic6e34ffa57984bd7a5ee81f4e263342bc1d9b302
    BUG: 1329211
    Signed-off-by: Kotresh HR <khiremat>
    Reviewed-on: http://review.gluster.org/14044
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.com>
    Reviewed-by: Venky Shankar <vshankar>

Comment 17 Vijay Bellur 2016-05-02 04:58:31 UTC
COMMIT: http://review.gluster.org/14121 committed in master by Atin Mukherjee (amukherj) 
------
commit 232b10d68f47eee4c58f0d44891e52026b98d288
Author: Kotresh HR <khiremat>
Date:   Wed Apr 20 17:53:50 2016 +0530

    cli/bitrot: Unmask scrub statistics
    
    Revert the commit 2a37dbd845348a774f45c4d77cffebc32c749251
    The scrub statistics were masked because of inaccurate
    stats. Now with http://review.gluster.org/#/c/14044/
    it's fixed, hence unmasking it.
    
    Change-Id: Iffff5f48eb8121b617af82ecfb70bec5b2772c23
    BUG: 1329211
    Signed-off-by: Kotresh HR <khiremat>
    Reviewed-on: http://review.gluster.org/14121
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.com>
    Reviewed-by: Venky Shankar <vshankar>
    Reviewed-by: Atin Mukherjee <amukherj>

Comment 18 Vijay Bellur 2016-05-02 10:29:46 UTC
REVIEW: http://review.gluster.org/14146 (features/bitrot: Fix Compilation Warning!!!) posted (#1) for review on master by Kotresh HR (khiremat)

Comment 19 Kotresh HR 2016-05-03 06:51:48 UTC
*** Bug 1285989 has been marked as a duplicate of this bug. ***

Comment 20 Kotresh HR 2017-03-08 09:19:57 UTC
v3.10.0 Contains the Fix