Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

url_preview media cache is not expired when background database migrations are running #13637

@richvdh

Description

@richvdh

Normally, any media downloaded as part of a url preview is deleted after a day. However, while a background database migration is running, the process is stopped. If there is a long-running database migration, this can therefore cause the media store to fill up with old preview files.

This logic was added in #2697 to make sure that we didn't try to run the expiry without an index on local_media_repository.created_ts; the original logic that needs that index was added in #2478 (in get_url_cache_media_before, as amended by 93247a4), and is still present.

It looks like too broad a constraint: instead, we should use has_completed_background_update to check if the specific background update we care about has completed. However, given you'd have to be upgrading from before Synapse v1.0.0 (which created the v54 schema snapshot) to not have this index in place... we should probably just drop the check altogether.

Metadata

Metadata

Assignees

Labels

A-Disk-Spacethings which fill up the diskA-Media-RepositoryUploading, downloading images and video, thumbnailingO-OccasionalAffects or can be seen by some users regularly or most users rarelyS-TolerableMinor significance, cosmetic issues, low or no impact to users.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Z-Help-WantedWe know exactly how to fix this issue, and would be grateful for any contribution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions