<?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: Unable to reconstruct state at version ? as the transaction log has been truncated in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/unable-to-reconstruct-state-at-version-as-the-transaction-log/m-p/57193#M6347</link>
    <description>&lt;P&gt;It is difficult to say exactly what caused the issue as there are multiple underlying reasons. But as a general advice, you can try setting the "delta.checkpointRetentionDuration=7 days" and also you can try switching to a different DBR version to see if that address the issue.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jan 2024 19:25:16 GMT</pubDate>
    <dc:creator>Lakshay</dc:creator>
    <dc:date>2024-01-12T19:25:16Z</dc:date>
    <item>
      <title>Unable to reconstruct state at version ? as the transaction log has been truncated</title>
      <link>https://community.databricks.com/t5/get-started-discussions/unable-to-reconstruct-state-at-version-as-the-transaction-log/m-p/57137#M6346</link>
      <description>&lt;P&gt;We have a small table, which undergoes a merge operation on a daily basis. This causes that currently the table has 83 versions.&lt;/P&gt;&lt;P&gt;When trying to query this table, we receive the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DeltaFileNotFoundException: dbfs:/mnt/XXXXX/warehouse/XXXXXXXXX.db/XXXXXXXXX /_delta_log/00000000000000000000.json: Unable to reconstruct state at version 83 as the transaction log has been truncated due to manual deletion or the log retention policy (delta.logRetentionDuration=30 days) and checkpoint retention policy (delta.checkpointRetentionDuration=2 days)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When reviewing the DBFS using %fs command, we found out that effectively the json and crc files for the 0 and 1 version, were missing. All the other files corresponding to version 2 to 83 were inside the _delta_log folder. However, since the files:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;00000000000000000000.crc
00000000000000000000.json
00000000000000000001.crc
00000000000000000001.json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;… were missing, Databricks was unable to query the table.&lt;/P&gt;&lt;P&gt;How is it possible that this log files are deleted automatically?&lt;/P&gt;&lt;P&gt;Is it related with the following fragment (Reference: &lt;A href="https://github.com/delta-io/delta/blob/master/PROTOCOL.md)?" target="_blank" rel="noopener"&gt;https://github.com/delta-io/delta/blob/master/PROTOCOL.md)?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rgualans_0-1705078443409.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/5808i8C1BCED61632A18B/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="rgualans_0-1705078443409.png" alt="rgualans_0-1705078443409.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So far, the only solution for this kind of problem has been to reconstruct the table. However, this problem emerges occasionally but affecting different tables every time.&lt;/P&gt;&lt;P&gt;How can I prevent this error to keep happening in the future?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 17:09:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/unable-to-reconstruct-state-at-version-as-the-transaction-log/m-p/57137#M6346</guid>
      <dc:creator>rgualans</dc:creator>
      <dc:date>2024-01-12T17:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to reconstruct state at version ? as the transaction log has been truncated</title>
      <link>https://community.databricks.com/t5/get-started-discussions/unable-to-reconstruct-state-at-version-as-the-transaction-log/m-p/57193#M6347</link>
      <description>&lt;P&gt;It is difficult to say exactly what caused the issue as there are multiple underlying reasons. But as a general advice, you can try setting the "delta.checkpointRetentionDuration=7 days" and also you can try switching to a different DBR version to see if that address the issue.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 19:25:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/unable-to-reconstruct-state-at-version-as-the-transaction-log/m-p/57193#M6347</guid>
      <dc:creator>Lakshay</dc:creator>
      <dc:date>2024-01-12T19:25:16Z</dc:date>
    </item>
  </channel>
</rss>

