bugGluster - Bugs: bug #22502, read result is not correct after...

 
 

bug #22502: read result is not correct after write and flush

Submitted by:  LI Daobing <lidaobing>
Submitted on:  Thu 06 Mar 2008 02:14:00 PM UTC  
 
Category: GlusterFSSeverity: 3 - Normal
Priority: 5 - NormalItem Group: User Interface Bug
Status: ConfirmedPrivacy: Public
Assigned to: Anand Avati <avati>Originator Name: 
Open/Closed: ClosedRelease: 
Operating System: NoneReproducibility: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 12 Mar 2008 04:32:38 PM UTC, comment #5:

Currently Closing the bug. The idea about making direct-io-mode=DISABLE is still under discussions. Anyways, as root cause of the bug is known now, we can consider this as closed.

Amar Tumballi <amarts>
Project Member
Fri 07 Mar 2008 07:18:51 AM UTC, comment #4:

Hello,

I can confirm that this bug disappeared when mount with --direct-io-mode=DISABLE。

how about set --direct-io-mode=DISABLE as default or add a comment to this option in the usage?

you can close this bug now.

Thanks.

LI Daobing <lidaobing>
Fri 07 Mar 2008 07:04:10 AM UTC, comment #3:

this issue seem to be because of linux page cache not re-issuing a fresh read for sections which could not be read in the previous shot but within a page.. what i mean is

app: read 1008 bytes -> kernel: read 4096 bytes -> returns 1008 bytes -> app gets 1008 bytes

app: read next 1008 bytes -> kernel thinks it knows all data till 4096 bytes, does not issue read to fuse/glusterfs to fill from 1008 to 4096.

this is happening because ofile is opened in write-only mode, and glusterfs enforces direct_io fops on this fd. this means that the page cache is bypassed. all writes are coming to glusterfs directly, whereas the ifile fd is coming through the page cache (which is not seeing the writes, and thinks that the small 1008 byte cache is not stale).

if you mount glusterfs with "-d DISABLE", then all fops go through page cache (it invalidates the cache appropriately on detecting writes) and the py program works fine.

this behaviour is similar to opening ofile fd with O_DIRECT and ifile without O_DIRECT on your local filesystem.

the closest fix i see is remounting with '-d DISABLE'. for fuse after linux-2.6.24 direct io flag may not be necessary since large writes (> 4KB) support for non-direct-io is being added into fuse. the purpose of direct io flag set by glusterfs is only to get larger write block size.

Anand Avati <avati>
Project MemberIn charge of this item.
Thu 06 Mar 2008 04:00:09 PM UTC, comment #2:

Hello,
I can reproduce this bug after add a '-a 0' to the arguments.

LI Daobing <lidaobing>
Thu 06 Mar 2008 02:49:26 PM UTC, comment #1:

Li,
can you mount glusterfs with "-a 0" command line argument and see if you still have the issue?

avati

Anand Avati <avati>
Project MemberIn charge of this item.
Thu 06 Mar 2008 02:14:00 PM UTC, original submission:

testcase in attachment。open one fd for write and another fd for read. glusterfs can't confirm read the correct content. I only use io-threads, unify, afr, client, server, posix-locks in config. and I don't use any cache modules.

[1]
$ python ticket-165.py ~/xxx

  1. '12345678'

1 '12345678'
2 '12345678'
3 '12345678'
4 '12345678'
5 '12345678'
6 '12345678'
7 '12345678'
8 '12345678'
9 '12345678'

[2]
$ python ticket-165.py /home/gluster_data/mount/xxx

  1. '12345678'

1 '\x00\x00\x00\x00\x00\x00\x00\x00'
2 '\x00\x00\x00\x00\x00\x00\x00\x00'
3 '\x00\x00\x00\x00\x00\x00\x00\x00'
4 '\x00\x00\x00\x00\x00\x00\x00\x00'
5 '12345678'
6 '\x00\x00\x00\x00\x00\x00\x00\x00'
7 '\x00\x00\x00\x00\x00\x00\x00\x00'
8 '\x00\x00\x00\x00\x00\x00\x00\x00'
9 '12345678'

LI Daobing <lidaobing>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #15193:  ticket-165.py added by lidaobing (480B - text/x-python)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by amarts (Posted a comment)
  • -unavailable- added by avati (Posted a comment)
  • -unavailable- added by lidaobing (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 12 Mar 2008 04:32:38 PM UTCamartsStatusNone=>Confirmed
      Assigned toNone=>avati
      Open/ClosedOpen=>Closed
    Thu 06 Mar 2008 02:14:00 PM UTClidaobingAttached File-=>Added ticket-165.py, #15193

    Back to the top


    Powered by Savane 3.1-cleanup1