Bug 1164768 - Write strings to a file by O_APPEND mode (echo "strings" >> /mountpoint/file.txt) is abnormal
Summary: Write strings to a file by O_APPEND mode (echo "strings" >> /mountpoint/file....
Keywords:
Status: CLOSED DUPLICATE of bug 1161885
Alias: None
Product: GlusterFS
Classification: Community
Component: disperse
Version: 3.6.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Xavi Hernandez
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-17 11:45 UTC by jiademing.dd
Modified: 2014-11-18 08:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-18 08:26:59 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

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 ***


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