Skip to content

idp: do not update cache timeout if member is added#8545

Merged
alexey-tikhonov merged 3 commits into
SSSD:masterfrom
sumit-bose:idp_group_fixes
Apr 13, 2026
Merged

idp: do not update cache timeout if member is added#8545
alexey-tikhonov merged 3 commits into
SSSD:masterfrom
sumit-bose:idp_group_fixes

Conversation

@sumit-bose

Copy link
Copy Markdown
Contributor

If only a single member is added to a group, e.g. during an initgroups
request, do not increment the cache timeout because it is not clear if
the list of members is complete or not.

Resolve: #8330

conf: add avoid_id_lookups domain option

If this new option option is set to 'true' SSSD will try to avoid
sending lookups by ID to the backend and will switch to a lookup by name
if a cached object with a matching ID can be found. This option can
e.g. be used in cases where searches by ID are expensive on the server
side because of missing indexes or are not even possible.

:config: New option 'avoid_id_lookups' to tell the SSSD responders to
use a lookup by name instead of by id where possible

Resolves: #7668

@sumit-bose
sumit-bose marked this pull request as ready for review March 23, 2026 18:46
@sumit-bose

sumit-bose commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

Hi,

with respect to #8330 this PR only solves the id/getent group interaction. The handling of nested groups will be part of a different PR.

bye,
Sumit

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new configuration option, avoid_id_lookups, for SSSD domains. This option, which defaults to true for IdP providers, enables SSSD to optimize lookups by attempting to fall back to name-based searches when an ID-based lookup is performed and a cached object with a matching ID is found, thereby avoiding potentially expensive ID lookups on the backend. The changes include adding the configuration option to the domain structure, implementing the fallback logic in cache request processing, updating configuration files and documentation, and adding a new system test for IdP provider behavior. Additionally, an optimization was made in the IdP provider to prevent resetting group cache timeouts when only a single member is added. There are no review comments to address.

@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Mar 23, 2026
@alexey-tikhonov alexey-tikhonov self-assigned this Mar 23, 2026
@alexey-tikhonov
alexey-tikhonov self-requested a review March 23, 2026 19:37
@alexey-tikhonov

Copy link
Copy Markdown
Member

python-system-tests fails.

@alexey-tikhonov

Copy link
Copy Markdown
Member

Imo, option name avoid_id_lookups is unfortunate as it relates to 'id_provider' in general.
Maybe avoid_by_id_lookups?

Comment thread src/man/sssd.conf.5.xml
Comment thread src/confdb/confdb.c Outdated
Comment thread src/confdb/confdb.c
Comment thread src/man/sssd.conf.5.xml Outdated
@alexey-tikhonov

Copy link
Copy Markdown
Member

"If this new option option is set ..." -- double 'option' in the commit message.

Comment thread src/responder/common/cache_req/cache_req.c Outdated
Comment thread src/responder/common/cache_req/cache_req_search.c Outdated
Comment thread src/providers/idp/idp_id_eval.c Outdated
Comment thread src/providers/idp/idp_id_eval.c Outdated
@alexey-tikhonov

Copy link
Copy Markdown
Member

Commit message: "Resolve: #8330" -> "Resolves ..."

@sumit-bose

Copy link
Copy Markdown
Contributor Author

Imo, option name avoid_id_lookups is unfortunate as it relates to 'id_provider' in general. Maybe avoid_by_id_lookups?

Hi,

I changed this in the latest version.

bye,
Sumit

@sumit-bose

Copy link
Copy Markdown
Contributor Author

"If this new option option is set ..." -- double 'option' in the commit message.

fixed

@sumit-bose

Copy link
Copy Markdown
Contributor Author

Commit message: "Resolve: #8330" -> "Resolves ..."

fixed

Comment thread src/providers/idp/idp_id_eval.c Outdated
Comment thread src/providers/idp/idp_id_eval.c Outdated
@alexey-tikhonov

Copy link
Copy Markdown
Member

Thank you for the updates.
Two minor comments are left.

@alexey-tikhonov alexey-tikhonov added backport-to-sssd-2-12 and removed no-backport This should go to target branch only. labels Apr 8, 2026
@alexey-tikhonov

Copy link
Copy Markdown
Member

ACK

If this new option is set to 'true' SSSD will try to avoid sending
lookups by ID to the backend and will switch to a lookup by name if a
cached object with a matching ID can be found.  This option can e.g. be
used in cases where searches by ID are expensive on the server side
because of missing indexes or are not even possible.

:config: New option 'avoid_by_id_lookups' to tell the SSSD responders to
         use a lookup by name instead of by id where possible

Resolves: SSSD#7668
Reviewed-by: Alexey Tikhonov <[email protected]>
Reviewed-by: Pavel Březina <[email protected]>
If 'avoid_by_id_lookups' is set to 'True' switch to a lookup by name if
a user or a group is searched by ID.

Resolves: SSSD#7668
Reviewed-by: Alexey Tikhonov <[email protected]>
Reviewed-by: Pavel Březina <[email protected]>
If only a single member is added to a group, e.g. during an initgroups
request, do not increment the cache timeout because it is not clear if
the list of members is complete or not.

Resolves: SSSD#8330
Reviewed-by: Alexey Tikhonov <[email protected]>
Reviewed-by: Pavel Březina <[email protected]>
@sssd-bot

Copy link
Copy Markdown
Contributor

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 CodeQL (success)
🟢 osh-diff-scan:fedora-rawhide-x86_64:upstream (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-42-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-44-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 Analyze (target) / cppcheck (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🟢 ci / intgcheck (centos-10) (success)
🟢 ci / intgcheck (fedora-42) (success)
🟢 ci / intgcheck (fedora-43) (success)
🟢 ci / intgcheck (fedora-44) (success)
🟢 ci / intgcheck (fedora-45) (success)
🟢 ci / prepare (success)
🟢 ci / system (centos-10) (success)
🟢 ci / system (fedora-42) (success)
🟢 ci / system (fedora-43) (success)
🟢 ci / system (fedora-44) (success)
🟢 ci / system (fedora-45) (success)
➖ Coverity scan / coverity (skipped)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@alexey-tikhonov
alexey-tikhonov merged commit a3b2b4f into SSSD:master Apr 13, 2026
12 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants