summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-05-30 10:51:09 +0100
committerGitHub <noreply@github.com>2022-05-30 10:51:09 +0100
commit248046187940372c23466cb395b46ed97ebda1ed (patch)
treeb596b260ad616bf76b08d4399655e61bc682ba82
parentRemove unused `contrib/experiments/cursesio.py` (#12910) (diff)
downloadsynapse-248046187940372c23466cb395b46ed97ebda1ed.tar.xz
Fix `get_metadata_for_events` (#12904)
This method was introduced in #12852. It is using the `state_key` column from
the `events` table, which is not (yet) reliable (see #11496).
-rw-r--r--changelog.d/12904.misc1
-rw-r--r--synapse/storage/databases/main/state.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/12904.misc b/changelog.d/12904.misc
new file mode 100644
index 0000000000..afca32471f
--- /dev/null
+++ b/changelog.d/12904.misc
@@ -0,0 +1 @@
+Pull out less state when handling gaps in room DAG.
diff --git a/synapse/storage/databases/main/state.py b/synapse/storage/databases/main/state.py
index ea5cbdac08..a07ad85582 100644
--- a/synapse/storage/databases/main/state.py
+++ b/synapse/storage/databases/main/state.py
@@ -167,8 +167,8 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore):
             )
 
             sql = f"""
-                SELECT e.event_id, e.room_id, e.type, e.state_key FROM events AS e
-                LEFT JOIN state_events USING (event_id)
+                SELECT e.event_id, e.room_id, e.type, se.state_key FROM events AS e
+                LEFT JOIN state_events se USING (event_id)
                 WHERE {clause}
             """