Skip to content

fix: allow reading v1.16 snapshots#861

Merged
marco6 merged 13 commits intomainfrom
allow-non-empty-wal
Jan 22, 2026
Merged

fix: allow reading v1.16 snapshots#861
marco6 merged 13 commits intomainfrom
allow-non-empty-wal

Conversation

@marco6
Copy link
Collaborator

@marco6 marco6 commented Nov 6, 2025

This PR re instantiates the ability to read snapshots with a non-empty WAL in case of an upgrade from v1.16 to v1.17 and then to v1.18 in which there wasn't time to write a new snapshot, hence the on-disk file still has a non empty wal.

@marco6 marco6 requested a review from Copilot November 6, 2025 14:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restores backward compatibility to read snapshots created in v1.16 that contain non-empty WAL (Write-Ahead Log) data. This addresses an edge case where upgrades from v1.16 → v1.17 → v1.18 occurred without time to write a new snapshot, leaving on-disk files with WAL data that v1.17+ cannot currently read.

Key Changes:

  • Removes the assertion that WAL size must be zero when decoding snapshots
  • Adds logic to process WAL frames from v1.16 snapshots by applying them to the main database pages
  • Includes code formatting improvements (brace placement, line wrapping)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marco6 marco6 force-pushed the allow-non-empty-wal branch 2 times, most recently from 4540895 to 3f96621 Compare January 21, 2026 11:15
@marco6 marco6 force-pushed the allow-non-empty-wal branch from 3f96621 to defcfc3 Compare January 21, 2026 12:49
@marco6
Copy link
Collaborator Author

marco6 commented Jan 21, 2026

We are finally testing this PR. Moreover, testing found a bug and I added a check after it.

@marco6 marco6 marked this pull request as ready for review January 21, 2026 13:32
@marco6 marco6 requested review from Copilot and letFunny January 21, 2026 13:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@letFunny letFunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this Marco, it looks impeccable! My comments are only about minor things which is always a good sign.

@marco6 marco6 merged commit 8c80374 into main Jan 22, 2026
54 of 56 checks passed
@marco6 marco6 deleted the allow-non-empty-wal branch January 26, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments