<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic guidance on cleainig up after long cdc failure in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175641#M57030</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;We had a CDC failure which took far to long to resolve. A conversation with vendors on that.&lt;BR /&gt;Does anyone have any guidance on the process steps to identifying the missed changes and applying them to the tables.&lt;/P&gt;&lt;P&gt;I have so far run a query to identify keys in end tables where there are variations in data (left join)&lt;/P&gt;&lt;P&gt;It is suggesting some tables are okay and some have work to do rows with changes where source doesn't match the destination tables&lt;/P&gt;&lt;P&gt;A merge to update seems the next logical step.&lt;/P&gt;&lt;P&gt;Anything else people would like to throw in&amp;nbsp;&lt;BR /&gt;Do I pause the ingestion and gateways while doing this?&amp;nbsp;&lt;BR /&gt;A full refresh needed to be done on fixing the issue with the pipelines&lt;/P&gt;&lt;P&gt;Any further advice?&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2026 01:24:08 GMT</pubDate>
    <dc:creator>turagittech</dc:creator>
    <dc:date>2026-11-05T01:24:08Z</dc:date>
    <item>
      <title>guidance on cleainig up after long cdc failure</title>
      <link>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175641#M57030</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;We had a CDC failure which took far to long to resolve. A conversation with vendors on that.&lt;BR /&gt;Does anyone have any guidance on the process steps to identifying the missed changes and applying them to the tables.&lt;/P&gt;&lt;P&gt;I have so far run a query to identify keys in end tables where there are variations in data (left join)&lt;/P&gt;&lt;P&gt;It is suggesting some tables are okay and some have work to do rows with changes where source doesn't match the destination tables&lt;/P&gt;&lt;P&gt;A merge to update seems the next logical step.&lt;/P&gt;&lt;P&gt;Anything else people would like to throw in&amp;nbsp;&lt;BR /&gt;Do I pause the ingestion and gateways while doing this?&amp;nbsp;&lt;BR /&gt;A full refresh needed to be done on fixing the issue with the pipelines&lt;/P&gt;&lt;P&gt;Any further advice?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2026 01:24:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175641#M57030</guid>
      <dc:creator>turagittech</dc:creator>
      <dc:date>2026-11-05T01:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: guidance on cleainig up after long cdc failure</title>
      <link>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175643#M57031</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/74890"&gt;@turagittech&lt;/a&gt;&amp;nbsp;!,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Your approach of comparing the source and destination tables to identify discrepancies is a good starting point. A &lt;STRONG&gt;MERGE&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;would be a reasonable next step to correct the mismatched records.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A few recommendations before proceeding:&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL start="1"&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;Confirm the time window during which CDC changes were missed. This will help validate whether the discrepancies are related to the reported failure.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;Along with identifying inserts and updates, make sure to check for records that were deleted from the source but still exist in the destination. A left join from source to destination alone may not capture these.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;I would recommend temporarily pausing ingestion for the affected tables while performing the corrective MERGE&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;operations. This helps avoid concurrent updates and potential conflicts between the manual corrections and incoming CDC changes. If pausing is not feasible, ensure that the merge logic prevents older records from overwriting newer changes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Before making any changes, consider creating a Delta table clone or preserving a known table version as a recovery point.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;Test the merge logic on a smaller dataset first and ensure it handles inserts, updates, and deletes correctly. If the source provides a reliable timestamp or sequence number, use it to prevent older changes from overwriting newer data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Once the corrections are applied, rerun the source-to-destination comparison to confirm that all identified discrepancies have been resolved, including missing deletes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Regarding the full refresh,&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;it may not be necessary solely to correct missed CDC records. However, if the pipeline state or checkpoint was impacted by the failure, a full refresh might be required depending on the CDC connector's recovery capabilities. Since you mentioned that a full refresh has already been performed, I would first validate the consistency between the current source and destination before initiating another refresh.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Additionally, I would suggest checking whether your CDC vendor supports a table-level resync or backfill operation, as this may be preferable to manually correcting the records.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;In short, my recommendation is to pause ingestion for the affected tables, reconcile differences, apply necessary corrections, validate the results, and then resume ingestion from a verified CDC position.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2026 01:40:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175643#M57031</guid>
      <dc:creator>K_Anudeep</dc:creator>
      <dc:date>2026-11-05T01:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: guidance on cleainig up after long cdc failure</title>
      <link>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175748#M57049</link>
      <description>&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;Hi,&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/74890"&gt;@turagittech&lt;/a&gt;&lt;FONT&gt;&lt;FONT&gt;&amp;nbsp;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Your source-to-target comparison is a good starting point. Check missing inserts, changed values, and records deleted from the source separately. A source-to-target left join alone can miss deletes.&lt;/P&gt;&lt;P&gt;Since you mentioned a full refresh, first validate the resulting tables before applying another repair.&lt;/P&gt;&lt;P&gt;For the affected tables, coordinate a controlled pause of destination writes during reconciliation, following the connector's recovery procedure. Whether the gateway should also be paused depends on the connector and source log retention.&lt;/P&gt;&lt;P&gt;Before manually modifying pipeline-managed tables, check whether the connector supports a table-level resync. If a corrective MERGE is appropriate, ensure older snapshot data cannot overwrite newer CDC events.&lt;/P&gt;&lt;P&gt;Which CDC connector are you using, and did the full refresh complete successfully for all affected tables?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2026 04:07:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175748#M57049</guid>
      <dc:creator>Jen_Evangelista</dc:creator>
      <dc:date>2026-11-06T04:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: guidance on cleainig up after long cdc failure</title>
      <link>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175924#M57074</link>
      <description>&lt;P&gt;Checked the full refresh.&lt;/P&gt;&lt;P&gt;I can easily control pauses as we only update end user tables one a day&lt;/P&gt;&lt;P&gt;It is SQL Server CDC. Full refresh completed Ok&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2026 23:08:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/175924#M57074</guid>
      <dc:creator>turagittech</dc:creator>
      <dc:date>2026-11-08T23:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: guidance on cleainig up after long cdc failure</title>
      <link>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/176761#M57201</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/74890"&gt;@turagittech&lt;/a&gt;, I took a look at both internal and external documentation and here is what I found.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/60098"&gt;@K_Anudeep&lt;/a&gt; and &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/266991"&gt;@Jen_Evangelista&lt;/a&gt; covered the reconciliation basics well: check deletes separately, keep a recovery point, validate before repairing anything else. I'm assuming this is the Lakeflow Connect SQL Server connector, since you mention gateways and ingestion pipelines. With that in mind, here's how I'd finish the cleanup.&lt;/P&gt;
