Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1110247 - Failover SRV discovery not honouring priority/weight
Failover SRV discovery not honouring priority/weight
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Jakub Hrozek
Kaushik Banerjee
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-17 05:42 EDT by Jakub Hrozek
Modified: 2015-03-05 05:28 EST (History)
7 users (show)

See Also:
Fixed In Version: sssd-1.12.0-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 05:28:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0441 normal SHIPPED_LIVE sssd bug fix and enhancement update 2015-03-05 10:05:27 EST

  None (edit)
Description Jakub Hrozek 2014-06-17 05:42:07 EDT
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/2357

Using sssd-1.11.5.1-1.el6.x86_64 (from jhrozek's recent COPR repo) on RHEL6.5.

I have the following SRV RR's configured in DNS:

{{{
;; QUESTION SECTION:
;_ldap._tcp.idm.poc1.local.        IN      SRV

;; ANSWER SECTION:
_ldap._tcp.idm.poc1.local. 3600 IN SRV     0 0 389 ipa2.idm.poc1.syseng.tmcs.
_ldap._tcp.idm.poc1.local. 3600 IN SRV     0 0 389 ipa1.idm.poc1.syseng.tmcs.
_ldap._tcp.idm.poc1.local. 3600 IN SRV     10 0 389 ipa2.idm.poc2.syseng.tmcs.
_ldap._tcp.idm.poc1.local. 3600 IN SRV     10 0 389 ipa1.idm.poc2.syseng.tmcs.
_ldap._tcp.idm.poc1.local. 3600 IN SRV     20 0 389 ipa2.idm.poc3.syseng.tmcs.
_ldap._tcp.idm.poc1.local. 3600 IN SRV     20 0 389 ipa1.idm.poc3.syseng.tmcs.
}}}

Tcpdump confirms all 6 records are returned by the DNS server during SSSD's startup.

The SRV discovery only tries one host from each priority level, ie; 3 servers in the above case.
Debug logs seem to confirm this:

{{{
(Wed Jun 11 07:03:57 2014) [sssd[be[idm.local]]] [fo_discover_srv_done] (0x0400): Got answer. Processing...
(Wed Jun 11 07:03:57 2014) [sssd[be[idm.local]]] [fo_discover_srv_done] (0x0400): Got 3 servers
(Wed Jun 11 07:03:57 2014) [sssd[be[idm.local]]] [fo_add_server_to_list] (0x0400): Inserted primary server 'ipa2.idm.poc1.local:389' to service 'IPA'
(Wed Jun 11 07:03:57 2014) [sssd[be[idm.local]]] [fo_add_server_to_list] (0x0400): Inserted primary server 'ipa1.idm.poc2.local:389' to service 'IPA'
(Wed Jun 11 07:03:57 2014) [sssd[be[idm.local]]] [fo_add_server_to_list] (0x0400): Inserted primary server 'ipa2.idm.poc3.local:389' to service 'IPA'
(Wed Jun 11 07:03:57 2014) [sssd[be[idm.local]]] [set_srv_data_status] (0x0100): Marking SRV lookup of service 'IPA' as 'resolved'
}}}

Full debug log and sssd.conf attached.

RFC2782 suggests that for each priority level, all elements should be added to the list (ordered by weight).
Comment 1 Jakub Hrozek 2014-07-14 09:09:54 EDT
Fixed in master:
 * 2be2220f15b2a819a80b07c8881822ef87053c69
 * da6ee4b16f57d24f63c09efa74ead7f7cf315a55
 * cb8c79278d23a5b1deb66ea4af37feebc7137fd0
Comment 3 Kaushik Banerjee 2015-01-02 05:40:17 EST
Verified in version sssd-1.12.2-39.el7

Output from beaker automation run:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: failover-ldap_009: BZ1110247 multiple srv records with same weight and priority
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

‘/etc/named.conf.orig’ -> ‘/etc/named.conf’
Redirecting to /bin/systemctl restart  named.service
Redirecting to /bin/systemctl restart  named.service
Redirecting to /bin/systemctl stop  sssd.service
Redirecting to /bin/systemctl start  sssd.service
:: [ 15:39:07 ] :: Sleeping for 5 seconds
:: [  BEGIN   ] :: Running 'getent passwd puser1'
puser1:*:1001:1001:Posix User1:/home/puser1:
:: [   PASS   ] :: Command 'getent passwd puser1' (Expected 0, got 0)
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'server1.domain1' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'server2.domain1' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'server1.domain2' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'server2.domain2' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'server1.domain3' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'server2.domain3' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'ldapserver.example.com:389'' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'server1.domain4' 
:: [   PASS   ] :: File '/var/log/sssd/sssd_LDAP.log' should contain 'Inserted primary server 'server2.domain4' 
:: [  BEGIN   ] :: Running 'auth_success puser1 Secret123'
spawn ssh -q -l puser1 localhost echo 'login successful'
puser1@localhost's password: 
login successful
:: [   PASS   ] :: Command 'auth_success puser1 Secret123' (Expected 0, got 0)
failover-ldap-009-BZ1110247-multiple-srv-records-with-same-weight-and-priority result: PASS
Comment 5 errata-xmlrpc 2015-03-05 05:28:17 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0441.html

Note You need to log in before you can comment on or make changes to this bug.