sqlsql-servercdc

CDC Clean Job Is not Deleting Rows


In my CDC table. I have,

__$start_lsn         __$end_lsn        __$seqval     __$operation   __$update_mask
0x0000004600002EF40004  NULL    0x0000004600002EF40003  3             0x08
0x0000004600002EF40004  NULL    0x0000004600002EF40003  4             0x08

In my msdb.dbo.cdc_jobs

database_id job_type job_id maxtrans    maxscans    continuous  pollinginterval retention   threshold
9           capture   xxx        500     10           1              5              0        0
9           cleanup   xx          0      0             0             0             4320   5000

select sys.Fn_cdc_map_lsn_to_time(0x0000004600002EF40004) returns 2023-04-08 11:23:25.467

Retention is 3 days. Cleanup agent job is running sys.sp_MScdc_cleanup_job daily. Why there are still rows in my CDC table as I am thinking after 3 days retention these old rows should be deleted?


Solution

  • It was SQL Server 2017 issue. After installing the cumulative update it start deleting.

    CDC capture sys.sp_MScdc_capture_job throwing maximum nesting level error