Bug 1091898 - [barrier] "cp -a" operation hangs on NFS mount, while barrier is enabled
Summary: [barrier] "cp -a" operation hangs on NFS mount, while barrier is enabled
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact: SATHEESARAN
URL:
Whiteboard:
Depends On:
Blocks: 1100590
TreeView+ depends on / blocked
 
Reported: 2014-04-28 09:44 UTC by SATHEESARAN
Modified: 2017-08-10 13:01 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
: 1100590 (view as bug list)
Environment:
Last Closed: 2017-08-10 13:01:03 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description SATHEESARAN 2014-04-28 09:44:32 UTC
Description of problem:
-----------------------
"cp -a" operation should not be blocked while enabling barrier.
But this happens to be the case with NFS mount

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

How reproducible:
-----------------
Always

Steps to Reproduce:
-------------------
0. NFS mount the volume on the client
1. Enable barrier
2. Perform "cp -a" operation on the mount

Actual results:
----------------
"cp -a" operation gets barriered on NFS mount

Expected results:
------------------
"cp -a" operation should not get barriered

Comment 1 Atin Mukherjee 2014-05-01 14:25:12 UTC
After discussing with the NFS team, what I understood is a write from NFS would always have O_DSYNC flag set which is a sync write to glusterfs and as per the barrier class fops, we are supposed to block it if barrier is enabled. 'cp -a' eventually have writev call and because of which this gets hung. I will double confirm it with the team again and will keep posted.

Comment 2 santosh pradhan 2014-05-01 16:43:55 UTC
(In reply to Atin Mukherjee from comment #1)
> After discussing with the NFS team, what I understood is a write from NFS
> would always have O_DSYNC flag set which is a sync write to glusterfs 

[Santosh] This is not quite correct. There is no fsync call in NFS protocol. That gets converted into WRITE call with O_SYNC/O_DSYNC flags which would instruct backend to go for stable write (means flush to disk). For async WRITEs NFS does not send the FILE_SYNC. Instead it heavily depends on the NFS client VM subsystem i.e. whenever VM subsystem flushes the page caches, it would issue the NFS server the WRITE call with FILE_SYNC flag (i.e. stable write). It depends on the vm.dirty_ratio or its related VM settings. But if the file is opened with O_DIRECT, then every write would generate a NFS WRITE call with FILE_SYNC enabled.

Gluster NFS sends every WRITE with size 1MB (by default). So if you write lesser data, then you may see one WRITE call with FILE_SYNC flag. 


> per the barrier class fops, we are supposed to block it if barrier is
> enabled. 'cp -a' eventually have writev call




 and because of which this gets
> hung. I will double confirm it with the team again and will keep posted.


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