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

Merged
merged 6 commits into from
Jan 7, 2025

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.

doc/design/garbage-collection-uploads-asset-blobs-2.md Outdated Show resolved Hide resolved
doc/design/garbage-collection-uploads-asset-blobs-2.md Outdated Show resolved Hide resolved
doc/design/garbage-collection-uploads-asset-blobs-2.md Outdated Show resolved Hide resolved
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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. I also updated the implementation PR (#2087) accordingly.

@mvandenburgh mvandenburgh requested a review from waxlamp January 6, 2025 15:34
@mvandenburgh mvandenburgh merged commit e2c1e86 into master Jan 7, 2025
11 checks passed
@mvandenburgh mvandenburgh deleted the asset-blob-upload-gc-doc branch January 7, 2025 18:33
@dandibot
Copy link
Member

dandibot commented Jan 8, 2025

🚀 PR was released in v0.4.6 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants