Bug 1397052 - OOM kill of nfs-ganesha on one node while fs-sanity test suite is executed.
Summary: OOM kill of nfs-ganesha on one node while fs-sanity test suite is executed.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: distribute
Version: mainline
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Jiffin
QA Contact:
URL:
Whiteboard:
Depends On: 1381452
Blocks: 1401021 1401023 1401029 1401032
TreeView+ depends on / blocked
 
Reported: 2016-11-21 13:51 UTC by Jiffin
Modified: 2017-03-06 17:35 UTC (History)
11 users (show)

Fixed In Version: glusterfs-3.10.0
Clone Of: 1381452
: 1401021 1401023 1401029 1401032 (view as bug list)
Environment:
Last Closed: 2017-03-06 17:35:27 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Comment 1 Worker Ant 2016-11-21 14:07:18 UTC
REVIEW: http://review.gluster.org/15894 (dht/rename : Incase of failure remove linkto file properly) posted (#1) for review on master by jiffin tony Thottan (jthottan)

Comment 2 Worker Ant 2016-12-01 05:31:55 UTC
REVIEW: http://review.gluster.org/15894 (dht/rename : Incase of failure remove linkto file properly) posted (#2) for review on master by jiffin tony Thottan (jthottan)

Comment 3 Jiffin 2016-12-01 05:35:05 UTC
The above issue happens when rename/00.t test executed on nfs-ganesha clients : Steps executed in that script
 * create a file using root
 * rename the file using a non root user, it fails with EACESS
 * delete the file 
 * create directory directory using root
 * rename the directory using non root user, test hungs and slowly led to OOM kill of ganesha 

RCA put forwarded by Du for OOM kill of ganesha
Note that when we hit this bug, we've a scenario of a dentry being present as:
 * a linkto file on one subvol 
 * a directory on rest of subvols

When a lookup happens on the dentry in such a scenario, the control flow goes into an infinite loop of: 
dht_lookup_everywhere
dht_lookup_everywhere_cbk
dht_lookup_unlink_cbk
dht_lookup_everywhere_done
dht_lookup_directory (as local->dir_count > 0)
dht_lookup_dir_cbk (sets to local->need_selfheal = 1 as the entry is a linkto file on one of the subvol)
dht_lookup_everywhere (as need_selfheal = 1).

This infinite loop can cause increased consumption of memory due to:
1) dht_lookup_directory assigns a new layout to local->layout unconditionally 2) Most of the functions in this loop do a stack_wind of various fops.

This results in growing of call stack (note that call-stack is destroyed only after lookup response is received by fuse - which never happens in this case)

Comment 4 Worker Ant 2016-12-01 06:10:08 UTC
REVIEW: http://review.gluster.org/15894 (dht/rename : Incase of failure remove linkto file properly) posted (#3) for review on master by jiffin tony Thottan (jthottan)

Comment 5 Worker Ant 2016-12-01 15:47:38 UTC
COMMIT: http://review.gluster.org/15894 committed in master by Vijay Bellur (vbellur) 
------
commit 57d59f4be205ae0c7888758366dc0049bdcfe449
Author: Jiffin Tony Thottan <jthottan>
Date:   Mon Nov 21 18:08:14 2016 +0530

    dht/rename : Incase of failure remove linkto file properly
    
    Generally linkto file is created using root user. Consider following
    case, a user is trying to rename a file which he is not permitted.
    So the rename fails with EACESS and when rename tries to cleanup the
    linkto file, it fails.
    
    The above issue happens when rename/00.t test executed on nfs-ganesha
    clients :
    Steps executed in script
    * create a file "abc" using root
    * rename the file "abc" to "xyz" using a non root user, it fails with EACESS
    * delete "abc"
    * create directory "abc" using root
    * again try ot rename "abc" to "xyz" using non root user, test hungs here
    which slowly leds to OOM kill of ganesha process
    
    RCA put forwarded by Du for OOM kill of ganesha
    Note that when we hit this bug, we've a scenario of a dentry being
    present as:
        * a linkto file on one subvol
        * a directory on rest of subvols
    
    When a lookup happens on the dentry in such a scenario, the control flow
    goes into an infinite loop of:
    
        dht_lookup_everywhere
        dht_lookup_everywhere_cbk
        dht_lookup_unlink_cbk
        dht_lookup_everywhere_done
        dht_lookup_directory (as local->dir_count > 0)
        dht_lookup_dir_cbk (sets to local->need_selfheal = 1 as the entry is a linkto file on one of the subvol)
        dht_lookup_everywhere (as need_selfheal = 1).
    
    This infinite loop can cause increased consumption of memory due to:
    1) dht_lookup_directory assigns a new layout to local->layout unconditionally
    2)  Most of the functions in this loop do a stack_wind of various fops.
    
    This results in growing of call stack (note that call-stack is destroyed only after lookup response is
    received by fuse - which never happens in this case)
    
    Thanks Du for root causing the oom kill and Sushant for suggesting the fix
    
    Change-Id: I1e16bc14aa685542afbd21188426ecb61fd2689d
    BUG: 1397052
    Signed-off-by: Jiffin Tony Thottan <jthottan>
    Reviewed-on: http://review.gluster.org/15894
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: Raghavendra G <rgowdapp>

Comment 7 Shyamsundar 2017-03-06 17:35:27 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.10.0, please open a new bug report.

glusterfs-3.10.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/gluster-users/2017-February/030119.html
[2] https://www.gluster.org/pipermail/gluster-users/


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