clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.17k stars 102 forks source link

Implement page dirty marks. #1244

Closed Centril closed 3 weeks ago

Centril commented 4 weeks ago

Prerequisite for snapshotting.

Add a field unmodified_hash: Option<blake3::Hash> to PageHeader. Within this ticket, never set it to Some. It will likely need to be #[allow(unused)] or something until the full implementation of snapshotting reads it. Explicitly set it to None every time you write to the page.

With the full implementation of snapshotting, we will compute a hash and set the field to Some before dumping the page to a file. If the field is already Some, we will skip computing the hash.