diff options
author | Erik Johnston <erik@matrix.org> | 2020-05-22 16:11:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-22 16:11:35 +0100 |
commit | e5c67d04dbe5ed45d659e826a5dfcd5044a4e374 (patch) | |
tree | 0ee1f865349d9fb3a6b215001f3c7ac3b7c0552b /synapse/rest/admin | |
parent | Return 200 OK for all OPTIONS requests (#7534) (diff) | |
download | synapse-e5c67d04dbe5ed45d659e826a5dfcd5044a4e374.tar.xz |
Add option to move event persistence off master (#7517)
Diffstat (limited to 'synapse/rest/admin')
-rw-r--r-- | synapse/rest/admin/rooms.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/rest/admin/rooms.py b/synapse/rest/admin/rooms.py index 0a13e1ed34..8173baef8f 100644 --- a/synapse/rest/admin/rooms.py +++ b/synapse/rest/admin/rooms.py @@ -100,7 +100,9 @@ class ShutdownRoomRestServlet(RestServlet): # we try and auto join below. # # TODO: Currently the events stream is written to from master - await self._replication.wait_for_stream_position("master", "events", stream_id) + await self._replication.wait_for_stream_position( + self.hs.config.worker.writers.events, "events", stream_id + ) users = await self.state.get_current_users_in_room(room_id) kicked_users = [] @@ -113,7 +115,7 @@ class ShutdownRoomRestServlet(RestServlet): try: target_requester = create_requester(user_id) - await self.room_member_handler.update_membership( + _, stream_id = await self.room_member_handler.update_membership( requester=target_requester, target=target_requester.user, room_id=room_id, @@ -123,6 +125,11 @@ class ShutdownRoomRestServlet(RestServlet): require_consent=False, ) + # Wait for leave to come in over replication before trying to forget. + await self._replication.wait_for_stream_position( + self.hs.config.worker.writers.events, "events", stream_id + ) + await self.room_member_handler.forget(target_requester.user, room_id) await self.room_member_handler.update_membership( |