Open cberner opened 5 days ago
It would be great to get rid of the old allocator state! Note that it's actually possible to do that without breaking compatibility, if you want:
First, we'd add code that makes an empty commit on shutdown with set_quick_repair(true)
(this can be skipped if the user's last commit already used that option). Then, after a transition period, we can just delete all the code that reads and writes the old allocator state. You'd still be able to open any database with any redb version, and if the database has been opened at least one during the transition period, it'll open cleanly. Otherwise it'll require repair, but it'll always work.
Effectively, we'd be deleting the "normal" database open path, leaving only quick-repair and full repair. The recovery_required
bit would be permanently set.
Oh ya, nice! I hadn't thought that through, but doing it without breaking compatibility would be nice. It'll leave some unused space in the file, but that's pretty minimal. ~256KiB for every 4GiB, or so, if I recall correctly
This issue is for tracking and discussing potential changes for a version 3 file format
1) Change persistent savepoint storage to make
restore_savepoint()
fasterAs described in the design doc savepoint restore could be faster if the freed tree was split into two: one for the system tables and one for normal tables, and then a table to track allocations needs to be added too.
2) Change allocator state to be stored in a system table
PR https://github.com/cberner/redb/pull/893 demonstrates how the allocator state can be moved into a system table instead of a special part of the file format. Assuming it's merged, it would be better to unify all allocator state storage to use the system table approach, instead of having two code paths