<?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 Transaction Log Failed Integrity Checks in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/transaction-log-failed-integrity-checks/m-p/112307#M44171</link>
    <description>&lt;P&gt;I have started to receive the following error message - that the transaction log has failed integrity checks - when attempting to optimize and run compaction on a table. It also occurs when I attempt to alter this table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dave_Nithio_1-1741718129217.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/15345i0F598DD907FE7B40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dave_Nithio_1-1741718129217.png" alt="Dave_Nithio_1-1741718129217.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This blocks my pipeline from running. What is strange is that I can run queries against the table without issue and all data is intact, but I cannot update the table.&amp;nbsp;&lt;A href="https://community.databricks.com/t5/data-engineering/the-transaction-log-has-failed-integrity-checks-we-recommend-you/td-p/26795" target="_self"&gt;Other community messages&lt;/A&gt;&lt;SPAN&gt; have noted this error in the past, but the resolution involved simply updating the following spark setting and turning off the integrity check:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;`spark.conf.set("spark.databricks.delta.state.corruptionIsFatal", False)`&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am concerned that just setting corruption to Fatal does not address the underlying problem down the line. I have found the only method to actually alleviate the issue is to copy the table to a new table and delete the original table. This maintains all of our data, but we lose the transaction history (basically resetting the transaction log to zero). I would prefer not to do this though so that we can still time travel. Does anyone have any advice on what might be causing this issue or how it can be resolved?&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2025 18:40:40 GMT</pubDate>
    <dc:creator>Dave_Nithio</dc:creator>
    <dc:date>2025-03-11T18:40:40Z</dc:date>
    <item>
      <title>Transaction Log Failed Integrity Checks</title>
      <link>https://community.databricks.com/t5/data-engineering/transaction-log-failed-integrity-checks/m-p/112307#M44171</link>
      <description>&lt;P&gt;I have started to receive the following error message - that the transaction log has failed integrity checks - when attempting to optimize and run compaction on a table. It also occurs when I attempt to alter this table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dave_Nithio_1-1741718129217.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/15345i0F598DD907FE7B40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dave_Nithio_1-1741718129217.png" alt="Dave_Nithio_1-1741718129217.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This blocks my pipeline from running. What is strange is that I can run queries against the table without issue and all data is intact, but I cannot update the table.&amp;nbsp;&lt;A href="https://community.databricks.com/t5/data-engineering/the-transaction-log-has-failed-integrity-checks-we-recommend-you/td-p/26795" target="_self"&gt;Other community messages&lt;/A&gt;&lt;SPAN&gt; have noted this error in the past, but the resolution involved simply updating the following spark setting and turning off the integrity check:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;`spark.conf.set("spark.databricks.delta.state.corruptionIsFatal", False)`&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am concerned that just setting corruption to Fatal does not address the underlying problem down the line. I have found the only method to actually alleviate the issue is to copy the table to a new table and delete the original table. This maintains all of our data, but we lose the transaction history (basically resetting the transaction log to zero). I would prefer not to do this though so that we can still time travel. Does anyone have any advice on what might be causing this issue or how it can be resolved?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 18:40:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/transaction-log-failed-integrity-checks/m-p/112307#M44171</guid>
      <dc:creator>Dave_Nithio</dc:creator>
      <dc:date>2025-03-11T18:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Log Failed Integrity Checks</title>
      <link>https://community.databricks.com/t5/data-engineering/transaction-log-failed-integrity-checks/m-p/137760#M50814</link>
      <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Your issue—encountering "the transaction log has failed integrity checks" in Databricks Delta Lake—indicates metadata corruption or an inconsistency in the Delta transaction log (_delta_log). This commonly disrupts DML operations like OPTIMIZE, DELETE, INSERT, or schema evolution, while still allowing read-only queries, as the query engine can skip over many log problems during regular reads but not when writing or updating metadata.&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;What Causes Transaction Log Integrity Checks to Fail?&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&lt;STRONG&gt;Manual interference&lt;/STRONG&gt;: Direct changes in the _delta_log directory (such as moving, renaming or deleting JSON/CRC files) outside of supported APIs.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&lt;STRONG&gt;Storage layer instability&lt;/STRONG&gt;: Issues in the underlying cloud storage (S3/ADLS/Blob), such as eventual consistency or filesystem caching.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&lt;STRONG&gt;Process interruption&lt;/STRONG&gt;: Terminated write/merge jobs that leave partial state.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&lt;STRONG&gt;Concurrent operations&lt;/STRONG&gt;: Unusual concurrency patterns or forced interruptions.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&lt;STRONG&gt;Bugs/edge cases&lt;/STRONG&gt;: Less common, but occasionally bugs in Delta Lake can leave corrupt states after job failures or crashes, especially with third-party Delta implementations.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Risks of Disabling the Integrity Check&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Switching&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;spark.databricks.delta.state.corruptionIsFatal&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;False&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;simply suppresses the error and lets the system skip the check—it does NOT fix your log or underlying corruption. While this can restore write access, you'll risk:&lt;/P&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Data loss if underlying files are missing or inconsistent&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Inability to audit or "time travel" reliably, as older table states may be gone or corrupt&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Harder troubleshooting later&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Safer Remediation Steps&lt;/H2&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;1. Pinpoint Corruption&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;DESCRIBE HISTORY &amp;lt;table&amp;gt;&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and look for out-of-order, missing, or duplicate versions.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Inspect the _delta_log directory, looking for missing, truncated, or outright corrupted JSON/CRC files.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;2. Restore or Repair Transaction Log&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If you have a backup, restoring an older (healthy) state via the Delta Lake RESTORE command or by copying _delta_log from backup can recover the timeline.&lt;/P&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Delta 2.0+ has experimental&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;FSCK&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;VACUUM&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tools, but these are still in development and not always available.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Sometimes, Databricks Support can manually repair your _delta_log if you are an enterprise customer.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;3. Export and Reload&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If all else fails, copying data out (just as you did), then recreating the table, is the only way to guarantee integrity for the future—at the cost of transaction history.&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;4. Prevent Recurrence&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Never modify files inside _delta_log directly.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Use only supported Databricks APIs for writes/merges.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Address any storage layer anomalies.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Use table access controls and monitoring.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Consult Databricks Support&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If retaining your table history is business-critical, raise a support ticket with Databricks, referencing table path, workspace ID, error message, and a description of all recent operations. They have internal tools to repair many types of log corruption you cannot fix yourself.&lt;/P&gt;
