mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-23 17:49:26 -05:00
Fix get destinations to catch up query. (#9114)
t was doing a sequential scan on `destination_rooms`, which took minutes.
This commit is contained in:
parent
7036e24e98
commit
631dd06f2c
1
changelog.d/9114.bugfix
Normal file
1
changelog.d/9114.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix bug in federation catchup logic that caused outbound federation to be delayed for large servers after start up. Introduced in v1.21.0.
|
@ -464,12 +464,10 @@ class TransactionStore(TransactionWorkerStore):
|
||||
txn: LoggingTransaction, now_time_ms: int, after_destination: Optional[str]
|
||||
) -> List[str]:
|
||||
q = """
|
||||
SELECT destination FROM destinations
|
||||
WHERE destination IN (
|
||||
SELECT destination FROM destination_rooms
|
||||
WHERE destination_rooms.stream_ordering >
|
||||
destinations.last_successful_stream_ordering
|
||||
)
|
||||
SELECT DISTINCT destination FROM destinations
|
||||
INNER JOIN destination_rooms USING (destination)
|
||||
WHERE
|
||||
stream_ordering > last_successful_stream_ordering
|
||||
AND destination > ?
|
||||
AND (
|
||||
retry_last_ts IS NULL OR
|
||||
|
Loading…
Reference in New Issue
Block a user