-
Notifications
You must be signed in to change notification settings - Fork 6
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
Garbage collect manifest files #192
Comments
@yarikoptic what should the garbage collection policy be for manifest files? We can make it so old versions (i.e. versions that have a delete marker on them) are deleted after they reach a certain age, or we can make it so that only the |
I do not see any need for some policy difference from blobs lifecycle, so why not the same
? |
Sorry, I think I misunderstood as mixed up cleanup of objects with |
@waxlamp and I looked into this yesterday, and there are actually two things going on here. In normal operations, manifest files are never deleted - they are simply replaced by newer versions when metadata changes. So the expectation would be that each manifest file has just a single object, with potentially multiple older "versions". In other words, something like this (dandiset 217): But, like you pointed out in #190 (comment), there are some manifest files that also have delete markers in their history, like dandiset 4 This was surprising, since we don't currently do any deletion of manifest files in the dandi-archive application. However, we observed that the manifest files that contained delete markers seemed to be from older dandisets (created in 2021), and the delete markers were all from around September 2021. We looked into the git history, and there was a PR around that time that introduced a script to delete things from the bucket (dandi/dandi-archive#528). Furthermore, it looks like that script has a bug that causes delete markers to get left behind. It seems likely that this is the cause of these strange delete markers. So, cleaning those up can just be a manual step that we take asynchronously. I'll file another issue to discuss that in. For this particular issue, we are just concerned with garbage collecting older versions of manifest files.
This would result in the number of "noncurrent versions" being capped at one. In other words, at any point in time, each manifest file would have two versions - the "current" one that is visible in the bucket, and the latest "noncurrent" one. When a new manifest file is generated, the "current" one would become the "noncurrent" one, and the "noncurrent" one would be deleted by the lifecycle rule. If we wanted to keep things even cleaner, we could also enable the @yarikoptic at a high level, we have three options:
|
This would be my recommendation. |
Thank you for the analysis @waxlamp and @mvandenburgh . Greedy me would prefer 1) just in case ;) size effect is minimal and having at least 1 version back might come handy. 1 day is too arbitrary -- we might want to troubleshoot past that duration |
Ok, then it seems like we can just keep N non-current versions, and not worry about deleting things that are older than some arbitrary age. The remaining question: what value of N do you like, @yarikoptic? |
I am ok with any non-0. Let's say 1? ;-) hence we keep "current" and immediate "undo" |
See #192 for rationale behind one day rule.
Following up on #190 (comment).
Currently, the trailing delete mechanism for blobs is intended to work like this:
In the case of manifest files, we can exclusively use a lifecycle policy to accomplish garbage collection, and avoid adding anything to the dandi-archive application logic. See https://docs.aws.amazon.com/AmazonS3/latest/API/API_NoncurrentVersionExpiration.html.
The text was updated successfully, but these errors were encountered: