Skip to content

Allow table levels to be empty#834

Merged
mheinzel merged 1 commit intomainfrom
mheinzel/empty-levels
Apr 24, 2026
Merged

Allow table levels to be empty#834
mheinzel merged 1 commit intomainfrom
mheinzel/empty-levels

Conversation

@mheinzel
Copy link
Copy Markdown
Collaborator

@mheinzel mheinzel commented Apr 2, 2026

Builds on top of #833, therefore currently still a draft PR.

As part of the work to allow migrating completed union levels, we introduce empty levels in the table structure. They don't get created yet, but will be useful for union migration. This is a similar change to what #823 did in the prototype.

Comment thread lsm-tree/src-core/Database/LSMTree/Internal/MergeSchedule.hs
Comment thread lsm-tree/src-core/Database/LSMTree/Internal/MergeSchedule.hs
Comment thread lsm-tree/src-core/Database/LSMTree/Internal/Snapshot/Codec.hs
Comment thread lsm-tree/src-core/Database/LSMTree/Internal/Snapshot/Codec.hs
@mheinzel mheinzel force-pushed the mheinzel/empty-levels branch from 5e3b82e to 8960737 Compare April 7, 2026 12:38
Base automatically changed from mheinzel/snapshot-test-backwards-compat to main April 16, 2026 12:21
@mheinzel mheinzel force-pushed the mheinzel/empty-levels branch from 8960737 to afdebde Compare April 17, 2026 13:22
@mheinzel mheinzel marked this pull request as ready for review April 17, 2026 13:22
@mheinzel mheinzel requested a review from dcoutts as a code owner April 17, 2026 13:22
Copy link
Copy Markdown
Collaborator

@jorisdral jorisdral left a comment

Choose a reason for hiding this comment

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

LGTM!

I think we should probably mention in the changelog that we added a new snapshot version. I wonder if we should also list it as a breaking change, because the snapshot format has changed... ideas?

@mheinzel
Copy link
Copy Markdown
Collaborator Author

Good point. While the new version can still read old snapshots, we should make it clear that upgrading to the new version of lsm-tree, creating a snapshot and then going back to the previous version doesn't work. Not sure if this should be considered breaking, but I'd rather err on the side of caution.

@mheinzel mheinzel force-pushed the mheinzel/empty-levels branch from afdebde to b9a6cd0 Compare April 24, 2026 11:51
@mheinzel mheinzel force-pushed the mheinzel/empty-levels branch from b9a6cd0 to 1246b46 Compare April 24, 2026 15:14
@mheinzel mheinzel enabled auto-merge April 24, 2026 15:19
@mheinzel mheinzel added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 4a8de49 Apr 24, 2026
32 checks passed
@mheinzel mheinzel deleted the mheinzel/empty-levels branch April 24, 2026 16:16
Comment thread lsm-tree/CHANGELOG.md
Comment on lines +5 to +11
### Breaking changes

* Move to snapshot version v2 due to changes to the internal table
representation. While this change is backwards compatible (i.e. new code
is still able to read old snapshots), be aware that v2 snapshots cannot be
read by older versions of `lsm-tree`.
See [PR #834](https://github.com/IntersectMBO/lsm-tree/pull/834).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

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