From 2d1a59f6c2cf3cf4667cf2d01b2d780db916db42 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Fri, 10 Feb 2017 12:22:23 +0100 Subject: UTIL: Add a new domain state called DOM_INCONSISTENT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a new domain state that indicates to the responder that it should always send a DP request because the provider is rebuilding the cache. Currently it will be only used by the files provider when it is updating the cache to make sure sssd always returns current data and updating the cache from files is not as racy. Reviewed-by: Pavel Březina --- src/confdb/confdb.h | 4 ++++ src/providers/data_provider_be.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h index dd6ac77f5..7c9446981 100644 --- a/src/confdb/confdb.h +++ b/src/confdb/confdb.h @@ -248,6 +248,10 @@ enum sss_domain_state { * return cached data */ DOM_INACTIVE, + /** Domain is being updated. Responders should ignore cached data and + * always contact the DP + */ + DOM_INCONSISTENT, }; /** diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 12b5f43d0..7e7b74c36 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -166,8 +166,10 @@ static void be_mark_subdom_offline(struct sss_domain_info *subdom, tv = tevent_timeval_current_ofs(reset_status_timeout, 0); switch (subdom->state) { + case DOM_INCONSISTENT: case DOM_DISABLED: - DEBUG(SSSDBG_MINOR_FAILURE, "Won't touch disabled subdomain\n"); + DEBUG(SSSDBG_MINOR_FAILURE, + "Won't touch disabled or inconsistent subdomain\n"); return; case DOM_INACTIVE: DEBUG(SSSDBG_TRACE_ALL, "Subdomain already inactive\n"); -- cgit