Change to not require a state_groups.room_id index.

This does mean that we won't clean up orphaned state groups (i.e. state
groups that were persisted but the associated event wasn't).
This commit is contained in:
Erik Johnston 2019-11-04 13:36:57 +00:00
parent 6a0092d371
commit 7134ca7daa
4 changed files with 45 additions and 53 deletions

View file

@ -1023,7 +1023,6 @@ class StateBackgroundUpdateStore(
STATE_GROUP_INDEX_UPDATE_NAME = "state_group_state_type_index"
CURRENT_STATE_INDEX_UPDATE_NAME = "current_state_members_idx"
EVENT_STATE_GROUP_INDEX_UPDATE_NAME = "event_to_state_groups_sg_index"
STATE_GROUPS_ROOM_INDEX_UPDATE_NAME = "state_groups_room_id_idx"
def __init__(self, db_conn, hs):
super(StateBackgroundUpdateStore, self).__init__(db_conn, hs)
@ -1047,12 +1046,6 @@ class StateBackgroundUpdateStore(
table="event_to_state_groups",
columns=["state_group"],
)
self.register_background_index_update(
self.STATE_GROUPS_ROOM_INDEX_UPDATE_NAME,
index_name="state_groups_room_id_idx",
table="state_groups",
columns=["room_id"],
)
@defer.inlineCallbacks
def _background_deduplicate_state(self, progress, batch_size):