wiredtiger/wiredtiger.github.com — Issue #145: Checkpoints / snapshots
Author: wiredtiger
Created: 2012-01-31 19:11:52+00:00
State: open

1. Need to get all the pages out (including writing the root).
2. Need to keep track of multiple root pages:
- put them in the schema file
- maybe move the root address into the schema file all the time?
3. Need a way for applications to address snapshots ala "zfs create object@snapshot"
4. Need table-level and/or database-level snapshots
- creates a snapshot
-by default (and for now), it snapshots the whole database (all files)

A snapshot entry in the schema table has at least the following fields:

- a root page (default zero)
- an obsolete page list (default empty)
- a "really" free list
- the total file size, so we can truncate to that point if rolling back to a snapshot

Freeing pages with snapshots:

- the freelist and write it each snapshot (clearing the in-memory freelist). To free snapshot N, free the pages in snapshot N + 1's freelist.
- this keeps intermediate versions of pages around, if that becomes a problem, we could also maintain the "alloc list" for a snapshot and do an intersection.

Freeing a snapshot:

- may leak pages if there is a crash soon afterwards?
- we have a "really free list", referenced from the snapshot entry in the schema table. Then if we crash soon after dropping a snapshot, we don't leak as many pages.