surrealdb / surrealkv

A low-level, versioned, embedded, ACID-compliant, key-value database for Rust
https://surrealdb.com
Apache License 2.0
306 stars 19 forks source link

Chore: remove max key value size from opts #93

Closed arriqaaq closed 1 month ago

arriqaaq commented 1 month ago

Description

This PR does the following:

1) Removes max key/value size from options. 2) Adds more robust checks for corruption failure 3) Make manifest private

During the early stages, the checksum of a record was calculated based on the key and value only. The key length, value length etc were not taken into accord, because of which it became important to remember what the max key/value size was. Now that the key/value lengths are embedded into the checksum, we can just check the crc mismatch to verify if a record is corrupted without depending on the previous checks of key/value lengths.