summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2014-07-28 11:48:31 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-07-31 14:06:08 +0200
commit8b0aeee7fe668d8863699d942519a0ac51304049 (patch)
tree2783d575c0e8f41c8774e8e2036274b931e3b207
parentf65efdab6cb62f80a9cfa30303d4c550047bc97e (diff)
downloadsssd-8b0aeee7fe668d8863699d942519a0ac51304049.tar.gz
sssd-8b0aeee7fe668d8863699d942519a0ac51304049.tar.xz
sssd-8b0aeee7fe668d8863699d942519a0ac51304049.zip
failover: set port status to not working if previous srv lookup failed
The meta server status consists of two parts: A) port status - managed by failover mechanism B) SRV lookup status - managed by SRV resolver Both parts are resetted to "neutral" after some time, having B timeout greater than A timeout. We were hitting the following issue: 1. SRV lookup fails (DNS is not reachable), this will set A to "not working and B to "resolve error". Then the next server is tried but fails as well. 2. If SSSD tries to go back online the failover will set A to "neutral" and it will try to resolve SRV again. But B status is still set to "resolve error" since we haven't reached the timeout yet and SRV resolution fails immediately. But the next server is not tried since the port status (A) remains "neutral". This patch sets the port status to "not working" making the failover to continue with the next server as expected. https://fedorahosted.org/sssd/ticket/2390 Reviewed-by: Pavel Reichl <preichl@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> (cherry picked from commit 5490fa3ea4f6a4118a5188acb0e05daa302ed9d6)
-rw-r--r--src/providers/fail_over.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c
index c47e5f730..32ce02860 100644
--- a/src/providers/fail_over.c
+++ b/src/providers/fail_over.c
@@ -1234,6 +1234,11 @@ resolve_srv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
case SRV_RESOLVE_ERROR: /* query could not be resolved but don't retry yet */
ret = EIO;
state->out = server;
+
+ /* The port status was reseted to neutral but we still haven't reached
+ * timeout to try to resolve SRV record again. We will set the port
+ * status back to not working. */
+ fo_set_port_status(state->meta, PORT_NOT_WORKING);
goto done;
case SRV_RESOLVED: /* The query is resolved and valid. Return. */
state->out = server;