1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
Olivier Wilkinson (reivilibre) 938a4f6188 Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2022-08-10 17:56:50 +01:00
Olivier Wilkinson (reivilibre) 794897e501 Add some logging 2022-08-10 17:56:09 +01:00
3 changed files with 21 additions and 8 deletions
+1
View File
@@ -0,0 +1 @@
Add logging for investigating problems when updating the current state in the database.
@@ -655,6 +655,8 @@ class EventsPersistenceStorageController:
with Measure(
self._clock, "persist_events.get_new_state_after_events"
):
logger.debug("old extremities: %r", latest_event_ids)
logger.debug("new extremities: %r", new_latest_event_ids)
res = await self._get_new_state_after_events(
room_id,
ev_ctx_rm,
@@ -662,6 +664,11 @@ class EventsPersistenceStorageController:
new_latest_event_ids,
)
current_state, delta_ids, new_latest_event_ids = res
logger.debug(
"delta IDs: %r, new latest event IDs: %r",
delta_ids,
new_latest_event_ids,
)
# there should always be at least one forward extremity.
# (except during the initial persistence of the send_join
+13 -8
View File
@@ -209,14 +209,19 @@ class PersistEventsStore:
for (event, _), stream in zip(events_and_contexts, stream_orderings):
event.internal_metadata.stream_ordering = stream
await self.db_pool.runInteraction(
"persist_events",
self._persist_events_txn,
events_and_contexts=events_and_contexts,
inhibit_local_membership_updates=inhibit_local_membership_updates,
state_delta_for_room=state_delta_for_room,
new_forward_extremities=new_forward_extremities,
)
try:
await self.db_pool.runInteraction(
"persist_events",
self._persist_events_txn,
events_and_contexts=events_and_contexts,
inhibit_local_membership_updates=inhibit_local_membership_updates,
state_delta_for_room=state_delta_for_room,
new_forward_extremities=new_forward_extremities,
)
except Exception:
logger.debug("events_and_contexts: %r", events_and_contexts)
logger.debug("state_delta_for_room: %r", state_delta_for_room)
raise
persist_event_counter.inc(len(events_and_contexts))
if not use_negative_stream_ordering: