BUG: Infinite Loop in the lock_article_cache Function May Cause Log Reader to Stop Responding (812263)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

BUG #: 363414 (SHILOH_BUGS)

SYMPTOMS

An infinite loop in the lock_article_cache function might cause the Log Reader to become unresponsive. The different symptoms associated with this infinite loop are:
  • The Log Reader Agent may stop processing commands.
  • You may receive timeout errors with the Log Reader Agent.
  • Multiple Log Reader Agents for different databases on the same computer that is running SQL Server might experience the problem, at the same time.

To identify this problem, run a DBCC STACKDUMP command on SQL Server when the problem occurs. Then, you can review the output.

The following stack is from SQL Server 2000 Service Pack 2 (SP2):
* Short Stack Dump
* 77F827E8 Module(ntdll+000027E8) (NtWaitForSingleObject+0000000B)
* 410714C4 Module(UMS+000014C4) (UmsThreadScheduler::Switch+00000058)
* 4107176A Module(UMS+0000176A) (UmsScheduler::IdleLoop+00000122)
* 410718E9 Module(UMS+000018E9) (UmsScheduler::Suspend+0000007E)
* 41071813 Module(UMS+00001813) (UmsEvent::Wait+00000095)
* 007DCCA5 Module(sqlservr+003DCCA5) (WaitForAcacheAccessEvent+00000035)
* 007DCD1F Module(sqlservr+003DCD1F) (lock_article_cache+0000003B)
* 007D7D7E Module(sqlservr+003D7D7E) (DoReplDone+0000005F)
* 007D7D05 Module(sqlservr+003D7D05) (xp_repldone+00000089)
* 005E4D70 Module(sqlservr+001E4D70) (CSpecProc::ExecuteSpecial+0000012A)
* 005E49B6 Module(sqlservr+001E49B6) (CXProc::Execute+000000A3)
* 005E6BB4 Module(sqlservr+001E6BB4) (CSQLSource::Execute+0000037B)
* 00429DD3 Module(sqlservr+00029DD3) (execrpc+000004CB)
* 0042904D Module(sqlservr+0002904D) (execute_rpc+00000019)
* 00410FCE Module(sqlservr+00010FCE) (process_commands+00000210)
* 41073379 Module(UMS+00003379) (ProcessWorkRequests+0000024A)
* 41073071 Module(UMS+00003071) (ThreadStartRoutine+000000BD)
* 7800A27B Module(MSVCRT+0000A27B) (beginthread+000000CE)
* 77E8758A Module(KERNEL32+0000758A) (SetFilePointer+0000018A)

This stack indicates that you might be experiencing this problem.

CAUSE

An operation that modifies the article cache is canceled before it finishes. Some of the operations that modify the article cache are:
  • Adding a column to a published article (the sp_repladdcolumn stored procedure).
  • Dropping a column from a published article (the sp_repldropcolumn stored procedure).
  • Dropping an article from a publication ( the sp_droparticle stored procedure).
  • Adding a new article to a publication (the sp_addarticle stored procedure).

When a cancel for any of the operations mentioned earlier is triggered on any operation that modifies the article cache, SQL Server does not unlock the article cache correctly. This results in values that are not valid for the resource count and the infinite loop occurs.

WORKAROUND

To work around the problem, make sure that the operations that modify the article cache are not canceled in the middle of execution.

The only way to come out of the infinite loop is to recycle SQL Server where the Log Reader Agents are running. Recycling SQL Server clears up the article cache; therefore, the computer is no longer unresponsive.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Modification Type:MajorLast Reviewed:9/25/2003
Keywords:kbBug KB812263