Sled: move persisted config into the pagecache itself

Created on 12 Jun 2019  路  5Comments  路  Source: spacejam/sled

this will allow us to get rid of the config external file

help wanted newbie

All 5 comments

I've added a "PersistedConfig" type that is currently being added into the pagecache as a special page. This should be made to hold a few things that are currently being checked for in the written config file in crates/pagecache/src/config.rs in the verify_config_changes_ok function, specifically only io_buf_size and use_compression. However, we should also add the pagecache version to this, which will help to facilitate automated (not automatic, this will be manual but a 1-liner) upgrading

While you're at it, maybe you can drop the dependency on Serde at the same time. Serde is rather bulky, and obviously designed to parse text files of dubious correctness that need more code for handling edge-cases and formatting pretty error messages than for actually parsing the correct data.

@portstrom do you mean just cutting everything related to the serde off the ground? or replace it with something different

@sitano I would suggest making a very simple format similar to Bincode, but implementing the deserializer and serializer manually instead of having dependencies, as it's such a small feature.

Closing this due to the fact that when the config gets moved into the pagecache, it becomes a chicken-and-egg problem to actually detect which version it is. by keeping it in a separate file, it ensures we're able to properly do version detection going forwards.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

portstrom picture portstrom  路  6Comments

brechtcs picture brechtcs  路  4Comments

spacejam picture spacejam  路  6Comments

Lucretiel picture Lucretiel  路  3Comments

spacejam picture spacejam  路  7Comments