Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Improve logging of replication (#16309)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Sep 13, 2023
1 parent 48387c5 commit ab13fb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/16309.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Small improvements to logging in replication code.
2 changes: 1 addition & 1 deletion synapse/replication/tcp/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ async def _process_position(
[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(
Expand Down
7 changes: 6 additions & 1 deletion synapse/replication/tcp/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ async def _run_notifier_loop(self) -> None:

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

Expand Down

0 comments on commit ab13fb0

Please sign in to comment.