Bug 1259726 - sharding - Fix reads on zero-byte shards representing holes in the file
sharding - Fix reads on zero-byte shards representing holes in the file
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: sharding (Show other bugs)
3.7.4
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Krutika Dhananjay
bugs@gluster.org
: Triaged
Depends On: 1259651
Blocks: Gluster-HC-1 glusterfs-3.7.5
  Show dependency treegraph
 
Reported: 2015-09-03 08:41 EDT by Krutika Dhananjay
Modified: 2015-12-01 11:45 EST (History)
1 user (show)

See Also:
Fixed In Version: glusterfs-3.7.5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1259651
Environment:
Last Closed: 2015-10-14 06:29:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Krutika Dhananjay 2015-09-03 08:41:23 EDT
+++ 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@redhat.com)
Comment 1 Vijay Bellur 2015-09-03 08:57:54 EDT
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@redhat.com)
Comment 2 Vijay Bellur 2015-09-04 02:14:21 EDT
COMMIT: http://review.gluster.org/12101 committed in release-3.7 by Pranith Kumar Karampuri (pkarampu@redhat.com) 
------
commit 5bb4143e0a59ad69ac6ef74c2957784cf660c1fd
Author: Krutika Dhananjay <kdhananj@redhat.com>
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@redhat.com>
    Reviewed-on: http://review.gluster.org/12101
    Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Comment 3 Pranith Kumar K 2015-10-14 06:29:41 EDT
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 06:38:31 EDT
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.