Bug 1623673

Summary: SRV lookup doesn't correctly sort results [rhel-7.5.z]
Product: Red Hat Enterprise Linux 7 Reporter: Jaroslav Reznik <jreznik>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: urgent Docs Contact: Filip Hanzelka <fhanzelk>
Priority: urgent    
Version: 7.4CC: fhanzelk, frenaud, ipa-maint, ndehadra, pasik, pvoborni, rcritten, sumenon, tscherf
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.5.4-10.el7_5.4.2 Doc Type: Bug Fix
Doc Text:
IdM client installation balances the workload among the available masters Previously, when multiple Identity Management (IdM) masters with the same priority were available, one identical master was always picked for IdM client installation. Consequently, client installation did not load-balance the work among the masters. This bug has been fixed, and the client installer, after evaluating the masters' respective priority and weight, now picks a master randomly. As a result, the IdM client installer distributes the load among the masters evenly.
Story Points: ---
Clone Of: 1594142 Environment:
Last Closed: 2018-09-25 19:07:13 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:
Bug Depends On: 1594142    
Bug Blocks:    

Description Jaroslav Reznik 2018-08-29 20:50:50 UTC
This bug has been copied from bug #1594142 and has been proposed to be backported to 7.5 z-stream (EUS).

Comment 3 Sudhir Menon 2018-09-06 05:38:56 UTC
Flo,

Here are the observations on Red Hat Enterprise Linux Server release 7.5 (Maipo)
using ipa-server-4.5.4-10.el7_5.4.3.x86_64

Env:
1. IPA Master with integrated DNS
2. 2 IPA replicas with ipa-dns-install 
3. 3 IPA-clients with resolv.conf as below

search rhel75z.test
nameserver <masterip>
nameserver <replicaip>
nameserver <replica2ip>

Scenario1:

  Record name: master
  SRV record: 1 50 389 master.rhel75z.test
  Record name: replica
  SRV record: 1 100 389 replica.rhel75z.test
  Record name: replica2
  SRV record: 2 100 389 replica2.rhel75z.test

Actual Results:
2 out of 3 clients are getting enrolled to replica2 instead of replica, which is incorrect behaviour considering the priority and weight of replica system. hence marking the bug as FAILEDQA. 

[root@client1 ~]# ipa-client-install 
IPA Server: replica.rhel75z.test

[root@client2 ~]# ipa-client-install 
IPA Server: replica2.rhel75z.test

[root@client3 ~]# ipa-client-install 
IPA Server: replica2.rhel75z.test

Comment 5 Sudhir Menon 2018-09-07 10:43:01 UTC
Re-Tested on Red Hat Enterprise Linux Server release 7.5 (Maipo) using 
ipa-server-4.5.4-10.el7_5.4.3.x86_64
389-ds-base-1.3.7.5-27.el7_5.x86_64
pki-server-10.5.1-15.el7_5.noarch
selinux-policy-3.13.1-192.el7_5.6.noarch

Scenario1: replica has higher priority and weight

[root@master ~]# ipa dnsrecord-show rhel75z.test. _ldap._tcp
  Record name: _ldap._tcp
  SRV record: 1 50 389 master.rhel75z.test., 1 100 389 replica.rhel75z.test., 2 100 389 replica2.rhel75z.test.

[root@client1 ~]# ipa-client-install 
IPA Server: replica.rhel75z.test

[root@client2 ~]# ipa-client-install 
IPA Server: replica.rhel75z.test

[root@client3 ~]# ipa-client-install 
IPA Server: replica.rhel75z.test

[root@client4 ~]# ipa-client-install 
IPA Server: master.rhel75z.test

Scenario2: All servers have same priority and weight
[root@master ~]# ipa dnsrecord-show rhel75z.test. _ldap._tcp
  Record name: _ldap._tcp
  SRV record: 1 100 389 replica.rhel75z.test., 1 100 389 master.rhel75z.test., 1 100 389 replica2.rhel75z.test.


[root@client1 ~]# dig SRV _ldap._tcp.rhel75z.test
_ldap._tcp.rhel75z.test. 86400	IN	SRV	1 100 389 replica.rhel75z.test.
_ldap._tcp.rhel75z.test. 86400	IN	SRV	1 100 389 replica2.rhel75z.test.
_ldap._tcp.rhel75z.test. 86400	IN	SRV	1 100 389 master.rhel75z.test.

[root@client1 ~]# ipa-client-install 
IPA Server: master.rhel75z.test

[root@client2 ~]# dig SRV _ldap._tcp.rhel75z.test
_ldap._tcp.rhel75z.test. 86400	IN	SRV	1 100 389 master.rhel75z.test.
_ldap._tcp.rhel75z.test. 86400	IN	SRV	1 100 389 replica2.rhel75z.test.
_ldap._tcp.rhel75z.test. 86400	IN	SRV	1 100 389 replica.rhel75z.test.

[root@client2 ~]# ipa-client-install 
IPA Server: replica.rhel75z.test

[root@client3 ~]# ipa-client-install 
IPA Server: replica2.rhel75z.test

Scenario3: Priority is same and weight is different
[root@master ~]# ipa dnsrecord-show rhel75z.test. _ldap._tcp
  Record name: _ldap._tcp
  SRV record: 1 10 389 replica.rhel75z.test., 1 20 389 replica2.rhel75z.test., 1 30 389 master.rhel75z.test.

(tried reinstalling client on same machine)..

[root@client1 ~]# ipa-client-install 
IPA Server: master.rhel75z.test

[root@client1 ~]# ipa-client-install 
IPA Server: master.rhel75z.test

[root@client1 ~]# ipa-client-install 
IPA Server: master.rhel75z.test

[root@client1 ~]# ipa-client-install 
IPA Server: master.rhel75z.test

[root@client1 ~]# ipa-client-install 
IPA Server: replica2.rhel75z.test
[root@client1 ~]# ipa-client-install

Comment 6 Florence Blanc-Renaud 2018-09-07 10:44:08 UTC
Moving to ON_QA as the procedure to verify has been fixed.

Comment 10 errata-xmlrpc 2018-09-25 19:07:13 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://access.redhat.com/errata/RHBA-2018:2760