&lt;H2&gt;The refreshed tables are already repaired&lt;/H2&gt;
&lt;P&gt;For database connectors, a full refresh takes a new snapshot through the gateway, then applies it plus any changes captured since in one atomic update. Tables in that refresh should now match the source, so there's no MERGE needed there, and I'd steer away from hand-patching connector-managed tables anyway.&lt;/P&gt;
&lt;P&gt;Was your comparison run before or after the refresh? If before, rerun it. If mismatches remain, check:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Tables left out of the refresh selection. Any table whose change window could have expired needs a full refresh too.&lt;/LI&gt;
&lt;LI&gt;Timing and type differences. Rows changed since the last update, or datetime and decimal mappings, can look like mismatches.&lt;/LI&gt;
&lt;LI&gt;A partial refresh. If the update failed during &lt;CODE&gt;Initializing&lt;/CODE&gt; or &lt;CODE&gt;Resetting tables&lt;/CODE&gt;, rerun it with the same selection.&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2&gt;Repair the end user tables&lt;/H2&gt;
&lt;P&gt;The refresh reloaded data instead of replaying events, so your downstream tables never saw the missed changes. Deletes are the sneaky ones: a row deleted during the outage is simply absent from the new snapshot.&lt;/P&gt;
&lt;P&gt;With a once-a-day load, the simplest fix is to rebuild the affected end user tables from the refreshed ones. If they're too big for that, use a MERGE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;MERGE INTO main.gold.customer AS t
USING main.bronze.customer AS s
  ON t.id = s.id
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *
WHEN NOT MATCHED BY SOURCE THEN DELETE;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE&gt;WHEN NOT MATCHED BY SOURCE&lt;/CODE&gt; deletes every unmatched target row, so the &lt;CODE&gt;USING&lt;/CODE&gt; side has to be the complete set for whatever the target holds. Take a clone first, as K_Anudeep suggested, then validate with row counts and a duplicate-key check against SQL Server.&lt;/P&gt;
&lt;P&gt;If a downstream table reads the ingested tables as a stream or through change data feed, expect it to need a full refresh of its own.&lt;/P&gt;
&lt;H2&gt;Pausing&lt;/H2&gt;
&lt;P&gt;Don't stop the gateway. It has to run continuously, because a stopped gateway can lose changes once SQL Server cleans up its log, and that puts you back at a full refresh. Pause your daily end user load while you repair.&lt;/P&gt;
&lt;P&gt;One caveat: if history tracking (SCD type 2) is on, the full refresh erased that history, and it isn't recoverable from the Databricks side.&lt;/P&gt;
&lt;H2&gt;Preventing a repeat&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;CDC retention. SQL Server keeps 3 days by default (4320 minutes). Extend it with &lt;CODE&gt;sys.sp_cdc_change_job &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9375"&gt;@Job&lt;/a&gt;_type = 'cleanup', @retention = &amp;lt;minutes&amp;gt;&lt;/CODE&gt; to cover the longest gateway outage you'd expect.&lt;/LI&gt;
&lt;LI&gt;Notifications on the gateway as well as the ingestion pipeline, so a stall gets noticed inside that window.&lt;/LI&gt;
&lt;LI&gt;Staging isn't a substitute. It only holds what the gateway already extracted, and it's cleaned up after 25 to 30 days.&lt;/LI&gt;
&lt;LI&gt;Auto full refresh lets the pipeline recover on its own from log cleanup events, though it also erases SCD type 2 history.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;References:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Fully refresh target tables: &lt;A href="https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/full-refresh" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/full-refresh&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Ingest data from SQL Server: &lt;A href="https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-pipeline" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-pipeline&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;SQL Server connector limitations: &lt;A href="https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-limits" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-limits&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Common pipeline maintenance tasks: &lt;A href="https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/pipeline-maintenance" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/pipeline-maintenance&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Enable built-in CDC in Microsoft SQL Server: &lt;A href="https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server/cdc" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server/cdc&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;SQL Server change data capture (Microsoft): &lt;A href="https://learn.microsoft.com/en-us/sql/relational-databases/track-changes/about-change-data-capture-sql-server/" target="_blank"&gt;https://learn.microsoft.com/en-us/sql/relational-databases/track-changes/about-change-data-capture-sql-server/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;MERGE INTO: &lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/delta-merge-into" target="_blank"&gt;https://docs.databricks.com/aws/en/sql/language-manual/delta-merge-into&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you found this answer helpful please check off "Accept as Solutions" so that others can have confidence in the answer.&lt;/P&gt;
&lt;P&gt;Regards, Louis.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2026 12:32:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/176761#M57201</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2026-11-18T12:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: guidance on cleainig up after long cdc failure</title>
      <link>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/176801#M57207</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/74890"&gt;@turagittech&lt;/a&gt; and &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/34815"&gt;@Louis_Frolio&lt;/a&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Louis provided an excellent explanation of the Lakeflow Connect recovery process. I'd like to complement it with a practical reconciliation and validation approach, especially since the SQL Server CDC full refresh completed successfully and your downstream tables are updated only once per day.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;The important distinction is between recovering the ingestion state and restoring the consistency of downstream data products.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; A successful full refresh addresses the former, but does not automatically guarantee the latter.&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN&gt;1. Build a reconciliation report before changing anything&lt;/SPAN&gt;&lt;/H3&gt;&lt;P&gt;&lt;SPAN&gt;Assuming the refreshed ingestion table represents the complete current source state, we can classify discrepancies into missing rows, stale values, and unexpected rows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For illustration, suppose we have:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;main.bronze.customer&lt;/SPAN&gt;&lt;SPAN&gt;: refreshed SQL Server ingestion table&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;main.gold.customer&lt;/SPAN&gt;&lt;SPAN&gt;: downstream customer table&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;SPAN&gt;: unique business key&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;SPAN&gt;status&lt;/SPAN&gt;&lt;SPAN&gt;: columns expected to match&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;SPAN&gt;WITH differences AS (
  SELECT
    COALESCE(s.id, t.id) AS customer_id,
    CASE
      WHEN t.id IS NULL THEN 'MISSING_IN_TARGET'
      WHEN s.id IS NULL THEN 'MISSING_IN_SOURCE'
      WHEN NOT (s.name &amp;lt;=&amp;gt; t.name)
        OR NOT (s.status &amp;lt;=&amp;gt; t.status)
        THEN 'VALUE_MISMATCH'
      ELSE 'MATCHED'
    END AS reconciliation_status
  FROM main.bronze.customer s
  FULL OUTER JOIN main.gold.customer t
    ON s.id = t.id
)
SELECT
  reconciliation_status,
  COUNT(*) AS row_count
