element-hq / element-hq/synapse
Background updates should be run on the background tasks worker
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#12931](https://github.com/matrix-org/synapse/issues/12931).
---
Synapse can support a [background tasks worker](https://matrix-org.github.io/synapse/latest/workers.html#background-tasks) for running various internal tasks over replication, however background updates (database migrations) are still handled on the main process. It seems sensible, if by name alone, to also have background updates happen on the background tasks worker to alleviate load from the main process in the event of a large migration.
The most recent background updates I can think of aren't necessarily intensive, but it's quite possible that in the future Synapse will have a need to run a CPU or memory intensive background update across the database. Such an update might be similar to the recent-ish stream_ordering column type fix where billions of rows needed to be migrated.
Contributor guide
Assessment
This issue has not been assessed yet.