summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-02-19 13:24:37 +0000
committerErik Johnston <erik@matrix.org>2019-02-19 13:24:37 +0000
commit0e07d2c7d5582be28771711b79d6a18317291af4 (patch)
treee2624194af13cc82a27f636180ff3549168a35c5 /docs
parentRevert "Merge pull request #4654 from matrix-org/hawkowl/registration-worker" (diff)
parentMerge pull request #4671 from matrix-org/erikj/state_cache_invalidation (diff)
downloadsynapse-0e07d2c7d5582be28771711b79d6a18317291af4.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'docs')
-rw-r--r--docs/tcp_replication.rst26
-rw-r--r--docs/workers.rst7
2 files changed, 32 insertions, 1 deletions
diff --git a/docs/tcp_replication.rst b/docs/tcp_replication.rst

index 62225ba6f4..73436cea62 100644 --- a/docs/tcp_replication.rst +++ b/docs/tcp_replication.rst
@@ -137,7 +137,6 @@ for each stream so that on reconneciton it can start streaming from the correct place. Note: not all RDATA have valid tokens due to batching. See ``RdataCommand`` for more details. - Example ~~~~~~~ @@ -221,3 +220,28 @@ SYNC (S, C) See ``synapse/replication/tcp/commands.py`` for a detailed description and the format of each command. + + +Cache Invalidation Stream +~~~~~~~~~~~~~~~~~~~~~~~~~ + +The cache invalidation stream is used to inform workers when they need to +invalidate any of their caches in the data store. This is done by streaming all +cache invalidations done on master down to the workers, assuming that any caches +on the workers also exist on the master. + +Each individual cache invalidation results in a row being sent down replication, +which includes the cache name (the name of the function) and they key to +invalidate. For example:: + + > RDATA caches 550953771 ["get_user_by_id", ["@bob:example.com"], 1550574873251] + +However, there are times when a number of caches need to be invalidated at the +same time with the same key. To reduce traffic we batch those invalidations into +a single poke by defining a special cache name that workers understand to mean +to expand to invalidate the correct caches. + +Currently the special cache names are declared in ``synapse/storage/_base.py`` +and are: + +1. ``cs_cache_fake`` ─ invalidates caches that depend on the current state diff --git a/docs/workers.rst b/docs/workers.rst
index dd3a84ba0d..3ba5879f76 100644 --- a/docs/workers.rst +++ b/docs/workers.rst
@@ -222,6 +222,13 @@ following regular expressions:: ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/context/.*$ ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/members$ ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/state$ + ^/_matrix/client/(api/v1|r0|unstable)/login$ + +Additionally, the following REST endpoints can be handled, but all requests must +be routed to the same instance:: + + ^/_matrix/client/(r0|unstable)/register$ + ``synapse.app.user_dir`` ~~~~~~~~~~~~~~~~~~~~~~~~