Skip to content

Commit

Permalink
NSS: change default value of 'cache_first' to 'true'
Browse files Browse the repository at this point in the history
Having 'cache_first' as 'false' is a performance degradation without a reason
in the multi-(sub)domains enviroments (typical case when AD is involved).

But there is a subtile issue that doesn't allow to switch default when
'files provider' is used.

:config: Default value of 'cache_first' option was changed to 'true' in case
SSSD is built without 'files provider'.

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
  • Loading branch information
alexey-tikhonov authored and pbrezina committed Mar 27, 2023
1 parent 5c363bf commit ae691f0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/confdb/confdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@
#define CONFDB_RESPONDER_IDLE_TIMEOUT "responder_idle_timeout"
#define CONFDB_RESPONDER_IDLE_DEFAULT_TIMEOUT 300
#define CONFDB_RESPONDER_CACHE_FIRST "cache_first"
#ifdef BUILD_FILES_PROVIDER
/* There is a subtile issue with this option when 'files' + another domain is enabled */
#define CONFDB_RESPONDER_CACHE_FIRST_DEFAILT false
#else
#define CONFDB_RESPONDER_CACHE_FIRST_DEFAILT true
#endif

/* NSS */
#define CONFDB_NSS_CONF_ENTRY "config/nss"
Expand Down
2 changes: 2 additions & 0 deletions src/man/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ PASSKEY_CONDS = ;build_passkey
endif
if BUILD_FILES_PROVIDER
FILES_PROVIDER_CONDS = ;with_files_provider
else
FILES_PROVIDER_CONDS = ;without_files_provider
endif


Expand Down
5 changes: 4 additions & 1 deletion src/man/sssd.conf.5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -945,9 +945,12 @@
This option specifies whether the responder should
query all caches before querying the Data Providers.
</para>
<para>
<para condition="with_files_provider">
Default: false
</para>
<para condition="without_files_provider">
Default: true
</para>
</listitem>
</varlistentry>
</variablelist>
Expand Down
3 changes: 2 additions & 1 deletion src/responder/common/responder_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,8 @@ int sss_process_init(TALLOC_CTX *mem_ctx,

ret = confdb_get_bool(rctx->cdb, rctx->confdb_service_path,
CONFDB_RESPONDER_CACHE_FIRST,
false, &rctx->cache_first);
CONFDB_RESPONDER_CACHE_FIRST_DEFAILT,
&rctx->cache_first);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
"Cannot get \"cache_first_option\".\n"
Expand Down

0 comments on commit ae691f0

Please sign in to comment.