dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
358 stars 224 forks source link

SqlAGReplica: Add round-robin read only routing lists #1313

Open codykonior opened 5 years ago

codykonior commented 5 years ago

Details of the scenario you tried and the problem that is occurring

The SqlAGReplica resource accepts a ReadOnlyRoutingList of type [string[]]. On the SMO side this has a matching ReadOnlyRoutingList property of type StringCollection as that's how these lists were defined for SQL Server 2012 and 2014, and as of the latest patches should all be functional.

In SQL 2016 there's an additional SMO property LoadBalancedReadOnlyRoutingList of type System.Collections.Generic.IList<System.Collections.Generic.IList> and an associated read-only property of LoadBalancedReadOnlyRoutingListDisplayString. This is intended to allow the passing of server groups as follows:

READ_ONLY_ROUTING_LIST = (('Server1','Server2'), ('Server3', 'Server4', 'Server5'), 'Server6')

The question is how the DSC resource should be modified to support this:

codykonior commented 5 years ago

@mdaniou

codykonior commented 5 years ago

Another option: we keep the string array, and if server names are passed in they will be used as normal.

If any single entry has parenthesis then each array entry will be parsed into their own groups.

‘Server1’, ‘Server2’ = Use the old style.

‘Server1’, ‘Server2’, ‘(Server3, Server4)’ = Use grouping style.