diff --git a/changelog.d/18854.misc b/changelog.d/18854.misc new file mode 100644 index 000000000..9c1211a48 --- /dev/null +++ b/changelog.d/18854.misc @@ -0,0 +1 @@ +Trace how much work is being done while "recursively fetching redactions". diff --git a/synapse/storage/databases/main/events_worker.py b/synapse/storage/databases/main/events_worker.py index 321773d8a..cc031d899 100644 --- a/synapse/storage/databases/main/events_worker.py +++ b/synapse/storage/databases/main/events_worker.py @@ -1338,6 +1338,7 @@ class EventsWorkerStore(SQLBaseStore): fetched_event_ids: Set[str] = set() fetched_events: Dict[str, _EventRow] = {} + @trace async def _fetch_event_ids_and_get_outstanding_redactions( event_ids_to_fetch: Collection[str], ) -> Collection[str]: @@ -1345,6 +1346,10 @@ class EventsWorkerStore(SQLBaseStore): Fetch all of the given event_ids and return any associated redaction event_ids that we still need to fetch in the next iteration. """ + set_tag( + SynapseTags.FUNC_ARG_PREFIX + "event_ids_to_fetch.length", + str(len(event_ids_to_fetch)), + ) row_map = await self._enqueue_events(event_ids_to_fetch) # we need to recursively fetch any redactions of those events