Follow-up from "Chris/host key value store"
The following discussions from !4821 (merged) should be addressed:
-
@DavidVorick started a discussion: (+1 comment) don't hold the lock during a full prune, too long
-
@DavidVorick started a discussion: (+1 comment) don't iterate through the map, you'll get a bunch of random writes for your expired entries, very disk unfriendly.
Probably faster to read from disk in order and check each entry in order of the index, then all of your writes are sequential. This also has the benefit of you not needing to sit on the global lock for the whole operation, because you don't need the map to be stable.