Bug 1259726 - sharding - Fix reads on zero-byte shards representing holes in the file
Summary: sharding - Fix reads on zero-byte shards representing holes in the file
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: sharding
Version: 3.7.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Krutika Dhananjay
QA Contact: bugs@gluster.org
URL:
Whiteboard:
Depends On: 1259651
Blocks: Gluster-HC-1 glusterfs-3.7.5
TreeView+ depends on / blocked
 
Reported: 2015-09-03 12:41 UTC by Krutika Dhananjay
Modified: 2015-12-01 16:45 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.7.5
Doc Type: Bug Fix
Doc Text:
Clone Of: 1259651
Environment:
Last Closed: 2015-10-14 10:29:41 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Krutika Dhananjay 2015-09-03 12:41:23 UTC
+++ This bug was initially created as a clone of Bug #1259651 +++

Description of problem:

Found a bug while reading code where if a readv() falls partly in a region of the sharded file that contains holes which are represented by the existence of zero-byte shards (for instance block-0 file is one example which will exist by default since creation under its parent directory but _may_ not have any data written into it and there could be other blocks that are written to by the application). In this case, a read on such a shard would return 0 bytes, although internally shard translator is supposed to interpret that as a hole (filled with zeroes) and update op_ret (the final exit status of the read which is the number of bytes read) based on the following logic:

  read size of ith shard = { shard_block_size if (last_shard_index > i),
                             (offset % shard_block_size)     otherwise 

Failing to do so could cause reads from the application to prematurely exit if shard translator returns "zero bytes read" status,
or in some cases return fewer bytes read than are actually filled in the actual buffer, which could mislead the translators above shard or even the application.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Vijay Bellur on 2015-09-03 06:31:36 EDT ---

REVIEW: http://review.gluster.org/12099 (features/shard: Fix incorrect op_ret in READV) posted (#1) for review on master by Krutika Dhananjay (kdhananj)

Comment 1 Vijay Bellur 2015-09-03 12:57:54 UTC
REVIEW: http://review.gluster.org/12101 (features/shard: Fix incorrect op_ret in READV) posted (#1) for review on release-3.7 by Krutika Dhananjay (kdhananj)

Comment 2 Vijay Bellur 2015-09-04 06:14:21 UTC
COMMIT: http://review.gluster.org/12101 committed in release-3.7 by Pranith Kumar Karampuri (pkarampu) 
------
commit 5bb4143e0a59ad69ac6ef74c2957784cf660c1fd
Author: Krutika Dhananjay <kdhananj>
Date:   Thu Sep 3 15:47:01 2015 +0530

    features/shard: Fix incorrect op_ret in READV
    
            Backport of: http://review.gluster.org/#/c/12099/
    
    Change-Id: Ica5f951a3cb2243fe179fe84a27c369bd7de23cf
    BUG: 1259726
    Signed-off-by: Krutika Dhananjay <kdhananj>
    Reviewed-on: http://review.gluster.org/12101
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Tested-by: Gluster Build System <jenkins.com>
    Tested-by: NetBSD Build System <jenkins.org>

Comment 3 Pranith Kumar K 2015-10-14 10:29:41 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-glusterfs-3.7.5, please open a new bug report.

glusterfs-glusterfs-3.7.5 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://www.gluster.org/pipermail/gluster-users/2015-October/023968.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 4 Pranith Kumar K 2015-10-14 10:38:31 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.5, please open a new bug report.

glusterfs-3.7.5 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://www.gluster.org/pipermail/gluster-users/2015-October/023968.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


Note You need to log in before you can comment on or make changes to this bug.