Bug 1479303

Summary: [Perf] : Large file sequential reads are off target by ~38% on FUSE/Ganesha
Product: [Community] GlusterFS Reporter: Nithya Balachandran <nbalacha>
Component: distributeAssignee: Nithya Balachandran <nbalacha>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.12CC: amukherj, asoman, bturner, bugs, dang, jthottan, kkeithle, mbenjamin, nbalacha, pasik, rcyriac, rhinduja, rhs-bugs, sanandpa, skoduri, storage-qa-internal
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.12.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1476665 Environment:
Last Closed: 2017-09-05 17:38:34 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: 1475136, 1476665    
Bug Blocks:    

Description Nithya Balachandran 2017-08-08 10:38:02 UTC
+++ This bug was initially created as a clone of Bug #1476665 +++

+++ This bug was initially created as a clone of Bug #1475136 +++

Description of problem:
-----------------------

A regression seems to have been introduced in recent bits on large file seq reads :

3.2 : 2480044.05 kB/sec	
3.8.4-35 : 1538178.2 kB/sec


Regression : ~38%

This is on a vanilla volume,without PR,NL,mdcache.

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

3.8.4-35

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

100%

Additional info:
----------------
Volume Name: testvol
Type: Distributed-Replicate
Volume ID: 4b52bfb8-28fd-4e0f-8ee0-eb8116a296c4
Status: Started
Snapshot Count: 0
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: server1:/bricks/testvol_brick0
Brick2: server2:/bricks/testvol_brick1
Brick3: server3:/bricks/testvol_brick2
Brick4: server4:/bricks/testvol_brick3
Options Reconfigured:
server.allow-insecure: on
performance.stat-prefetch: off
transport.address-family: inet
nfs.disable: on

--- Additional comment from Nithya Balachandran on 2017-07-31 02:58:32 EDT ---

The changes made in https://review.gluster.org/#/c/17630/ have introduced a perf regression. 


The code has been changed to check if the fd is open on the dst subvol only if the FOP returns with EBADFD.

--- Additional comment from Worker Ant on 2017-07-31 03:06:04 EDT ---

REVIEW: https://review.gluster.org/17922 (cluster/dht: Check for open fd only on EBADF) posted (#1) for review on master by N Balachandran (nbalacha)

--- Additional comment from Worker Ant on 2017-07-31 04:10:16 EDT ---

REVIEW: https://review.gluster.org/17922 (cluster/dht: Check for open fd only on EBADF) posted (#2) for review on master by N Balachandran (nbalacha)

--- Additional comment from Worker Ant on 2017-07-31 10:00:25 EDT ---

COMMIT: https://review.gluster.org/17922 committed in master by Raghavendra G (rgowdapp) 
------
commit 91c9f4a19fde4894576b398252c77f730832a26a
Author: N Balachandran <nbalacha>
Date:   Mon Jul 31 12:32:59 2017 +0530

    cluster/dht: Check for open fd only on EBADF
    
    DHT fd based fops will now check if the fd is
    open on the cached subvol only if the call fails
    with EBADF.
    
    This will improve performance for scenarios where
    a rebalance is not running which would be most of
    the time.
    
    Change-Id: Idfaeb8927af769c6110d07a165a0fe2307369239
    BUG: 1476665
    Signed-off-by: N Balachandran <nbalacha>
    Reviewed-on: https://review.gluster.org/17922
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Raghavendra G <rgowdapp>

--- Additional comment from Worker Ant on 2017-08-03 23:26:26 EDT ---

REVIEW: https://review.gluster.org/17970 (Revert "cluster/dht: Check for open fd only on EBADF") posted (#1) for review on master by N Balachandran (nbalacha)

--- Additional comment from Worker Ant on 2017-08-04 04:56:25 EDT ---

COMMIT: https://review.gluster.org/17970 committed in master by N Balachandran (nbalacha) 
------
commit 6d1068ddb35be19df36210c9fcaa7ce97e2a376a
Author: N Balachandran <nbalacha>
Date:   Fri Aug 4 08:52:31 2017 +0530

    Revert "cluster/dht: Check for open fd only on EBADF"
    
    This reverts commit 91c9f4a19fde4894576b398252c77f730832a26a.
    This patch needs to be reworked.
    
    Change-Id: I4c24f647c2b1abc68fc4e9fe6eb810418e2033aa
    BUG: 1476665
    Signed-off-by: N Balachandran <nbalacha>
    Reviewed-on: https://review.gluster.org/17970
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>

--- Additional comment from Worker Ant on 2017-08-04 05:21:40 EDT ---

REVIEW: https://review.gluster.org/17976 (cluster/dht: Check for open fd only on EBADF) posted (#1) for review on master by N Balachandran (nbalacha)

--- Additional comment from Worker Ant on 2017-08-04 05:35:31 EDT ---

REVIEW: https://review.gluster.org/17976 (cluster/dht: Check for open fd only on EBADF) posted (#2) for review on master by N Balachandran (nbalacha)

