summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@matrix.org>2023-09-13 10:51:50 +0100
committerGitHub <noreply@github.com>2023-09-13 09:51:50 +0000
commitab13fb08bf7c20a992ec2796c72d0fbb2a06545c (patch)
tree57bc91c2614914198fec579692cdd3d968f4345c
parentUpdate changelog (diff)
downloadsynapse-ab13fb08bf7c20a992ec2796c72d0fbb2a06545c.tar.xz
Improve logging of replication (#16309)
-rw-r--r--changelog.d/16309.misc1
-rw-r--r--synapse/replication/tcp/handler.py2
-rw-r--r--synapse/replication/tcp/resource.py7
3 files changed, 8 insertions, 2 deletions
diff --git a/changelog.d/16309.misc b/changelog.d/16309.misc
new file mode 100644
index 0000000000..bef5563ee9
--- /dev/null
+++ b/changelog.d/16309.misc
@@ -0,0 +1 @@
+Small improvements to logging in replication code.
diff --git a/synapse/replication/tcp/handler.py b/synapse/replication/tcp/handler.py
index d9045d7b73..5642666411 100644
--- a/synapse/replication/tcp/handler.py
+++ b/synapse/replication/tcp/handler.py
@@ -644,7 +644,7 @@ class ReplicationCommandHandler:
                     [stream.parse_row(row) for row in rows],
                 )
 
-            logger.info("Caught up with stream '%s' to %i", stream_name, cmd.new_token)
+        logger.info("Caught up with stream '%s' to %i", stream_name, cmd.new_token)
 
         # We've now caught up to position sent to us, notify handler.
         await self._replication_data_handler.on_position(
diff --git a/synapse/replication/tcp/resource.py b/synapse/replication/tcp/resource.py
index 347467d863..1d9a29d22e 100644
--- a/synapse/replication/tcp/resource.py
+++ b/synapse/replication/tcp/resource.py
@@ -191,7 +191,12 @@ class ReplicationStreamer:
 
                         if updates:
                             logger.info(
-                                "Streaming: %s -> %s", stream.NAME, updates[-1][0]
+                                "Streaming: %s -> %s (limited: %s, updates: %s, max token: %s)",
+                                stream.NAME,
+                                updates[-1][0],
+                                limited,
+                                len(updates),
+                                current_token,
                             )
                             stream_updates_counter.labels(stream.NAME).inc(len(updates))