Bug 1779486

Summary: background refresh task does not refresh updated netgroup entries
Product: Red Hat Enterprise Linux 8 Reporter: Niranjan Mallapadi Raghavender <mniranja>
Component: sssdAssignee: Paweł Poławski <ppolawsk>
Status: CLOSED ERRATA QA Contact: sssd-qe <sssd-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: atikhono, grajaiya, jhrozek, lslebodn, mzidek, pbrezina, ppolawsk, sgoveas, thalman, tscherf
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: sync-to-jira
Fixed In Version: sssd-2.3.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1822461 (view as bug list) Environment:
Last Closed: 2020-11-04 02:04:28 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: 1822461    
Attachments:
Description Flags
sssd domain logs. none

Description Niranjan Mallapadi Raghavender 2019-12-04 04:11:48 UTC
Description of problem:
background refresh task does not refresh updated netgroup entries. When refresh_expired_interval is specified in sssd.conf and netgroup entries are updated in ldap server. the refresh task doesn't update fetch the latest netgroup entries. 


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

sssd-2.2.0-19.el8.x86_64
How reproducible:



Steps to Reproduce:
1. Install sssd-2.2.0-19.el8.x86_64 

2. cat /etc/sssd/sssd.conf
[sssd]
config_file_version = 2
services = nss, pam
domains = example1

[domain/example1]
ldap_search_base = dc=example,dc=test
id_provider = ldap
auth_provider = ldap
ldap_user_home_directory = /home/%u
ldap_uri = ldaps://idm-qe-01.lab.eng.rdu2.redhat.com
ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem
use_fully_qualified_names = True
debug_level = 9
entry_cache_timeout=30
refresh_expired_interval=22
debug_level = 0xfff0

2. Setup ldap server with netgroup entries. as shown below:

dn: cn=netgroup_1137010,ou=Netgroups,dc=example,dc=test
objectClass: top
objectClass: nisNetgroup
cn: netgroup_1137010
nisNetgroupTriple: (host1,user1,example1.com)

3. Run getent netgroup netgroup_1137010

[root@idm-qe-01 db]# getent netgroup netgroup_1137010
netgroup_1137010      (host1,user1,example1.com)


4. Modify netgroup entry 
dn: cn=netgroup_1137010,ou=Netgroups,dc=example,dc=test
changetype: modify
replace: nisNetgroupTriple
nisNetgroupTriple: (host1137011,user1137011,example.com)

[root@idm-qe-01 db]# ldapmodify -x  -D "cn=Directory Manager" -w Secret123 -h localhost -f /tmp/net2.ldif
modifying entry "cn=netgroup_1137010,ou=Netgroups,dc=example,dc=test"

5. After 22 seconds the netgroup entry should be updated in sssd cache. 

<snip from sssd_example1.log>

(Tue Dec  3 23:08:00 2019) [sssd[be[example1]]] [be_refresh_step] (0x0400): Refreshing 0 netgroups in domain example1
(Tue Dec  3 23:08:00 2019) [sssd[be[example1]]] [be_refresh_batch_step] (0x0200): The batch is done
(Tue Dec  3 23:08:00 2019) [sssd[be[example1]]] [be_ptask_done] (0x0400): Task [Refresh Records]: finished successfully
(Tue Dec  3 23:08:00 2019) [sssd[be[example1]]] [be_ptask_schedule] (0x0400): Task [Refresh Records]: scheduling task 22 seconds from now [1575432502]

6. Run ldbsearch to check the cache. 


# record 7
dn: name=netgroup_1137010,cn=Netgroups,cn=example1,cn=sysdb
createTimestamp: 1575432366
name: netgroup_1137010
objectClass: netgroup
originalDN: cn=netgroup_1137010,ou=Netgroups,dc=example,dc=test
originalModifyTimestamp: 20191204040527Z
netgroupTriple: (host1,user1,example1.com)
lastUpdate: 1575432366
dataExpireTimestamp: 1575432396
distinguishedName: name=netgroup_1137010,cn=Netgroups,cn=example1,cn=sysdb



Actual results:

Netgroup entries are not fetch the updated netgroup entries from server and update the cache. 


Expected results:

netgroup entries should fetch updated netgroup entries from server and update the cache. 


Additional info:

Comment 2 Niranjan Mallapadi Raghavender 2019-12-04 04:29:29 UTC
Created attachment 1641876 [details]
sssd domain logs.

Comment 13 Paweł Poławski 2020-03-31 12:58:10 UTC
Upstream ticket:
https://pagure.io/SSSD/sssd/issue/4177

Comment 15 Pavel Březina 2020-04-01 09:16:06 UTC
* `master`
    * 704d9f1d3dbae078f7fdcc310324a08770f3feef - SYSDB: Cache selector as enum
    * b432b2c4c8039db0130494a83294bee950ebaa6a - LDAP: Netgroups refresh in background task

Comment 21 errata-xmlrpc 2020-11-04 02:04:28 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 (sssd bug fix and enhancement update), 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/RHBA-2020:4569