FIX: A blocking issue occurs when you run the Merge Agent in SQL Server 2005

Article translations Article translations
Article ID: 959023 - View products that this article applies to.
Expand all | Collapse all

On This Page

SYMPTOMS

In Microsoft SQL Server 2005, you configure a merge publication. When you run the Merge Agent, a blocking issue occurs. When you monitor the blocking issue, you find the following behaviors:
  • In the output of the blocking script that you created to monitor this issue, some threads that are running replication stored procedures are blocked. For example, you may notice that the blocked threads are running the following replication stored procedures:
    • The sp_MSinsertgenhistory stored procedure
    • The sp_MSgetmakegenerationappl stored procedure
    • The sp_MSenumgenerations stored procedure
    Note You can also find the threads that are blocked by using the Activity Monitor in SQL Server Management Studio.

    For more information about how to monitor an issue by creating a blocking script, click the following article number to view the article in the Microsoft Knowledge Base:
    271509 How to monitor blocking in SQL Server 2005 and in SQL Server 2000
  • In a SQL Server trace, a transaction that is opened through the sp_mergemetadataretentioncleanup stored procedure may still be running even though the stored procedure that calls the sp_mergemetadataretentioncleanup stored procedure has completed. Additionally, you may find an Attention event in the transaction. The stored procedure that calls the sp_mergemetadataretentioncleanup stored procedure may be one of the following stored procedures:
    • The sp_MSinsertgenhistory stored procedure
    • The sp_MSgetmakegenerationappl stored procedure
    • The sp_MSenumgenerations stored procedure.
    For example, you may find records that resemble the following in the SQL Server trace:
    Collapse this tableExpand this table
    EventClass TextData ObjectName DBID TransactionID HostName ClientProcessIDApplicationName SPID
    RPC:Completed exec sp_MSenumgenerations 1051201,'9B9CC268-A43A-4736-9481-0B99227C3BF0',1 sp_Msenumgenerations 5 525491216 HostName1896 ApplicationName69
    Collapse this tableExpand this table
    EventClass TextData ObjectName DBID TransactionID HostName ClientProcessIDApplicationName SPID
    SP:StmtCompletedbegin transactionsp_mergemetadataretentioncleanup5 525491216 HostName1896 ApplicationName69
    SP:StmtStarting select NULL from dbo.MSmerge_contents with(TABLOCK ,HOLDLOCK) where 1=2sp_mergemetadataretentioncleanup5 525491216 HostName1896 ApplicationName69
    Collapse this tableExpand this table
    EventClass TextData ObjectName DBID TransactionID HostName ClientProcessIDApplicationName SPID
    Attention5 525491216 HostName1896 ApplicationName69

CAUSE

This issue occurs because the merge metadata cleanup process does not set the XACT_ABORT option to ON for the transaction. When the sp_mergemetadataretentioncleanup stored procedure is running, if an unexpected exception such as a network issue occurs, the transaction is not rolled back. When the transaction is not rolled back, the lock resources that are held by the transaction is not released.

RESOLUTION

Service pack information

To resolve this problem, obtain the latest service pack for SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in SQL Server 2005 Service Pack 3.

MORE INFORMATION

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 959023 - Last Review: December 16, 2008 - Revision: 1.0
APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Workgroup Edition
Keywords: 
kbsql2005repl kbexpertiseadvanced kbtshoot kbfix kbbug KB959023

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com