summary refs log tree commit diff
path: root/synapse/storage/databases
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-03-15 14:42:40 +0000
committerGitHub <noreply@github.com>2021-03-15 14:42:40 +0000
commit026503fa3b90c03996a64be95432e345434b4a82 (patch)
treec1cee50bb946cc4256338d1152dc195df3aa8a1d /synapse/storage/databases
parentOptimise missing prev_event handling (#9601) (diff)
downloadsynapse-026503fa3b90c03996a64be95432e345434b4a82.tar.xz
Don't go into federation catch up mode so easily (#9561)
Federation catch up mode is very inefficient if the number of events
that the remote server has missed is small, since handling gaps can be
very expensive, c.f. #9492.

Instead of going into catch up mode whenever we see an error, we instead
do so only if we've backed off from trying the remote for more than an
hour (the assumption being that in such a case it is more than a
transient failure).
Diffstat (limited to 'synapse/storage/databases')
-rw-r--r--synapse/storage/databases/main/transactions.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/storage/databases/main/transactions.py b/synapse/storage/databases/main/transactions.py
index b921d63d30..0309661841 100644
--- a/synapse/storage/databases/main/transactions.py
+++ b/synapse/storage/databases/main/transactions.py
@@ -350,11 +350,11 @@ class TransactionStore(TransactionWorkerStore):
 
         self.db_pool.simple_upsert_many_txn(
             txn,
-            "destination_rooms",
-            ["destination", "room_id"],
-            rows,
-            ["stream_ordering"],
-            [(stream_ordering,)] * len(rows),
+            table="destination_rooms",
+            key_names=("destination", "room_id"),
+            key_values=rows,
+            value_names=["stream_ordering"],
+            value_values=[(stream_ordering,)] * len(rows),
         )
 
     async def get_destination_last_successful_stream_ordering(