--- Additional comment from Worker Ant on 2017-08-08 06:21:28 EDT ---

COMMIT: https://review.gluster.org/17976 committed in master by Raghavendra G (rgowdapp) 
------
commit cdca1cb26a0aba390c6d8485c0d6d95e22ffc8bd
Author: N Balachandran <nbalacha>
Date:   Fri Aug 4 14:46:38 2017 +0530

    cluster/dht: Check for open fd only on EBADF
    
    DHT fd based fops used to check if the fd was open
    on the cached subvol before winding the call. However,
    this introduced a performance regression of about
    30% for reads.
    
    This check was introduced to handle cases where files
    were migrated while IOs were happening. As this is not
    the common case, dht will now check if the fd is
    open on the cached subvol only if the call fails
    with EBADF.
    
    This will prevent a performance hit where a rebalance
    is not running.
    
    Change-Id: I2035a858d63c3fcd22bb634055bbb0ad01686808
    BUG: 1476665
    Signed-off-by: N Balachandran <nbalacha>
    Reviewed-on: https://review.gluster.org/17976
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Amar Tumballi <amarts>
    Reviewed-by: Susant Palai <spalai>
    Reviewed-by: Raghavendra G <rgowdapp>

Comment 1 Worker Ant 2017-08-08 10:47:32 UTC
REVIEW: https://review.gluster.org/17995 (cluster/dht: Check for open fd only on EBADF) posted (#1) for review on release-3.12 by N Balachandran (nbalacha)

Comment 2 Worker Ant 2017-08-09 11:29:54 UTC
COMMIT: https://review.gluster.org/17995 committed in release-3.12 by Shyamsundar Ranganathan (srangana) 
------
commit 40d65fb360afac01c593a4cf47851cf9ee50ad96
Author: N Balachandran <nbalacha>
Date:   Fri Aug 4 14:46:38 2017 +0530

    cluster/dht: Check for open fd only on EBADF
    
    DHT fd based fops used to check if the fd was open
    on the cached subvol before winding the call. However,
    this introduced a performance regression of about
    30% for reads.
    
    This check was introduced to handle cases where files
    were migrated while IOs were happening. As this is not
    the common case, dht will now check if the fd is
    open on the cached subvol only if the call fails
    with EBADF.
    
    This will prevent a performance hit where a rebalance
    is not running.
    
    > BUG: 1476665
    > Signed-off-by: N Balachandran <nbalacha>
    > Reviewed-on: https://review.gluster.org/17976
    > Smoke: Gluster Build System <jenkins.org>
    > CentOS-regression: Gluster Build System <jenkins.org>
    > Reviewed-by: Amar Tumballi <amarts>
    > Reviewed-by: Susant Palai <spalai>
    > Reviewed-by: Raghavendra G <rgowdapp>
    
    (cherry picked from commit cdca1cb26a0aba390c6d8485c0d6d95e22ffc8bd)
    Change-Id: I2035a858d63c3fcd22bb634055bbb0ad01686808
    BUG: 1479303
    Signed-off-by: N Balachandran <nbalacha>
    Reviewed-on: https://review.gluster.org/17995
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana>

Comment 3 Worker Ant 2017-08-09 14:25:58 UTC
REVIEW: https://review.gluster.org/18012 (cluster/dht: EBADF handling for fremovexattr and fsetxattr) posted (#1) for review on release-3.12 by N Balachandran (nbalacha)

Comment 4 Worker Ant 2017-08-12 13:37:35 UTC
COMMIT: https://review.gluster.org/18012 committed in release-3.12 by Shyamsundar Ranganathan (srangana) 
------
commit 9e2e26726d8ebf9c702e1ba81e0b3b4e456a7fc2
Author: N Balachandran <nbalacha>
Date:   Tue Aug 8 22:33:24 2017 +0530

    cluster/dht: EBADF handling for fremovexattr and fsetxattr
    
    Add EBADF handling for dht_fremovexattr and dht_fsetxattr.
    
    > BUG: 1476665
    > Signed-off-by: N Balachandran <nbalacha>
    > Reviewed-on: https://review.gluster.org/17999
    > Smoke: Gluster Build System <jenkins.org>
    > Reviewed-by: Shyamsundar Ranganathan <srangana>
    > CentOS-regression: Gluster Build System <jenkins.org>
    > Reviewed-by: Raghavendra G <rgowdapp>
    (cherry picked from commit 747a08d34e2a1e94d7fce68a3577370288bb1955)
    Change-Id: Ide0d5812dae79655d2565157e5baabcd753b4309
    BUG: 1479303
    Signed-off-by: N Balachandran <nbalacha>
    Reviewed-on: https://review.gluster.org/18012
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana>

Comment 5 Shyamsundar 2017-09-05 17:38:34 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.12.0, please open a new bug report.

glusterfs-3.12.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2017-September/000082.html
[2] https://www.gluster.org/pipermail/gluster-users/