<?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 Re: DeltaFileNotFoundException: [DELTA_TRUNCATED_TRANSACTION_LOG] Error in Streaming Table in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/117312#M45480</link>
    <description>&lt;P&gt;Checking.&lt;/P&gt;</description>
    <pubDate>Thu, 01 May 2025 07:00:44 GMT</pubDate>
    <dc:creator>NandiniN</dc:creator>
    <dc:date>2025-05-01T07:00:44Z</dc:date>
    <item>
      <title>DeltaFileNotFoundException: [DELTA_TRUNCATED_TRANSACTION_LOG] Error in Streaming Table</title>
      <link>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/109927#M43434</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am encountering a recurring issue while working with Delta streaming tables in my system. The error message is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="minhhung0507_0-1739330700784.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14837iE4F642C068289A09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="minhhung0507_0-1739330700784.png" alt="minhhung0507_0-1739330700784.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;com.databricks.sql.transaction.tahoe.DeltaFileNotFoundException: [DELTA_TRUNCATED_TRANSACTION_LOG] gs://cimb-prod-lakehouse/bronze-layer/icoredb/dpb_revi_loan/&lt;SPAN class=""&gt;_delta&lt;/SPAN&gt;_log/&lt;SPAN class=""&gt;00000000000000000000.&lt;/SPAN&gt;json: Unable &lt;SPAN class=""&gt;to&lt;/SPAN&gt; reconstruct state &lt;SPAN class=""&gt;at&lt;/SPAN&gt; &lt;SPAN class=""&gt;version&lt;/SPAN&gt; &lt;SPAN class=""&gt;899&lt;/SPAN&gt; &lt;SPAN class=""&gt;as&lt;/SPAN&gt; &lt;SPAN class=""&gt;the&lt;/SPAN&gt; transaction &lt;SPAN class=""&gt;log&lt;/SPAN&gt; has been truncated due &lt;SPAN class=""&gt;to&lt;/SPAN&gt; manual deletion &lt;SPAN class=""&gt;or&lt;/SPAN&gt; &lt;SPAN class=""&gt;the&lt;/SPAN&gt; &lt;SPAN class=""&gt;log&lt;/SPAN&gt; retention policy (delta.logRetentionDuration=&lt;SPAN class=""&gt;3&lt;/SPAN&gt; days) &lt;SPAN class=""&gt;and&lt;/SPAN&gt; checkpoint retention policy (delta.checkpointRetentionDuration=&lt;SPAN class=""&gt;2&lt;/SPAN&gt; days)&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;Context:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;I am designing a system that uses Delta format for streaming tables.&lt;/LI&gt;&lt;LI&gt;The affected tables have very few transactions or updates, which seems to make them prone to this error.&lt;/LI&gt;&lt;LI&gt;Upon inspecting the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;_delta_log&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;directory, I noticed that only checkpoint versions 900 and 979 exist. However, the error indicates that it is trying to read from version 899&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="minhhung0507_1-1739330749656.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14838i73D3BF35145B4F6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="minhhung0507_1-1739330749656.png" alt="minhhung0507_1-1739330749656.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;H3&gt;Questions:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;Why is Databricks attempting to access version 899 when the checkpoint files available start from version 900? Could this be a bug or misconfiguration in Delta Lake's automatic cleanup process?&lt;/LI&gt;&lt;LI&gt;Is it possible that Delta Lake's log and checkpoint retention policies are prematurely removing active checkpoints for tables with minimal updates? If so, how can I adjust these settings to prevent this issue?&lt;/LI&gt;&lt;LI&gt;What are the recommended best practices for managing retention policies (delta.logRetentionDuration&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;delta.checkpointRetentionDuration) for Delta tables with infrequent updates?&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;Additional Information:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;Retention settings:&lt;UL&gt;&lt;LI&gt;delta.logRetentionDuration = "3 days"&lt;/LI&gt;&lt;LI&gt;delta.checkpointRetentionDuration = "2 days"&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;And even after reconfiguring the value of "logRetentionDuration" = "checkpointRetentionDuration" = 3 days or 7 days, the above error still occurs.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 03:27:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/109927#M43434</guid>
      <dc:creator>minhhung0507</dc:creator>
      <dc:date>2025-02-12T03:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: DeltaFileNotFoundException: [DELTA_TRUNCATED_TRANSACTION_LOG] Error in Streaming Table</title>
      <link>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/110069#M43478</link>
      <description>&lt;P&gt;Hi, does anyone have a solution to this problem?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 03:04:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/110069#M43478</guid>
      <dc:creator>minhhung0507</dc:creator>
      <dc:date>2025-02-13T03:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: DeltaFileNotFoundException: [DELTA_TRUNCATED_TRANSACTION_LOG] Error in Streaming Table</title>
      <link>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/117312#M45480</link>
      <description>&lt;P&gt;Checking.&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2025 07:00:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/117312#M45480</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2025-05-01T07:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: DeltaFileNotFoundException: [DELTA_TRUNCATED_TRANSACTION_LOG] Error in Streaming Table</title>
      <link>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/117369#M45487</link>
      <description>&lt;P&gt;The issue you're encountering with the error &lt;CODE&gt;DeltaFileNotFoundException: [DELTA_TRUNCATED_TRANSACTION_LOG]&lt;/CODE&gt; is related to Delta Lake's retention policy for logs and checkpoints, which manages the lifecycle of transaction log files and checkpoint files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;This error occurs because Delta Lake is trying to reconstruct the table's state from version 899, but the transaction log files for this version have already been removed as part of the log retention policy. This usually happens if there is no checkpoint file available for the requested version or for versions immediately preceding it.&lt;/P&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;Delta tables rely on periodic checkpoints to prevent the need for full log replay. If older checkpoint files or their corresponding JSON files have been removed due to the retention policies, operations that require time traveling or version-specific processing might fail.&lt;/P&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;The default settings for Delta Lake retain:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Transaction log entries for 30 days (&lt;CODE&gt;delta.logRetentionDuration&lt;/CODE&gt;)&lt;/LI&gt;
&lt;LI&gt;Checkpoint files for 2 days (&lt;CODE&gt;delta.checkpointRetentionDuration&lt;/CODE&gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;If the requested version exceeds the retention period, the files may no longer exist, which results in a &lt;/SPAN&gt;&lt;SPAN&gt;DeltaFileNotFoundException&lt;/SPAN&gt;&lt;SPAN&gt; error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you have&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/manage-versioning-examples.html" target="_blank"&gt;S3 Versioning enabled&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;on AWS,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/storage/blobs/soft-delete-container-overview" target="_blank"&gt;Soft Delete enabled&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;on Azure,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://cloud.google.com/storage/docs/use-soft-delete" target="_blank"&gt;Soft Delete enabled&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;on GCP, or a similar backup mechanism that periodically saves a copy of the files, you should be able to recover your files.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You could also increase&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;delta.logRetentionDuration&lt;/SPAN&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;SPAN&gt;delta.checkpointRetentionDuration&lt;/SPAN&gt;&lt;/STRONG&gt; for the source Delta table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This KB will be helpful&amp;nbsp;&lt;A href="https://kb.databricks.com/delta/deltafilenotfoundexception-when-reading-a-table/" target="_blank"&gt;https://kb.databricks.com/delta/deltafilenotfoundexception-when-reading-a-table/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2025 12:21:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/deltafilenotfoundexception-delta-truncated-transaction-log-error/m-p/117369#M45487</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2025-05-01T12:21:13Z</dc:date>
    </item>
  </channel>
</rss>

