summary refs log tree commit diff
path: root/synapse/replication/tcp/resource.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-03-23 18:55:58 +0000
committerErik Johnston <erik@matrix.org>2020-03-23 18:55:58 +0000
commitea17e939df64370c80316313bea5e50a989476d0 (patch)
tree141250623f95879b2226684a0084fb1479ea4c07 /synapse/replication/tcp/resource.py
parentRemove `conn_id` usage for UserSyncCommand. (diff)
downloadsynapse-ea17e939df64370c80316313bea5e50a989476d0.tar.xz
Add CLEAR_USER_SYNCS command that is sent on shutdown.
This should help with the case where a synchrotron gets restarted
gracefully, rather than rely on 5 minute timeout.
Diffstat (limited to '')
-rw-r--r--synapse/replication/tcp/resource.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/replication/tcp/resource.py b/synapse/replication/tcp/resource.py
index 8d720694e9..acf8868de9 100644
--- a/synapse/replication/tcp/resource.py
+++ b/synapse/replication/tcp/resource.py
@@ -254,6 +254,11 @@ class ReplicationStreamer(object):
             instance_id, user_id, is_syncing, last_sync_ms
         )
 
+    async def on_clear_user_syncs(self, instance_id):
+        """A replication client wants us to drop all their UserSync data.
+        """
+        await self.presence_handler.update_external_syncs_clear(instance_id)
+
     @measure_func("repl.on_remove_pusher")
     async def on_remove_pusher(self, app_id, push_key, user_id):
         """A client has asked us to remove a pusher