URL:
https://github.com/SSSD/sssd/pull/289
Title: #289: Check the timestamp cache during the users/groups cleanup
fidencio commented:
"""
@jhrozek:
So, I've implemented most of your suggestion but now I'm facing an issue about
making sysdb_search_users() and sysdb_search_groups() looking at the timestamp cache.
What I've done in the ldap_cleanup() code was:
```
in case a timestamp cache exists:
check the timestamp cache
search in the normal cache for the results gotten in the timestamp cache
otherwise
check the normal cache
merge the results with the timestamp cache
```
The very same logic cannot be applied in the sysdb_search_users() and
sysdb_search_groups() as there are some places in the code using those functions filtering
by "attributes" that are not part of the timestamp cache. By doing this, the
timestamp cache returns an ENOENT and we do *not* want to go an search the cache in this
case. The reason we don't want to do that is because timestamps may not be up-to-date
in the normal cache, so we would search in the timestamp cache, get an ENOENT as result,
search in the normal cache and find users/groups (which is exactly what we're trying
to solve).
Considering this limitation I'd like to check with you what you think about these two
possible approaches::
- Introduce a new function that only will be used by the ldap_cleanup() for now. The
changes already done for the work you suggested could still be merged, but for sure not
backported.
- Introduce a way to check, in the timestamp cache methods, that we're not searching
for something that's not supported (and return a new error when it happens) so we for
sure know that we can search in the normal cache on these cases.
The first approach seems way saner and less hacky than the second one, IMO.
I'd really like to hear some suggestions from you (and from other developers as well)
about these 2 approaches or even about something else that I've missed/wasn't able
to come up with.
"""
See the full comment at
https://github.com/SSSD/sssd/pull/289#issuecomment-306734209