Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1110247

Summary: Failover SRV discovery not honouring priority/weight
Product: Red Hat Enterprise Linux 7 Reporter: Jakub Hrozek <jhrozek>
Component: sssdAssignee: Jakub Hrozek <jhrozek>
Status: CLOSED ERRATA QA Contact: Kaushik Banerjee <kbanerje>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: grajaiya, jgalipea, lslebodn, mkosek, parsonsa, pbrezina, preichl
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 10:28:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jakub Hrozek 2014-06-17 09:42:07 UTC
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 13:09:54 UTC
Fixed in master:
 * 2be2220f15b2a819a80b07c8881822ef87053c69
 * da6ee4b16f57d24f63c09efa74ead7f7cf315a55
 * cb8c79278d23a5b1deb66ea4af37feebc7137fd0

Comment 3 Kaushik Banerjee 2015-01-02 10:40:17 UTC
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 10:28:17 UTC
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