Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

WAIT_AT_LOW_PRIORITY to resolve SCM_M / SCH_S blocking on AlwaysOn Secondary?

$
0
0
I was excited to see the new WAIT_AT_LOW_PRIORITY option for index rebuilds in 2014 as we constantly have SCH_M / SCH_S blocking issues on our AlwaysOn Secondary node when Index rebuilds are happening on the Primary and a long running query is holding a SCH_S on the same object on the secondary.I ran a few tests today thinking that this new option would clear the blocking on the Secondary but it hasn’t worked :( I used the following as a reference : http://www.sqldiablo.com/2012/08/01/alwayson-availability-groups-isolation-levels-selects-blocking-writers/ and did the following:ON SECONDARY KICK OFF LONG RUNNING QUERY:USE [AdventureWorks2012]selectNumbersTable.Numberfrom AdventureWorks2012.dbo.ErrorLog elcross apply (selectNumberfrom(selectrow_number() over (order by s1.name) as numberfrom AdventureWorks2012.sys.sysobjects s1cross apply AdventureWorks2012.sys.sysobjects s2cross apply AdventureWorks2012.sys.sysobjects s3cross apply AdventureWorks2012.sys.sysobjects s4cross apply AdventureWorks2012.sys.sysobjects s5) as InnerNumbersTable) NumbersTablegroup by NumbersTable.Numberorder by NumbersTable.Number desc;ON PRIMARY REBUILD INDEX WITH NEW WAIT_AT_LOW_PRIORITY OPTION:USE [AdventureWorks2012]GOALTER INDEX [NCI_ErrorNumber_ErrorSeverity_ErrorState] ON [dbo].[ErrorLog] REBUILD PARTITION = ALLWITH (ONLINE = ON (WAIT_AT_LOW_PRIORITY (MAX_DURATION= 2 MINUTES, ABORT_AFTER_WAIT=BLOCKERS)));GOWhen I check the Secondary I can see blocking as the long running query has a SCH_S lock and the Index rebuild is waiting on a SCH_M lock.However…..I wait and wait but the blocking doesn't clear. I was expecting the long running query to be killed after 2 minutes to allow the Index Rebuild to happen.Either this is not meant to resolve the AlwaysOn blocking issues or I am not doing the test right… Would be great to hear if anyone has managed to get this one to work.Thanks!

Viewing all articles
Browse latest Browse all 6525

Trending Articles