summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-01-17 09:58:22 +0000
committerGitHub <noreply@github.com>2023-01-17 09:58:22 +0000
commit316590d1ea273115a9e7925236e02d577a231de4 (patch)
tree3ed7e2ce51e5af2c684f4c7f3d4699a0d4568572 /synapse
parentMerge device list replication streams (#14833) (diff)
downloadsynapse-316590d1ea273115a9e7925236e02d577a231de4.tar.xz
Fix bug in `wait_for_stream_position` (#14856)
We were incorrectly checking if the *local* token had been advanced, rather than the token for the remote instance.

In practice, I don't think this has caused any bugs due to where we use `wait_for_stream_position`, as critically we don't use it on instances that also write to the given streams (and so the local token will lag behind all remote tokens).
Diffstat (limited to 'synapse')
-rw-r--r--synapse/replication/tcp/client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py
index 31022ce5fb..322d695bc7 100644
--- a/synapse/replication/tcp/client.py
+++ b/synapse/replication/tcp/client.py
@@ -325,7 +325,7 @@ class ReplicationDataHandler:
             # anyway in that case we don't need to wait.
             return
 
-        current_position = self._streams[stream_name].current_token(self._instance_name)
+        current_position = self._streams[stream_name].current_token(instance_name)
         if position <= current_position:
             # We're already past the position
             return