We have two AlwaysOn nodes in sync commit.
Occasionally SELECT queries are waiting on HADR_SYNC_COMMIT
.
What is the underlying process that causes it?
- SQL Server 2016 SP1 CU5.
- client sessions are using READ COMMITTED isolation level
Allow Snapshot Isolation
andIs Read Committed Snapshot On
are set toTrue
. But snapshot isolation is not being used because client is enforcing READ COMMITTED.
Query example from primary replica:
select * from dbo.photoFileMetaData where FK_mediaId=@P0
Wait info: (780ms)HADR_SYNC_COMMIT
Status: suspended
Since SELECTs are not updating data, why would they need to wait on a replica sync commit?
Update 2018-08-30:
I was able to capture blocking when it was happening. Here is what is in blocking resource:
metadatalock subresource=QDS_INTERVAL_STABILITY classid=qds_interval dbid=7 lockPartition=0 id=lock1e78c13d580 mode=X