Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

SQL Server Replication Agents may exhibit blocking when applying snapshot


View products that this article applies to.

Symptoms

Consider the following scenario:

  • You are using SQL Server replication.
  • You have multiple publications that publish data into one database at the subscriber(s).

While applying the initial snapshot(s), you notice that only one publication is able to apply its snapshot at a time.

You may see a wait resource similar to the following when reviewing SQL activity:

APP: 18:16384:[snapshot_delivery_in_progress_Tr]:(9bcdaf92)
APP: 5:16384:[snapshot_delivery_in_progress_Er]:(3c3b7db9) 
Querying for locking behavior may show resources similar to the following:
APP 16384:[appname]:(fbe42d68)  X
APP 16384:[snapshot_del]:(9bcdaf92) X

 
 

↑ Back to the top


Cause

This behavior is by design.  It occurs because an application lock is used to prevent multiple replication agents from  concurrently applying snapshots of different publications to the same subscriber database.  Because the application lock contains the name of the subscriber database, any publications that publish into the same subscriber database will be impacted.  The result is that only one snapshot can be inserted into the subscriber database at a given time.

↑ Back to the top


Resolution

To work around this issue, specify a different subscriber database for each publication.

↑ Back to the top


More Information

Exclusive locks are used in this situation to help avoid the possibility of replication agents becoming deadlocked with each other.

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2615479
Revision : 1
Created on : 1/7/2017
Published on : 9/22/2011
Exists online : False
Views : 141