&lt;HR /&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;&lt;STRONG&gt;In summary:&lt;/STRONG&gt;&lt;BR /&gt;Do not rely on disabling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;corruptionIsFatal&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;as a permanent solution—it hides symptoms, not causes. For enterprise/critical tables, escalate to Databricks Support for possible transaction log repair. For non-critical tables, or if support cannot help, copying/reloading will restore your table’s health but reset its log. Prevent further incidents by reviewing processes and ensuring only supported APIs and reliable storage layers are involved.&lt;/P&gt;
&lt;HR /&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;References&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Community and Databricks documentation on&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="reset interactable cursor-pointer decoration-1 underline-offset-1 text-super hover:underline font-semibold" href="https://community.databricks.com/t5/data-engineering/the-transaction-log-has-failed-integrity-checks-we-recommend-you/td-p/26795" target="_blank" rel="nofollow noopener"&gt;&lt;SPAN class="text-box-trim-both"&gt;transaction log integrity&lt;/SPAN&gt;&lt;/A&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 05 Nov 2025 12:52:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/transaction-log-failed-integrity-checks/m-p/137760#M50814</guid>
      <dc:creator>mark_ott</dc:creator>
      <dc:date>2025-11-05T12:52:27Z</dc:date>
    </item>
  </channel>
</rss>

