CDC error; RRS feed

  • Question

  • We have a database enabled for CDC and last few days we encountered this error multiple times
     The Log-Scan Process failed to construct a replicated command from log sequence number (LSN) 
    {0026bfad:00073eaa:002d}. Back up the publication database and contact Customer Support Services. [SQLSTATE 42000] (Error 18805)  Log Scan process failed in processing log records. Refer to previous errors in the current session to identify the cause and correct any associated problems. [SQLSTATE 42000] (Error 22859)  The statement has been terminated. [SQLSTATE 01000] (Error 3621)

    Checking the sys.dm_cdc_errors we notice this "Violation of PRIMARY KEY constraint 'lsn_time_mapping_clustered_idx'. Cannot insert duplicate key in object 'cdc.lsn_time_mapping'. The duplicate key value 
    is (0x0026bfad00073eaa002c)." So we go and cleanup from cdc.lsn_time_mapping and the CDC process continues. But we cannot find the reason why its happening . Also see a connect item from sometime ago.


    But Our server is running sql 2008 sp3 cu2(10.0.5768) . So anyone know if we can still hit that issue? 

    note:Also this database has been enabled for CDC for several years and we have started encountering this issue recently.


    • Edited by SQL_Jay Friday, October 4, 2013 4:28 PM
    Friday, October 4, 2013 4:12 PM

All replies

  • Hi,

    Thanks for posting question here.
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.


    Candy Zhou

    • Edited by Candy_Zhou Monday, October 7, 2013 8:11 AM edit
    Monday, October 7, 2013 8:11 AM
  • The connect error is different from what you are experiencing. This is a Server-specific issue needing live troubleshooting and data/trace analysis. Your question requires a more in-depth level of support. Please visit the below link to see the various support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone
    Tuesday, October 22, 2013 11:19 PM
  • I spotted the exact same thing on our SQL 2008 (10.0.6000) the other day.

    Was this ever recognised as a bug and was a hotfix ever released?

    I managed to resolve this in the short term by performing the following (however I would much prefer an actual preventative fix) :

    1) Stop the CDC Capture job and disable.

    2) Execute the following:

    select * into bkp_lsn_time_mapping from cdc.lsn_time_mapping
    truncate table cdc.lsn_time_mapping

    3) Enable and Start the CDC Capture job.

    Wait for a few minutes until values appear in the cdc.lsn_time_mapping table (usually this is when the capture job reaches step 2).

    4) run the following query:

    insert into cdc.lsn_time_mapping
    select * from bkp_lsn_time_mapping
    where start_lsn not in (select start_lsn from cdc.lsn_time_mapping) 

    This appears to resolve the issue and allows the capture to continue.

    If anybody can see a reason why this is a bad idea, please shoot me down!


    Tuesday, December 1, 2015 8:26 AM