Hi,

while resetting the failover status the service discovery components are
set to a wrong value. These patches should fix this and should help tp
avoid problems in the future.

Shoud fix trac ticket #756.

bye,
Sumit
From 45a8a84c8475be73d709f66f4140d241b6ad04a0 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sb...@redhat.com>
Date: Mon, 3 Jan 2011 18:27:03 +0100
Subject: [PATCH 1/2] Use the right status when resetting service discovery

---
 src/providers/fail_over.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c
index 2dabaa3..f7dfd5d 100644
--- a/src/providers/fail_over.c
+++ b/src/providers/fail_over.c
@@ -1342,7 +1342,7 @@ void fo_reset_services(struct fo_ctx *fo_ctx)
             fo_set_server_status(server, SERVER_NAME_NOT_RESOLVED);
             fo_set_port_status(server, PORT_NEUTRAL);
             if (server->srv_data != NULL) {
-                set_srv_data_status(server->srv_data, SRV_NOT_RESOLVED);
+                set_srv_data_status(server->srv_data, SRV_NEUTRAL);
             }
         }
     }
-- 
1.7.3.3

From 96372118907e68ca0d37a36a7cb20ddbc7806c96 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sb...@redhat.com>
Date: Mon, 3 Jan 2011 18:29:22 +0100
Subject: [PATCH 2/2] Rename SRV_NOT_RESOLVED to SRV_RESOLVE_ERROR

---
 src/providers/fail_over.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c
index f7dfd5d..331cccc 100644
--- a/src/providers/fail_over.c
+++ b/src/providers/fail_over.c
@@ -46,7 +46,7 @@
 enum srv_lookup_status {
     SRV_NEUTRAL,        /* We didn't try this SRV lookup yet */
     SRV_RESOLVED,       /* This SRV lookup is resolved       */
-    SRV_NOT_RESOLVED,   /* Could not resolve this SRV lookup */
+    SRV_RESOLVE_ERROR,   /* Could not resolve this SRV lookup */
     SRV_EXPIRED         /* Need to refresh the SRV query     */
 };
 
@@ -168,7 +168,7 @@ str_srv_data_status(enum srv_lookup_status status)
         return "neutral";
     case SRV_RESOLVED:
         return "resolved";
-    case SRV_NOT_RESOLVED:
+    case SRV_RESOLVE_ERROR:
         return "not resolved";
     case SRV_EXPIRED:
         return "expired";
@@ -273,7 +273,7 @@ get_srv_data_status(struct srv_data *data)
             data->srv_lookup_status = SRV_EXPIRED;
             data->last_status_change.tv_sec = 0;
             break;
-        case SRV_NOT_RESOLVED:
+        case SRV_RESOLVE_ERROR:
             data->srv_lookup_status = SRV_NEUTRAL;
             data->last_status_change.tv_sec = 0;
             break;
@@ -979,7 +979,7 @@ resolve_srv_send(TALLOC_CTX *mem_ctx, struct tevent_context 
*ev,
         /* we know the DNS domain, just do the lookup */
         resolve_srv_cont(req);
         break;
-    case SRV_NOT_RESOLVED: /* query could not be resolved but don't retry yet 
*/
+    case SRV_RESOLVE_ERROR: /* query could not be resolved but don't retry yet 
*/
         ret = EIO;
         goto done;
     case SRV_RESOLVED:  /* The query is resolved and valid. Return. */
@@ -1122,7 +1122,7 @@ resolve_srv_done(struct tevent_req *subreq)
 
 fail:
     state->out = state->meta;
-    set_srv_data_status(state->meta->srv_data, SRV_NOT_RESOLVED);
+    set_srv_data_status(state->meta->srv_data, SRV_RESOLVE_ERROR);
     tevent_req_error(req, ret);
 }
 
-- 
1.7.3.3

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to