Bug 1259651 - 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: mainline
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Krutika Dhananjay
QA Contact: bugs@gluster.org
URL:
Whiteboard:
Depends On:
Blocks: 1259726
TreeView+ depends on / blocked
 
Reported: 2015-09-03 09:36 UTC by Krutika Dhananjay
Modified: 2016-06-16 13:34 UTC (History)
2 users (show)

Fixed In Version: glusterfs-3.8rc2
Clone Of:
: 1259726 (view as bug list)
Environment:
Last Closed: 2016-06-16 13:34:51 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Krutika Dhananjay 2015-09-03 09:36:05 UTC
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:

Comment 1 Vijay Bellur 2015-09-03 10:31:36 UTC
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 2 Vijay Bellur 2015-09-03 12:49:00 UTC
REVIEW: http://review.gluster.org/12099 (features/shard: Fix incorrect op_ret in READV) posted (#2) for review on master by Krutika Dhananjay (kdhananj)

Comment 3 Vijay Bellur 2015-09-03 15:14:41 UTC
COMMIT: http://review.gluster.org/12099 committed in master by Jeff Darcy (jdarcy) 
------
commit fe7b37960bbef791d9bed79760b61b1d40ca81cd
Author: Krutika Dhananjay <kdhananj>
Date:   Thu Sep 3 15:47:01 2015 +0530

    features/shard: Fix incorrect op_ret in READV
    
    Change-Id: I31ac99b290f82f4b74236c206193f7641c73d4dc
    BUG: 1259651
    Signed-off-by: Krutika Dhananjay <kdhananj>
    Reviewed-on: http://review.gluster.org/12099
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Tested-by: NetBSD Build System <jenkins.org>

Comment 4 Niels de Vos 2016-06-16 13:34:51 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.8.0, please open a new bug report.

glusterfs-3.8.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://blog.gluster.org/2016/06/glusterfs-3-8-released/
[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.