diff options
| author | Pavel Březina <pbrezina@redhat.com> | 2017-03-09 13:27:31 +0100 |
|---|---|---|
| committer | Jakub Hrozek <jhrozek@redhat.com> | 2017-03-14 12:35:14 +0100 |
| commit | 606015a4f71d8ee809347188667d268f73110483 (patch) | |
| tree | 54233e1f264e2231f5d439f087c5403fff44d306 /src/responder | |
| parent | 8bb6680637ead03e24a38d15ec5265d11a920a1d (diff) | |
| download | sssd-606015a4f71d8ee809347188667d268f73110483.tar.gz sssd-606015a4f71d8ee809347188667d268f73110483.tar.xz sssd-606015a4f71d8ee809347188667d268f73110483.zip | |
CACHE_REQ: shortcut if object is found
If we get a cache-hit but the object is expired or needs a midpoint
refresh we assume that this domain is the one the result should come
from and go to data provider directly.
Related:
https://pagure.io/SSSD/sssd/issue/3001
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Diffstat (limited to 'src/responder')
| -rw-r--r-- | src/responder/common/cache_req/cache_req_search.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/responder/common/cache_req/cache_req_search.c b/src/responder/common/cache_req/cache_req_search.c index 2205ae1a5..8bc1530b3 100644 --- a/src/responder/common/cache_req/cache_req_search.c +++ b/src/responder/common/cache_req/cache_req_search.c @@ -229,6 +229,18 @@ cache_req_search_send(TALLOC_CTX *mem_ctx, ret = EOK; goto done; } + + /* If bypass_dp is true but we found the object in this domain, + * we will contact the data provider anyway to refresh it so + * we can return it without searching the rest of the domains. + */ + if (status != CACHE_OBJECT_MISSING) { + CACHE_REQ_DEBUG(SSSDBG_TRACE_FUNC, cr, + "Object found, but needs to be refreshed.\n"); + bypass_dp = false; + } else { + ret = ENOENT; + } } if (!bypass_dp) { |
