Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
bc8fa150
Commit
bc8fa150
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Documentation
parent
92e6fb5c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/tcp_replication.rst
+20
-1
20 additions, 1 deletion
docs/tcp_replication.rst
synapse/storage/_base.py
+4
-4
4 additions, 4 deletions
synapse/storage/_base.py
with
24 additions
and
5 deletions
docs/tcp_replication.rst
+
20
−
1
View file @
bc8fa150
...
@@ -137,7 +137,6 @@ for each stream so that on reconneciton it can start streaming from the correct
...
@@ -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
place. Note: not all RDATA have valid tokens due to batching. See
``RdataCommand`` for more details.
``RdataCommand`` for more details.
Example
Example
~~~~~~~
~~~~~~~
...
@@ -221,3 +220,23 @@ SYNC (S, C)
...
@@ -221,3 +220,23 @@ SYNC (S, C)
See ``synapse/replication/tcp/commands.py`` for a detailed description and the
See ``synapse/replication/tcp/commands.py`` for a detailed description and the
format of each command.
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.
This diff is collapsed.
Click to expand it.
synapse/storage/_base.py
+
4
−
4
View file @
bc8fa150
...
@@ -1199,8 +1199,8 @@ class SQLBaseStore(object):
...
@@ -1199,8 +1199,8 @@ class SQLBaseStore(object):
Args:
Args:
txn
txn
room_id (str): Room were state changed
room_id (str): Room w
h
ere state changed
members_changed (
set
[str]): The user_ids of members that have changed
members_changed (
Iterable
[str]): The user_ids of members that have changed
"""
"""
txn
.
call_after
(
self
.
_invalidate_state_caches
,
room_id
,
members_changed
)
txn
.
call_after
(
self
.
_invalidate_state_caches
,
room_id
,
members_changed
)
...
@@ -1215,7 +1215,7 @@ class SQLBaseStore(object):
...
@@ -1215,7 +1215,7 @@ class SQLBaseStore(object):
not stream invalidations down replication.
not stream invalidations down replication.
Args:
Args:
room_id (str): Room were state changed
room_id (str): Room w
h
ere state changed
members_changed (set[str]): The user_ids of members that have changed
members_changed (set[str]): The user_ids of members that have changed
"""
"""
for
member
in
members_changed
:
for
member
in
members_changed
:
...
@@ -1237,7 +1237,7 @@ class SQLBaseStore(object):
...
@@ -1237,7 +1237,7 @@ class SQLBaseStore(object):
Args:
Args:
txn
txn
cache_name (str)
cache_name (str)
keys (
list
[str])
keys (
iterable
[str])
"""
"""
if
isinstance
(
self
.
database_engine
,
PostgresEngine
):
if
isinstance
(
self
.
database_engine
,
PostgresEngine
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment