Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for delayed deletion of files from backing store #538

Open
ericmerrill opened this issue Feb 6, 2023 · 3 comments
Open

Option for delayed deletion of files from backing store #538

ericmerrill opened this issue Feb 6, 2023 · 3 comments

Comments

@ericmerrill
Copy link

We are looking at creating an option between delete immediately and delete never - more specifically, we are planning on implementing a 'Delete after X duration' feature.

The idea being, much like the 'never delete' option, that you use the bucket if you restore from a DB backup of a certain age. But we only keep snapshots a certain amount of time, and I'm never a fan of 'never clean up' setups. So we want a retirement strategy for those files, once the related DB snapshots are gone.

There are limitations of this. Namely, just like delete immediately, it is not compatible with multiple sites using the same backing store, and we will need to implement a table that tracks files that have been deleted from mdl_files, but are waiting to be deleted from the backing store. We will then have a cron task that uses that table to go and delete the actual files.
We will also need to check that table when adding a new file to the store, but if a hit is found, it means we won't need to re-upload it - just remove it from the to-be-deleted table.

We already have some developers looking at this, and out plan is to open a PR, but I wanted to open this discussion now, incase there are some glaring problems with this plan that either I'm missing, or would prevent it from being integrated into the community plugin.

@brendanheywood
Copy link
Contributor

thanks @ericmerrill

Namely, just like delete immediately, it is not compatible with multiple sites using the same backing store, and we will need to implement a table that tracks files that have been deleted from mdl_files, but are waiting to be deleted from the backing store.

This is already done, this is in tool_objectfs_objects with a location state of OBJECT_LOCATION_ORPHANED

Almost all of the logic here should already be in place, the only difference is adding logic around whether it is done right now or done after X days. So I'd expect the patch here to be quite minimal

@dvdcastro
Copy link

Hello,

We have implemented this in #549

Let us know how we can help to move this forward.

@brendanheywood
Copy link
Contributor

Well this one has slipped through the cracks for just over a year, we will be looking at this shortly

thanks @dvdcastro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants