Bug 1161885

Summary: Possible file corruption on dispersed volumes
Product: [Community] GlusterFS Reporter: Xavi Hernandez <jahernan>
Component: disperseAssignee: Xavi Hernandez <jahernan>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: bugs, gluster-bugs, iesool, rabhat
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.6.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1161621 Environment:
Last Closed: 2015-01-28 14:26:56 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: 1161621    
Bug Blocks: 1163723    

Description Xavi Hernandez 2014-11-08 20:16:04 UTC
+++ This bug was initially created as a clone of Bug #1161621 +++

Description of problem:

Doing tests while debugging other issues I've seen that some files get corrupted. Repeating the write sequence used to generate the corrupt file does not replicate the problem. The issue may be related to an interaction with other operations. I need more testing.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Anand Avati on 2014-11-08 21:14:01 CET ---

REVIEW: http://review.gluster.org/9079 (ec: Remove O_APPEND from flags on create and open.) posted (#1) for review on master by Xavier Hernandez (xhernandez)

--- Additional comment from Xavier Hernandez on 2014-11-08 21:15:40 CET ---

The problem was caused by files opened with O_APPEND flag. This caused bricks to write on wrong offsets, corrupting the file. The fix solves the problem.

Comment 1 Anand Avati 2014-11-08 20:19:49 UTC
REVIEW: http://review.gluster.org/9080 (ec: Remove O_APPEND from flags on create and open.) posted (#1) for review on release-3.6 by Xavier Hernandez (xhernandez)

Comment 2 Anand Avati 2014-11-08 21:08:25 UTC
REVIEW: http://review.gluster.org/9080 (ec: Remove O_APPEND from flags on create and open.) posted (#2) for review on release-3.6 by Xavier Hernandez (xhernandez)

Comment 3 Anand Avati 2014-11-10 09:50:09 UTC
REVIEW: http://review.gluster.org/9080 (ec: Remove O_APPEND from flags on create and open.) posted (#3) for review on release-3.6 by Xavier Hernandez (xhernandez)

Comment 4 Anand Avati 2014-11-10 17:05:14 UTC
REVIEW: http://review.gluster.org/9080 (ec: Remove O_APPEND from flags on create and open.) posted (#4) for review on release-3.6 by Xavier Hernandez (xhernandez)

Comment 5 Xavi Hernandez 2014-11-18 08:26:59 UTC
*** Bug 1164768 has been marked as a duplicate of this bug. ***

Comment 6 Anand Avati 2014-12-18 14:36:48 UTC
COMMIT: http://review.gluster.org/9080 committed in release-3.6 by Raghavendra Bhat (raghavendra) 
------
commit 2372a9ed54f6e30e3ac744e1daf8ec379dd236ae
Author: Xavier Hernandez <xhernandez>
Date:   Sat Nov 8 21:07:09 2014 +0100

    ec: Remove O_APPEND from flags on create and open.
    
    Allowing O_APPEND flag to pass through to the brick files
    corrupts fragment contents because writes are not stored on
    the desired place.
    
    Write fop has been modified so that it uses current file
    size as its write offset. This guarantees that all writes,
    even those comming from different file descriptors and
    clients, will write to the end of the file.
    
    This is backport of http://review.gluster.org/9079/
    
    Change-Id: I9f721f12217a98231fe52e344166d1c94172c272
    BUG: 1161885
    Signed-off-by: Xavier Hernandez <xhernandez>
    Reviewed-on: http://review.gluster.org/9080
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Dan Lambright <dlambrig>
    Reviewed-by: Raghavendra Bhat <raghavendra>
    Tested-by: Raghavendra Bhat <raghavendra>

Comment 7 Xavi Hernandez 2015-01-19 14:56:29 UTC
*** Bug 1159529 has been marked as a duplicate of this bug. ***

Comment 8 Raghavendra Bhat 2015-02-11 09:12:01 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.6.2, please reopen this bug report.

glusterfs-3.6.2 has been announced on the Gluster Developers mailinglist [1], packages for several distributions should already be or become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

The fix for this bug likely to be included in all future GlusterFS releases i.e. release > 3.6.2.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/5978
[2] http://news.gmane.org/gmane.comp.file-systems.gluster.user
[3] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/6137