Filter out auth chain queries that don't exist (#16552)

1.103.0-whithout-watcha
Jason Little 1 year ago committed by GitHub
parent 8d5c1fe921
commit 460743da16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/16552.misc
  2. 5
      synapse/storage/databases/main/event_federation.py

@ -0,0 +1 @@
Reduce a little database load while processing state auth chains.

@ -301,6 +301,11 @@ class EventFederationWorkerStore(SignatureWorkerStore, EventsWorkerStore, SQLBas
# Add the initial set of chains, excluding the sequence corresponding to
# initial event.
for chain_id, seq_no in event_chains.items():
# Check if the initial event is the first item in the chain. If so, then
# there is nothing new to add from this chain.
if seq_no == 1:
continue
chains[chain_id] = max(seq_no - 1, chains.get(chain_id, 0))
# Now for each chain we figure out the maximum sequence number reachable

Loading…
Cancel
Save