Bug 1164768

Summary: Write strings to a file by O_APPEND mode (echo "strings" >> /mountpoint/file.txt) is abnormal
Product: [Community] GlusterFS Reporter: jiademing.dd <iesool>
Component: disperseAssignee: Xavi Hernandez <jahernan>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: bugs, gluster-bugs, jahernan
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-18 08:26:59 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:

Description jiademing.dd 2014-11-17 11:45:37 UTC
Description of problem:
 I create a disperse 3 redundancy 1 volume, then touch /mountpoint/file.txt. I execute "echo 'AAAAAAAAAAAAAAAAAA' >> /mountpoint/file.txt", no error report, then read /mountpoint/file.txt by cat is NULL.But I can read the "AAAAAAAAAAAAAAA" from sub-directory's file.txt by cat.

  file.txt's size is ok,  echo "AAAAAAAAAAA" > /mountpointf/file.txt (OVERWRITE) and copy all are ok.
  

  
Version-Release number of selected component (if applicable):
3.6.0 and 3.6.1 and glusterfs-master from git

How reproducible:


Steps to Reproduce:
1.create a disperse 3 redundancy 1 volume
Volume Name: test
Type: Disperse
Volume ID: 5de6b5d7-dc4f-48c6-bc2b-15019c900ed2
Status: Started
Number of Bricks: 1 x (2 + 1) = 3
Transport-type: tcp
Bricks:
Brick1: 10.10.21.50:/sda
Brick2: 10.10.21.50:/sdb
Brick3: 10.10.21.50:/sdc

2.touch /mountpoint/file.txt
3.echo "AAAAAAAAAAAAAAA" >> /mountpoint/file.txt (APEND)
4.Can not read strings from /mountpoint/file.txt (by cat)

Actual results:


Expected results:


Additional info:

In my opinion, the circuit of O_APEND write is abnormal  in disperse.

Comment 1 jiademing.dd 2014-11-18 03:24:06 UTC
I tried flags &= O_APPEND in ec_open(), then "echo 'AAAAAAAAAAAAAA' >> /mountpoint/file.txt", and read file.txt is OK.

 In my opinion, like this   relationship between offset and blocks in glusterfs, for example encryption/crypt, we should remove the O_APPEND flags that come frome users.

Comment 2 Xavi Hernandez 2014-11-18 08:12:57 UTC
This bug is a duplicate of bug #1161885. The patch is already posted for review, but it's not merged yet.

You can review it at: http://review.gluster.org/9079/ (for master) and http://review.gluster.org/9080/ (for 3.6)

Comment 3 Xavi Hernandez 2014-11-18 08:26:59 UTC

*** This bug has been marked as a duplicate of bug 1161885 ***

Comment 4 jiademing.dd 2014-11-18 08:56:03 UTC
Ok, I got it, caused by O_APPEND flag.

(In reply to Xavier Hernandez from comment #3)
> 
> *** This bug has been marked as a duplicate of bug 1161885 ***