From dab61901e79662cdd9da29d48bea84c959bfa95c Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Mon, 23 May 2022 14:48:29 +0100 Subject: [PATCH 1/3] Disambiguate `event_id` column name in query as Postgres doesn't accept this --- synapse/storage/databases/main/event_federation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/storage/databases/main/event_federation.py b/synapse/storage/databases/main/event_federation.py index dcfe8caf473a..562dcbe94d3a 100644 --- a/synapse/storage/databases/main/event_federation.py +++ b/synapse/storage/databases/main/event_federation.py @@ -1057,7 +1057,7 @@ def _get_connected_batch_event_backfill_results_txn( INNER JOIN batch_events AS c ON i.next_batch_id = c.batch_id /* Get the depth of the batch start event from the events table */ - INNER JOIN events AS e USING (event_id) + INNER JOIN events AS e ON c.event_id = e.event_id /* Find an insertion event which matches the given event_id */ WHERE i.event_id = ? LIMIT ? From e69a9aee9050bfbb124a37570866709813bafc9f Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Mon, 23 May 2022 14:56:33 +0100 Subject: [PATCH 2/3] Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) --- changelog.d/12843.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12843.bugfix diff --git a/changelog.d/12843.bugfix b/changelog.d/12843.bugfix new file mode 100644 index 000000000000..b412a01695bf --- /dev/null +++ b/changelog.d/12843.bugfix @@ -0,0 +1 @@ +Fix ambiguous column name that would prevent use of MSC2716 History Import when using Postgres as a database. \ No newline at end of file From 3a67e4e1ca4629f775e11571404c3b25eb908d9e Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Thu, 26 May 2022 10:27:42 +0100 Subject: [PATCH 3/3] Update Newsfile --- changelog.d/12843.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/12843.bugfix b/changelog.d/12843.bugfix index b412a01695bf..f87c0799a070 100644 --- a/changelog.d/12843.bugfix +++ b/changelog.d/12843.bugfix @@ -1 +1 @@ -Fix ambiguous column name that would prevent use of MSC2716 History Import when using Postgres as a database. \ No newline at end of file +Fix bug where servers using a Postgres database would fail to backfill from an insertion event when MSC2716 is enabled (`experimental_features.msc2716_enabled`).