Bug 1614296

Summary: SSSD netgroups do not honor entry_cache_nowait_percentage
Product: Red Hat Enterprise Linux 7 Reporter: Amith <apeetham>
Component: sssdAssignee: SSSD Maintainers <sssd-maint>
Status: CLOSED ERRATA QA Contact: Amith <apeetham>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: apeetham, grajaiya, jhrozek, lslebodn, mkosek, mzidek, pbrezina, sgoveas, tscherf
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sssd-1.16.4-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1665388 (view as bug list) Environment:
Last Closed: 2019-08-06 13:02:02 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: 1665388    

Description Amith 2018-08-09 10:39:50 UTC
Description of problem:
The nss option entry_cache_nowait_percentage has no impact on netgroup lookups. Similar to bug 822236. To understand and reproduce this issue, follow the steps:

1. Set entry_cache_nowait_percentage = 50 in the [nss] section of sssd.conf
2. Set entry_cache_timeout = 20 in the [domain/DOMAINNAME] section of sssd.conf
3. Create a valid netgroup entry in LDAP.
4. Purge your cache and restart sssd (to ensure clean starting state)
5. Run the following loop:

for i in {1..10}
do
/usr/bin/time --output=/tmp/time.out -f "%e" getent netgroup netgrp_nowait
cat /tmp/time.out
sleep 6
done

Actual Results:
netgrp_nowait         (host1,kau10,example.com)
0.29
netgrp_nowait         (host1,kau10,example.com)
0.01
netgrp_nowait         (host1,kau10,example.com)
0.01
netgrp_nowait         (host1,kau10,example.com)
0.01
netgrp_nowait         (host1,kau10,example.com)
0.28
netgrp_nowait         (host1,kau10,example.com)
0.01
netgrp_nowait         (host1,kau10,example.com)
0.01
netgrp_nowait         (host1,kau10,example.com)
0.02
netgrp_nowait         (host1,kau10,example.com)
0.27
netgrp_nowait         (host1,kau10,example.com)
0.01

As you can see, the first request takes sometime (0.29 sec) to return. Loop runs in a 6 second cycle. The 2nd, 3rd and 4th attempts return instantly, but the fifth one takes approx the same time as the first lookup and the pattern repeats. The entry_cache_nowait_percentage is set to 50 (percent), so entries that come in after 10 seconds past the last cache update should be returned immediately. SSSD should update the cache on its own. 

Version-Release number of selected component (if applicable):
sssd-1.16.2-7.el7.x86_64

Additional info:
If the above results are expected then please let us know. We tested this issue on older versions as well and found similar results in RHEL-7.5 & RHEL-7.4. This bug was automated long back but we couldn't catch it on later versions. Reason being a miscalculation in grepping out the expected response time values. The loop saves the result in a file and we grepped "0." instead of "0.0" to test the responses from each lookup.

Comment 2 Pavel Březina 2019-01-29 10:31:31 UTC
Can you also provide logs of sssd_nss please?

Comment 3 Pavel Březina 2019-02-05 13:28:33 UTC
Never mind, I reproduced it locally.

Upstream ticket:
https://pagure.io/SSSD/sssd/issue/3947

Upstream PR:
https://github.com/SSSD/sssd/pull/742

Comment 4 Jakub Hrozek 2019-03-14 21:25:59 UTC
Fixed upstream:
    master: ce8a607
    sssd-1-16: 486b552

Comment 8 errata-xmlrpc 2019-08-06 13:02:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2177