ThreeSixtyGiving / datastore

A Data Store application for 360Giving
GNU Affero General Public License v3.0
0 stars 1 forks source link

Smart GetterRun Retention #168

Closed R2ZER0 closed 10 months ago

R2ZER0 commented 10 months ago

We'd like to save storage space and extend data retention time by intelligently retaining old GetterRun datasets if they are still in use.

This PR:

I've added the --older-than-days flag because I figured just deleting the single oldest GetterRun could cause us to store a lot of unnecessary data, because if the oldest one is in use, it'll not delete it. Then if the oldest is say, a year old, the existing behaviour with --oldest will never delete anything newer than that either, even if e.g. 99% of runs are unused.

So I guess, say we want to retain the last 7 days fully, plus anything older still in use, we could replace the existing --oldest with --older-than-days 7

Questions:

Related to ODSC support ticket 44487.

Further note:

After discussion we've decided to not retain any not-in-use data, and retain in-use data for 90 days. This PR also adds --all-not-in-use flag and updates the command as run to implement this policy.