On 07/30/2014 01:51 PM, Simo Sorce wrote:
On Tue, 2014-07-29 at 13:06 +0200, Pavel Březina wrote:
On 07/28/2014 04:23 PM, Simo Sorce wrote:
On Mon, 2014-07-28 at 13:16 +0200, Pavel Březina wrote:
If previous SRV lookup failed and the SRV lookup status is not yet
reseted to neutral we end up with unresolved meta server with neutral
port status. This caused the failover to stick with the meta server
instead of cycling through all configured servers.
Please rephrase because I am not sure I understand what you are trying
to say in this commit message, this is what I understood (and propose as
the commit message to set):
If a previous SRV lookup failed and the status is not already set to
neutral, then the meta server port status end up being neutral. This
causes the failover code to keep trying with the same meta server
instead of cycling through all configured servers.
Simo.
I don't think you rephrasing is correct. What I'm trying to say is:
There are two meta server status:
- port status (A)
- srv lookup status (B)
1. srv lookup fails, setting B to "resolve error" and A to "not
working", sssd goes offline
2. sssd tries to go back online, setting A to "neutral"
3. it tries to resolve meta server, but B is "resolve error" since we
haven't reached the timeout to set B to "neutral" as well
4. resolving meta server fails, but we don't continue with the next server
I believe my explanation is correct but it maybe needs more words for
those who did not dig in the code. Should I use more verbose explanation
similar to the one above?
Yes please.
Simo.
Hope this is clear now.
From 3124a78b200674d50ea9ae20b620776b54ae23bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <[email protected]>
Date: Mon, 28 Jul 2014 11:48:31 +0200
Subject: [PATCH] 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
---
src/providers/fail_over.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c
index c45fe9c4991b6b283af3124f3e9b581d0e6fad6d..466e3f4de5d7dc2fa4879c457f764b80dba53e5c 100644
--- a/src/providers/fail_over.c
+++ b/src/providers/fail_over.c
@@ -1244,6 +1244,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;
--
1.7.11.7
_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel