From 5c3b7e2f98c7d1d0269760929988375920d1d08c Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Mon, 20 Feb 2023 16:57:25 +0000 Subject: [PATCH 1/3] Improve logging messages for the 'wait for repl stream' read-after-write consistency feature --- synapse/replication/tcp/client.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py index cc0528bd8e5f..facfbc998e8b 100644 --- a/synapse/replication/tcp/client.py +++ b/synapse/replication/tcp/client.py @@ -370,15 +370,23 @@ async def wait_for_stream_position( # We measure here to get in flight counts and average waiting time. with Measure(self._clock, "repl.wait_for_stream_position"): 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, position, instance_name, + current_position, ) try: await make_deferred_yieldable(deferred) 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 logger.info( From 5043ad348946ae61cf2dc48119370ac607605433 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Tue, 21 Feb 2023 11:00:52 +0000 Subject: [PATCH 2/3] Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) --- changelog.d/15120.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/15120.misc diff --git a/changelog.d/15120.misc b/changelog.d/15120.misc new file mode 100644 index 000000000000..ebbc0c90276d --- /dev/null +++ b/changelog.d/15120.misc @@ -0,0 +1 @@ +Tweak logging for when a worker waits for its view of a replication stream to catch up. \ No newline at end of file From fde9db974219a8a7e6753e16f10ff7056b977032 Mon Sep 17 00:00:00 2001 From: reivilibre Date: Tue, 21 Feb 2023 11:06:00 +0000 Subject: [PATCH 3/3] Update synapse/replication/tcp/client.py Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> --- synapse/replication/tcp/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py index facfbc998e8b..424854efbe52 100644 --- a/synapse/replication/tcp/client.py +++ b/synapse/replication/tcp/client.py @@ -370,7 +370,7 @@ async def wait_for_stream_position( # We measure here to get in flight counts and average waiting time. with Measure(self._clock, "repl.wait_for_stream_position"): logger.info( - "Waiting for repl stream %r to reach %s (%s)" "; currently at: %s", + "Waiting for repl stream %r to reach %s (%s); currently at: %s", stream_name, position, instance_name,