-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Split out DB writes in federation handler #3621
Conversation
This will allow us to easily add an internal replication API to proxy these reqeusts to master, so that we can move federation APIs to workers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some nits
synapse/storage/events.py
Outdated
which might update the current state etc. | ||
|
||
Returns: | ||
Deferred[int]: he stream ordering of the latest persisted event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
he
) | ||
|
||
defer.returnValue((event_stream_id, max_stream_id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update the docstring?
@@ -1616,12 +1551,10 @@ def _persist_auth_tree(self, origin, auth_events, state, event): | |||
event, old_state=state | |||
) | |||
|
|||
event_stream_id, max_stream_id = yield self.store.persist_event( | |||
event, new_event_context, | |||
yield self._persist_events( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm struggling to keep track of which methods do the notification and which do not. Could you update the docstring on persist_auth_tree
?
@@ -1517,7 +1452,7 @@ def _handle_new_events(self, origin, event_infos, backfilled=False): | |||
], consumeErrors=True, | |||
)) | |||
|
|||
yield self.store.persist_events( | |||
yield self._persist_events( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, can you update the docstring to say that we may notify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This will allow us to easily add an internal replication API to proxy
these reqeusts to master, so that we can move federation APIs to
workers.