aplbrain / bossphorus

A BossDB-like volumetric datastore in Rust
Apache License 2.0
1 stars 1 forks source link

Implement a cache cleanup and cache-maintenance strategy #6

Open j6k4m8 opened 4 years ago

j6k4m8 commented 4 years ago

Right now, if you create the following DataManager stack;

ChunkedBloscFileDataManager → BossDBRelayDataManager

...then as cache-misses in the ChunkedBloscFileDataManager are fulfilled by the BossDBRelayDataManager, they're saved to disk and returned to the client.

There currently exists no mechanism by which to clear the files from ChunkedBloscFileDataManager, which means that the cache will grow to infinity (or until your drive is full, whichever is sooner).

There should be a cache cleanup strategy, but I believe it makes sense for there to be several strategies which a user can choose between. Perhaps options like:

Even if we just implement one of these to start with, might be smart to leave space and an abstraction layer to allow for multiple in the future.