Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1232199

Summary: Skip zero byte files when triggering signing
Product: [Community] GlusterFS Reporter: Raghavendra Bhat <rabhat>
Component: bitrotAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact: bugs <bugs>
Priority: unspecified    
Version: 3.7.1CC: annair, bugs, nsathyan, rmekala, vbellur, vshankar
Target Milestone: ---Keywords: Patch, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.7.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1224611 Environment:
Last Closed: 2015-07-30 09:48:32 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: 1224611    
Bug Blocks: 1233025    

Description Raghavendra Bhat 2015-06-16 09:31:09 UTC
+++ This bug was initially created as a clone of Bug #1224611 +++

Description of problem:
commit c93c433 introduces signing of objects during write/truncate [first modification]. This avoids signing files which were never modified after creation.

But, bitrot daemon sapwns a filesystem crawler (one top-down scan of the filesystem) that triggers signing of files which may have got missed in the last run (due to disabling bitrot and other scenarios). Triggering signing does not take into account the file size and hence triggers signing for empty files.

Fix: The "oneshot" crawler needs to take into account the file size to counter this issue. Moreover, this check needs to be done *only* when an object has no bitrot extended attributed (version and signature). This check is required to handle truncates.

Although harmless, this situation can be avoided with some minor modifications.

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

How reproducible:
always

Steps to Reproduce:
1. Create a Gluster volume and enable bitrot
2. create some empty files
3. before the files can be signed restart bitrot daemon

Actual results:
Empty files are signed

Expected results:
Since bitrot daemon signs files only on modification, empty files need not be signed.

Additional info:
None

--- Additional comment from Niels de Vos on 2015-06-02 04:20:20 EDT ---

The required changes to fix this bug have not made it into glusterfs-3.7.1. This bug is now getting tracked for glusterfs-3.7.2.

--- Additional comment from Anand Avati on 2015-06-02 08:54:35 EDT ---

REVIEW: http://review.gluster.org/10947 (features/bit-rot: check for both inmemory and ondisk staleness) posted (#2) for review on master by Raghavendra Bhat (raghavendra)

--- Additional comment from Anand Avati on 2015-06-12 06:45:24 EDT ---

REVIEW: http://review.gluster.org/10947 (features/bit-rot: check for both inmemory and ondisk staleness) posted (#3) for review on master by Venky Shankar (vshankar)

--- Additional comment from Anand Avati on 2015-06-15 00:47:06 EDT ---

REVIEW: http://review.gluster.org/10947 (features/bit-rot: check for both inmemory and ondisk staleness) posted (#4) for review on master by Venky Shankar (vshankar)

--- Additional comment from Anand Avati on 2015-06-15 05:41:49 EDT ---

REVIEW: http://review.gluster.org/10947 (features/bit-rot: check for both inmemory and ondisk staleness) posted (#5) for review on master by Raghavendra Bhat (raghavendra)

--- Additional comment from Anand Avati on 2015-06-15 23:07:24 EDT ---

COMMIT: http://review.gluster.org/10947 committed in master by Venky Shankar (vshankar) 
------
commit 60b6e5d2c3442ea0f7f85374d6613cd0dd76604c
Author: Raghavendra Bhat <raghavendra>
Date:   Wed May 27 17:00:36 2015 +0530

    features/bit-rot: check for both inmemory and ondisk staleness
    
    * Let bit-rot stub check both on disk ongoing version, signed version xattrs and
      the in memory flags in the inode and then decide whether the inode is stale or
      not. This information is used by one shot crawler in BitD to decide whether to
      trigger the sign for the object or skip it.
    
      NOTE: The above check should be done only for BitD. For scrubber its still the
            old way of comparing on disk ongoing version with signed version.
    
    * BitD's one shot crawler should not sign zero byte objects if they do not contain
      signature. (Means the object was just created and nothing was written to it).
    
    Change-Id: I6941aefc2981bf79a6aeb476e660f79908e165a8
    BUG: 1224611
    Signed-off-by: Raghavendra Bhat <raghavendra>
    Reviewed-on: http://review.gluster.org/10947
    Reviewed-by: Venky Shankar <vshankar>
    Tested-by: Venky Shankar <vshankar>
    Tested-by: Gluster Build System <jenkins.com>

Comment 1 Niels de Vos 2015-06-20 10:09:03 UTC
Unfortunately glusterfs-3.7.2 did not contain a code change that was associated with this bug report. This bug is now proposed to be a blocker for glusterfs-3.7.3.

Comment 2 Anand Avati 2015-06-27 02:59:21 UTC
COMMIT: http://review.gluster.org/11249 committed in release-3.7 by Venky Shankar (vshankar) 
------
commit 555a8a14d70676a3cbd0816d8d59c557c53bccd5
Author: Raghavendra Bhat <raghavendra>
Date:   Wed May 27 17:00:36 2015 +0530

    features/bit-rot: check for both inmemory and ondisk staleness
    
        Backport of http://review.gluster.org/10947
    
    * Let bit-rot stub check both on disk ongoing version, signed version xattrs and
      the in memory flags in the inode and then decide whether the inode is stale or
      not. This information is used by one shot crawler in BitD to decide whether to
      trigger the sign for the object or skip it.
    
      NOTE: The above check should be done only for BitD. For scrubber its still the
            old way of comparing on disk ongoing version with signed version.
    
    * BitD's one shot crawler should not sign zero byte objects if they do not contain
      signature. (Means the object was just created and nothing was written to it).
    
    Change-Id: I580b45b85f62fc075616ee3da9c15a3c8335d7a8
    BUG: 1232199
    Signed-off-by: Raghavendra Bhat <raghavendra>
    Reviewed-on: http://review.gluster.org/11249
    Tested-by: Gluster Build System <jenkins.com>
    Tested-by: NetBSD Build System <jenkins.org>
    Reviewed-by: Venky Shankar <vshankar>

Comment 3 Kaushal 2015-07-30 09:48:32 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.7.3, please open a new bug report.

glusterfs-3.7.3 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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/12078
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user