Tweak logging for when a worker waits for its view of a replication stream to catch up. (#15120)Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

* Improve logging messages for the 'wait for repl stream' read-after-write consistency feature

* Newsfile

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>

* Update synapse/replication/tcp/client.py

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

---------

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
pull/15137/head
reivilibre 2023-02-21 12:26:00 +00:00 committed by GitHub
parent 8cede528a8
commit addd12f16d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

1
changelog.d/15120.misc Normal file
View File

@ -0,0 +1 @@
Tweak logging for when a worker waits for its view of a replication stream to catch up.

View File

@ -370,15 +370,23 @@ class ReplicationDataHandler:
# We measure here to get in flight counts and average waiting time. # We measure here to get in flight counts and average waiting time.
with Measure(self._clock, "repl.wait_for_stream_position"): with Measure(self._clock, "repl.wait_for_stream_position"):
logger.info( logger.info(
"Waiting for repl stream %r to reach %s (%s)", "Waiting for repl stream %r to reach %s (%s); currently at: %s",
stream_name, stream_name,
position, position,
instance_name, instance_name,
current_position,
) )
try: try:
await make_deferred_yieldable(deferred) await make_deferred_yieldable(deferred)
except defer.TimeoutError: except defer.TimeoutError:
logger.error("Timed out waiting for stream %s", stream_name) logger.error(
"Timed out waiting for repl stream %r to reach %s (%s)"
"; currently at: %s",
stream_name,
position,
instance_name,
self._streams[stream_name].current_token(instance_name),
)
return return
logger.info( logger.info(