synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Sliding Sync: Speed up background updates to populate Sliding Sync tables

Open MadLittleMods opened this issue 1 year ago • 0 comments

Speed up background updates to populate Sliding Sync tables

Follow-up to https://github.com/element-hq/synapse/pull/17512

  • Read from the room_stats_state table for room_type, name, and is_encrypted
  • For joins, if the state hasn't changed since the last snapshot, use the last membership snapshot we inserted
  • concurrently_execute processing and inserting
  • Use batch/bulk SQL queries like simple_upsert_many_txn where we can

Dev notes

The quick and dirty script that Erik wrote to run on matrix.org, https://github.com/erikjohnston/synapse-fast-bg-update/blob/main/src/main.rs

Pull Request Checklist

  • [x] Pull request is based on the develop branch
  • [x] Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • [x] Code style is correct (run the linters)

MadLittleMods avatar Sep 06 '24 07:09 MadLittleMods