This is a bit late, but below are the changes detected between CU 8 and CU 9:
The view sys.dm_hadr_availability_replica_states has a new column called write_lease_remaining_ticks
The Microsoft documentation doesn’t mention this column yet, but the below new messages do give an idea on why it has been added.
The following messages have been added:
Message ID | Severity | Is Event Logged | Text |
47115 | 16 | No | The ‘%ls’ option is not valid for WSFC availability group ‘%.*ls’. Remove the option or set the ‘CLUSTER_TYPE’ option to a different value, then retry the operation. |
47116 | 16 | No | The external lease cannot be set on availability group ‘%.*ls’. External Lease updates are not enabled for this availability group. |
47117 | 16 | No | The ‘%ls’ option must be specified with a valid time value when updating the Availability Group’s external write lease status on availability group ‘%.*ls’. |
47118 | 16 | No | The ‘%ls’ option must be specified with a valid value when updating the external lease status on availability group ‘%.*ls’. |
47119 | 16 | No | The current write lease of the availability group ‘%.*ls’ is still valid. The lease expiration time cannot be set to an earlier time than its current value. |
The following Module changes occurred:
sys.dm_hadr_availability_replica_states now includes a reference to the new write_lease_remaining_ticks
sys.sp_vupgrade_replsecurity_metadata has moved away from using the legacy dbo.sysdatabases and now uses sys.databases and excludes database snapshots from its check
New | Old |
CREATE VIEW sys.dm_hadr_availability_replica_states AS SELECT ars.replica_id, ars.group_id, ars.is_local, ars.role, ars.role_desc, ars.operational_state, ars.operational_state_desc, ars.connected_state, ars.connected_state_desc, recovery_health = CASE WHEN dbs.database_state_aggr IS NULL THEN NULL WHEN ars.configured_database_count > dbs.database_count THEN CAST (0 AS TINYINT) — ONLINE_IN_PROGRESS WHEN dbs.database_state_aggr = 0 THEN CAST (1 AS TINYINT) — ONLINE ELSE CAST (0 AS TINYINT) END, — ONLINE_IN_PROGRESS recovery_health_desc = CASE WHEN dbs.database_state_aggr IS NULL THEN CAST (NULL AS NVARCHAR(60)) WHEN ars.configured_database_count > dbs.database_count THEN CAST (‘ONLINE_IN_PROGRESS’ AS NVARCHAR(60)) WHEN dbs.database_state_aggr = 0 THEN CAST (‘ONLINE’ AS NVARCHAR(60)) ELSE CAST (‘ONLINE_IN_PROGRESS’ AS NVARCHAR(60)) END, synchronization_health = CASE WHEN (war.availability_mode = 4 AND ars.connected_state = 1) THEN CAST (2 AS TINYINT) — Configuration-only, always healthy when connected WHEN dbs.synchronization_health_aggr IS NULL THEN CAST (0 AS TINYINT) — NOT_HEALTHY WHEN ars.configured_database_count > dbs.database_count THEN CAST (0 AS TINYINT) — NOT_HEALTHY (one or more DBs not joined) ELSE CAST (dbs.synchronization_health_aggr AS TINYINT) END, synchronization_health_desc = CASE WHEN (war.availability_mode = 4 AND ars.connected_state = 1) THEN CAST (‘HEALTHY’ AS NVARCHAR(60)) WHEN dbs.synchronization_health_aggr IS NULL THEN CAST (‘NOT_HEALTHY’ AS NVARCHAR(60)) WHEN ars.configured_database_count > dbs.database_count THEN CAST (‘NOT_HEALTHY’ AS NVARCHAR(60)) WHEN dbs.synchronization_health_aggr = 2 THEN CAST (‘HEALTHY’ AS NVARCHAR(60)) WHEN dbs.synchronization_health_aggr = 1 THEN CAST (‘PARTIALLY_HEALTHY’ AS NVARCHAR(60)) ELSE CAST (‘NOT_HEALTHY’ AS NVARCHAR(60)) END, ars.last_connect_error_number, ars.last_connect_error_description, ars.last_connect_error_timestamp, ars.write_lease_remaining_ticks FROM sys.dm_hadr_internal_availability_replica_states ars LEFT OUTER JOIN ( SELECT replica_id, database_count = COUNT (*), synchronization_health_aggr = MIN (synchronization_health), database_state_aggr = MAX (database_state) FROM sys.dm_hadr_database_replica_states GROUP BY replica_id ) AS dbs ON (ars.real_replica_id = dbs.replica_id) LEFT OUTER JOIN ( SELECT ag_replica_id, availability_mode FROM sys.dm_hadr_internal_wsfc_ag_replicas ) AS war ON (ars.real_replica_id = war.ag_replica_id) |
CREATE VIEW sys.dm_hadr_availability_replica_states AS SELECT ars.replica_id, ars.group_id, ars.is_local, ars.role, ars.role_desc, ars.operational_state, ars.operational_state_desc, ars.connected_state, ars.connected_state_desc, recovery_health = CASE WHEN dbs.database_state_aggr IS NULL THEN NULL WHEN ars.configured_database_count > dbs.database_count THEN CAST (0 AS TINYINT) — ONLINE_IN_PROGRESS WHEN dbs.database_state_aggr = 0 THEN CAST (1 AS TINYINT) — ONLINE ELSE CAST (0 AS TINYINT) END, — ONLINE_IN_PROGRESS recovery_health_desc = CASE WHEN dbs.database_state_aggr IS NULL THEN CAST (NULL AS NVARCHAR(60)) WHEN ars.configured_database_count > dbs.database_count THEN CAST (‘ONLINE_IN_PROGRESS’ AS NVARCHAR(60)) WHEN dbs.database_state_aggr = 0 THEN CAST (‘ONLINE’ AS NVARCHAR(60)) ELSE CAST (‘ONLINE_IN_PROGRESS’ AS NVARCHAR(60)) END, synchronization_health = CASE WHEN (war.availability_mode = 4 AND ars.connected_state = 1) THEN CAST (2 AS TINYINT) — Configuration-only, always healthy when connected WHEN dbs.synchronization_health_aggr IS NULL THEN CAST (0 AS TINYINT) — NOT_HEALTHY WHEN ars.configured_database_count > dbs.database_count THEN CAST (0 AS TINYINT) — NOT_HEALTHY (one or more DBs not joined) ELSE CAST (dbs.synchronization_health_aggr AS TINYINT) END, synchronization_health_desc = CASE WHEN (war.availability_mode = 4 AND ars.connected_state = 1) THEN CAST (‘HEALTHY’ AS NVARCHAR(60)) WHEN dbs.synchronization_health_aggr IS NULL THEN CAST (‘NOT_HEALTHY’ AS NVARCHAR(60)) WHEN ars.configured_database_count > dbs.database_count THEN CAST (‘NOT_HEALTHY’ AS NVARCHAR(60)) WHEN dbs.synchronization_health_aggr = 2 THEN CAST (‘HEALTHY’ AS NVARCHAR(60)) WHEN dbs.synchronization_health_aggr = 1 THEN CAST (‘PARTIALLY_HEALTHY’ AS NVARCHAR(60)) ELSE CAST (‘NOT_HEALTHY’ AS NVARCHAR(60)) END, ars.last_connect_error_number, ars.last_connect_error_description, ars.last_connect_error_timestamp FROM sys.dm_hadr_internal_availability_replica_states ars LEFT OUTER JOIN ( SELECT replica_id, database_count = COUNT (*), synchronization_health_aggr = MIN (synchronization_health), database_state_aggr = MAX (database_state) FROM sys.dm_hadr_database_replica_states GROUP BY replica_id ) AS dbs ON (ars.real_replica_id = dbs.replica_id) LEFT OUTER JOIN ( SELECT ag_replica_id, availability_mode FROM sys.dm_hadr_internal_wsfc_ag_replicas ) AS war ON (ars.real_replica_id = war.ag_replica_id) |
CREATE PROCEDURE sys.sp_vupgrade_replsecurity_metadata AS BEGIN SET NOCOUNT ON DECLARE @retcode int, — Security Check IF LOWER(DB_NAME()) != N’master’ — make sure user has already upgraded msdb BEGIN TRANSACTION DECLARE cursorDatabases CURSOR LOCAL FAST_FORWARD FOR OPEN cursorDatabases FETCH cursorDatabases INTO @has_dbaccess, @is_distributiondb, @database, @dbname WHILE @@FETCH_STATUS != -1 EXEC @retcode = sys.sp_executesql @statement = @statement, IF @is_upgraded = 1 EXEC @retcode = @statement SELECT @statement = N’SELECT @is_subscriberdb = 0 ‘ + EXEC @retcode = sys.sp_executesql @statement = @statement, IF @is_subscriberdb = 1 EXEC @retcode = @statement FETCH cursorDatabases INTO @has_dbaccess, @is_distributiondb, @database, @dbname CLOSE cursorDatabases COMMIT TRANSACTION tr_upgrade_security_meta RETURN 0 RETURN 1 |
CREATE PROCEDURE sys.sp_vupgrade_replsecurity_metadata AS BEGIN SET NOCOUNT ON DECLARE @retcode int, — Security Check IF LOWER(DB_NAME()) != N’master’ — make sure user has already upgraded msdb BEGIN TRANSACTION DECLARE cursorDatabases CURSOR LOCAL FAST_FORWARD FOR OPEN cursorDatabases FETCH cursorDatabases INTO @has_dbaccess, @is_distributiondb, @database, @dbname WHILE @@FETCH_STATUS != -1 EXEC @retcode = sys.sp_executesql @statement = @statement, IF @is_upgraded = 1 EXEC @retcode = @statement SELECT @statement = N’SELECT @is_subscriberdb = 0 ‘ + EXEC @retcode = sys.sp_executesql @statement = @statement, IF @is_subscriberdb = 1 EXEC @retcode = @statement FETCH cursorDatabases INTO @has_dbaccess, @is_distributiondb, @database, @dbname CLOSE cursorDatabases COMMIT TRANSACTION tr_upgrade_security_meta RETURN 0 RETURN 1 |
That’s all folks.