FROM differences
GROUP BY reconciliation_status
ORDER BY reconciliation_status;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;The null-safe &lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; comparison avoids treating two NULL values as different.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Before using this approach, verify that &lt;/SPAN&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;SPAN&gt; is unique on both sides and that the Gold table is intended to represent the same current-state population. If Gold applies additional filtering or transformations, compare it against the expected transformed source instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, &lt;/SPAN&gt;&lt;SPAN&gt;MISSING_IN_SOURCE&lt;/SPAN&gt;&lt;SPAN&gt; does not automatically mean a row should be deleted: confirm that the source snapshot covers the complete relevant population.&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN&gt;2. Validate key uniqueness&lt;/SPAN&gt;&lt;/H3&gt;&lt;P&gt;&lt;SPAN&gt;Duplicate business keys can make reconciliation misleading and cause ambiguous MERGE operations.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;SELECT id, COUNT(*) AS occurrences
FROM main.bronze.customer
GROUP BY id
HAVING COUNT(*) &amp;gt; 1;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Repeat this check for the downstream table.&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN&gt;3. Establish a controlled repair boundary&lt;/SPAN&gt;&lt;/H3&gt;&lt;P&gt;&lt;SPAN&gt;Since the downstream load runs once daily, I'd recommend:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Complete the ingestion refresh and capture a consistent source snapshot or version.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Pause the downstream publication job, not the SQL Server ingestion gateway.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Preserve a recovery point for the downstream Delta table.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Run reconciliation and record the discrepancy counts.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Rebuild or repair the affected downstream table.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Rerun reconciliation against the same source snapshot.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Resume the downstream job only after validation succeeds.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;This avoids comparing two datasets that are changing independently during recovery.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For an independently managed Delta table, a recovery point could be created using:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;CREATE TABLE main.backup.customer_pre_repair
DEEP CLONE main.gold.customer;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Use the appropriate backup catalog/schema, permissions, and retention policy.&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN&gt;4. Rebuild versus MERGE&lt;/SPAN&gt;&lt;/H3&gt;&lt;P&gt;&lt;SPAN&gt;If Gold is a current-state projection with deterministic transformations, rebuilding it from the refreshed source is usually easier to reason about.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If a MERGE is required, explicitly map the business columns rather than assuming &lt;/SPAN&gt;&lt;SPAN&gt;UPDATE SET *&lt;/SPAN&gt;&lt;SPAN&gt; is appropriate for every downstream schema.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would only enable &lt;/SPAN&gt;&lt;SPAN&gt;WHEN NOT MATCHED BY SOURCE THEN DELETE&lt;/SPAN&gt;&lt;SPAN&gt; when the source contains the complete expected population and the downstream table is not intended to retain historical or independently managed records.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For SCD Type 2 tables or event-based downstream models, a current-state snapshot cannot reconstruct historical changes that are no longer available. That requires a separate recovery strategy.&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN&gt;5. Add a reconciliation gate&lt;/SPAN&gt;&lt;/H3&gt;&lt;P&gt;&lt;SPAN&gt;For future failures, consider storing the reconciliation results as an operational quality check:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Missing target keys&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Unexpected target keys&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Value mismatches&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Duplicate business keys&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Source snapshot version&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Downstream table version&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Validation timestamp&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;The downstream publication workflow can then fail or require manual approval when unexpected differences remain.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;One question that would help narrow down the safest approach:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; Are your end-user tables current-state Delta tables, or do they maintain historical records or additional business transformations?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That distinction determines whether a straightforward rebuild is sufficient or whether a more targeted recovery is necessary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this adds a useful validation layer to the recovery steps already suggested.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2026 18:55:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/guidance-on-cleainig-up-after-long-cdc-failure/m-p/176801#M57207</guid>
      <dc:creator>Jen_Evangelista</dc:creator>
      <dc:date>2026-11-18T18:55:34Z</dc:date>
    </item>
  </channel>
</rss>

