On Fri, 4 Jan 2019 at 10:19, Jakub Hrozek <jhrozek@redhat.com> wrote:
Would the stickiness also persist across SRV priority levels? What I
mean is that if server1 had originally the highest priority (the lowest
priority value in the SRV record), but then the SRV record is expired
and the server is suddendly in a lower priority tier, IMO then the server
should be 'forgotten' and a new one chosen..

You're right to highlight this.  Different admins may have different requirements,  perhaps the configuration option "ad_sticky" could control behaviour:

always - Always sticky, prefer the originally discovered server, unless the sticky server has been removed from the service record
priority - Mostly sticky, prefer the originally discovered server, unless its priority in the service record has changed
never - No stickiness (default, and current behaviour), i.e. always potentially change ldap server on expiry of the ldap connection.

In terms of implementation, would this be confined to the AD provider or would IPA also benefit with this?  If so, the perhaps it should live in fail_over_srv.c.  I'm a bit unclear as to how this might be implemented in the fail_over_srv "plugin".  The fo_discover_srv_* functions have a resolv_ctx available to them, but it would seem neater to have a dedicated fo_discover_ctx structure to store the configuration, along with the sticky ldap server name.

Thanks.