Closed roeierez closed 4 years ago
I like this change, but do you notice a change in the size of the db when running this? bbolt
doesn't shrink when deleting things (keeps the freed pages on disk still). May be useful if/when neutrino migrates to an abstracted k/v store that supports things besides bbolt
.
The bolt db file size indeed doesn't change but with this change the app layer at least can make sure it's eviction strategy prevents the db from growing too much. As far as I know the only way to shrink the db is to run compact and this is also an option (that should be done with care) for applications that already have a big db file.
The bolt db file size indeed doesn't change but with this change the app layer at least can make sure it's eviction strategy prevents the db from growing too much. As far as I know the only way to shrink the db is to run compact and this is also an option (that should be done with care) for applications that already have a big db file.
Ah I see, I'll take a look at the code :)
This PR adds the ability to purge the filters from the db. Neutrino has the
PersistToDisk
query option which is useful for background sync in mobile applications. These apps can set a background job to fetch the filters periodically, preparing the data for the app when it starts by the user, which achieves a fast sync time and immediate readiness for payment. This change adds a way to purge these filters and enables the app to implement its own eviction strategy preventing the db from growing boundlessly.