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

Design doc for Upload/AssetBlob garbage collection #2068

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mvandenburgh
Copy link
Member

This design document proposes a design for garbage collection of Upload and AssetBlob records. A prerequisite to enabling this was the "trailing delete" feature that has landed in production (see doc)

A design document for garbage collection of Asset records will follow this one.

@yarikoptic @satra PTAL and comment here if you have any objections or general thoughts about the proposed process.

@mvandenburgh mvandenburgh force-pushed the asset-blob-upload-gc-doc branch 2 times, most recently from 98572f7 to bd9740f Compare November 5, 2024 16:09
Copy link
Member

@kabilar kabilar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @mvandenburgh. I am new to this garbage collection effort, but this design doc looks good from a high-level perspective.

@kabilar
Copy link
Member

kabilar commented Nov 18, 2024

Hi @yarikoptic, when you have a chance, can you please review this design doc? Thank you.

Copy link
Member

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall design sounds straightforward sensible and would be great to see it implemented (as promised in the opening about the branch?).

Left only a few points and minor formatting tune ups.

Comment on lines +32 to +43
### Garbage collection event table

```python
from django.db import models

class GarbageCollectionEvent(models.Model):
type = models.CharField(max_length=255)
created = models.DateTimeField(auto_now_add=True)
records = models.JSONField()
```

Note: the `records` field is a JSON serialization of the garbage-collected QuerySet, generated using [Django’s JSON model serializer](https://docs.djangoproject.com/en/5.1/topics/serialization/#serialization-formats-json)). This gives us the minimum information needed to restore a blob. The idea is that this can be reused for garbage collection of `Assets` as well.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update this section to reflect the many-to-one design we discussed recently?

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

Successfully merging this pull request may close these issues.

5 participants