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).
This commit is contained in:
Erik Johnston 2023-01-17 09:58:22 +00:00 committed by GitHub
parent 2b084c5b71
commit 316590d1ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 1 deletions

View file

@ -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