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

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into feature/sso_modu…
Browse files Browse the repository at this point in the history
…le_callback
  • Loading branch information
yasinishyn committed Oct 15, 2023
2 parents 0979dfd + 1098822 commit 65bef6e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.d/16477.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a typo in the sql for [useful SQL for admins document](https://matrix-org.github.io/synapse/latest/usage/administration/useful_sql_for_admins.html).
1 change: 1 addition & 0 deletions changelog.d/16488.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clean up logging on event persister endpoints.
2 changes: 1 addition & 1 deletion docs/usage/administration/useful_sql_for_admins.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ SELECT rss.room_id, rss.name, rss.canonical_alias, rss.topic, rss.encryption,
rsc.joined_members, rsc.local_users_in_room, rss.join_rules
FROM room_stats_state rss
LEFT JOIN room_stats_current rsc USING (room_id)
WHERE room_id IN ( WHERE room_id IN (
WHERE room_id IN (
'!OGEhHVWSdvArJzumhm:matrix.org',
'!YTvKGNlinIzlkMTVRl:matrix.org'
);
Expand Down
6 changes: 5 additions & 1 deletion synapse/replication/http/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ async def _handle_request(self, request: Request, content: JsonDict) -> Tuple[in

event_and_contexts.append((event, context))

logger.info("Got %d events from federation", len(event_and_contexts))
logger.info(
"Got batch of %i events to persist to room %s",
len(event_and_contexts),
room_id,
)

max_stream_id = await self.federation_event_handler.persist_events_and_notify(
room_id, event_and_contexts, backfilled
Expand Down
13 changes: 8 additions & 5 deletions synapse/replication/http/send_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ async def _handle_request( # type: ignore[override]
with Measure(self.clock, "repl_send_events_parse"):
events_and_context = []
events = payload["events"]
rooms = set()

for event_payload in events:
event_dict = event_payload["event"]
Expand All @@ -144,11 +145,13 @@ async def _handle_request( # type: ignore[override]
UserID.from_string(u) for u in event_payload["extra_users"]
]

logger.info(
"Got batch of events to send, last ID of batch is: %s, sending into room: %s",
event.event_id,
event.room_id,
)
# all the rooms *should* be the same, but we'll log separately to be
# sure.
rooms.add(event.room_id)

logger.info(
"Got batch of %i events to persist to rooms %s", len(events), rooms
)

last_event = (
await self.event_creation_handler.persist_and_notify_client_events(
Expand Down

0 comments on commit 65bef6e

Please sign in to comment.