Bug 1091898

Summary: [barrier] "cp -a" operation hangs on NFS mount, while barrier is enabled
Product: [Community] GlusterFS Reporter: SATHEESARAN <sasundar>
Component: coreAssignee: bugs <bugs>
Status: CLOSED DEFERRED QA Contact: SATHEESARAN <sasundar>
Severity: high Docs Contact:
Priority: low    
Version: mainlineCC: amukherj, atumball, bugs, kaushal, ndevos, sankarshan, skoduri, smohan
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1100590 (view as bug list) Environment:
Last Closed: 2017-08-10 13:01:03 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:    
Bug Blocks: 1100590    

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.