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

Commit 477c15d

Browse files
committed
Some more debug logging
1 parent 886071b commit 477c15d

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

synapse/federation/federation_server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ async def on_backfill_request(
196196
origin, room_id, versions, limit
197197
)
198198

199+
logger.info("on_backfill_request pdus(%d)=%s", len(pdus), pdus)
200+
199201
res = self._transaction_dict_from_pdus(pdus)
200202

201203
return 200, res

synapse/handlers/federation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,12 @@ async def _maybe_backfill_inner(
250250
]
251251

252252
logger.info(
253-
"room_id: %s, backfill: current_depth: %s, limit: %s, max_depth: %s, extrems: %s filtered_sorted_extremeties_tuple: %s",
253+
"room_id: %s, backfill: current_depth: %s, limit: %s, max_depth: %s, extrems (%d): %s filtered_sorted_extremeties_tuple: %s",
254254
room_id,
255255
current_depth,
256256
limit,
257257
max_depth,
258+
len(sorted_extremeties_tuple),
258259
sorted_extremeties_tuple,
259260
filtered_sorted_extremeties_tuple,
260261
)

synapse/handlers/room_batch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ async def persist_state_events_at_start(
184184

185185
# Make the state events float off on their own so we don't have a
186186
# bunch of `@mxid joined the room` noise between each batch
187-
prev_event_id_for_state_chain = generate_fake_event_id()
187+
prev_event_ids_for_state_chain = [generate_fake_event_id()]
188188

189189
for state_event in state_events_at_start:
190190
assert_params_in_dict(
@@ -221,7 +221,7 @@ async def persist_state_events_at_start(
221221
action=membership,
222222
content=event_dict["content"],
223223
outlier=True,
224-
prev_event_ids=[prev_event_id_for_state_chain],
224+
prev_event_ids=prev_event_ids_for_state_chain,
225225
# Make sure to use a copy of this list because we modify it
226226
# later in the loop here. Otherwise it will be the same
227227
# reference and also update in the event when we append later.
@@ -240,7 +240,7 @@ async def persist_state_events_at_start(
240240
),
241241
event_dict,
242242
outlier=True,
243-
prev_event_ids=[prev_event_id_for_state_chain],
243+
prev_event_ids=prev_event_ids_for_state_chain,
244244
# Make sure to use a copy of this list because we modify it
245245
# later in the loop here. Otherwise it will be the same
246246
# reference and also update in the event when we append later.
@@ -251,7 +251,7 @@ async def persist_state_events_at_start(
251251
state_event_ids_at_start.append(event_id)
252252
auth_event_ids.append(event_id)
253253
# Connect all the state in a floating chain
254-
prev_event_id_for_state_chain = event_id
254+
prev_event_ids_for_state_chain = [event_id]
255255

256256
return state_event_ids_at_start
257257

synapse/storage/databases/main/event_federation.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,11 @@ def _get_backfill_events(self, txn, room_id, event_list, limit):
10571057
# we process the newest-in-time messages first going backwards in time.
10581058
queue = PriorityQueue()
10591059

1060+
logger.info(
1061+
"_get_backfill_events: seeding backfill with event_list(%d)=%s",
1062+
len(event_list),
1063+
event_list,
1064+
)
10601065
for event_id in event_list:
10611066
event_lookup_result = self.db_pool.simple_select_one_txn(
10621067
txn,
@@ -1070,6 +1075,14 @@ def _get_backfill_events(self, txn, room_id, event_list, limit):
10701075
allow_none=True,
10711076
)
10721077

1078+
logger.info(
1079+
"_get_backfill_events: seeding backfill with event_id=%s type=%s depth=%s stream_ordering=%s",
1080+
event_id,
1081+
event_lookup_result["type"],
1082+
event_lookup_result["depth"],
1083+
event_lookup_result["stream_ordering"],
1084+
)
1085+
10731086
if event_lookup_result["depth"]:
10741087
queue.put(
10751088
(

0 commit comments

Comments
 (0)