mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 09:10:52 +00:00
We do actually want to delete rows out of event_backward_extremities
This commit is contained in:
parent
c1779a79bc
commit
e4eddf9b36
1 changed files with 11 additions and 4 deletions
|
@ -336,16 +336,23 @@ class EventFederationStore(SQLBaseStore):
|
||||||
" SELECT 1 FROM event_backward_extremities"
|
" SELECT 1 FROM event_backward_extremities"
|
||||||
" WHERE event_id = ? AND room_id = ?"
|
" WHERE event_id = ? AND room_id = ?"
|
||||||
" )"
|
" )"
|
||||||
" AND NOT EXISTS ("
|
|
||||||
" SELECT 1 FROM events WHERE event_id = ? AND room_id = ?"
|
|
||||||
" )"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
txn.executemany(query, [
|
txn.executemany(query, [
|
||||||
(e_id, room_id, e_id, room_id, e_id, room_id,)
|
(e_id, room_id, e_id, room_id, )
|
||||||
for e_id, _ in prev_events
|
for e_id, _ in prev_events
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# Also delete from the backwards extremities table all ones that
|
||||||
|
# reference events that we have already seen
|
||||||
|
query = (
|
||||||
|
"DELETE FROM event_backward_extremities"
|
||||||
|
" WHERE event_id = ? AND room_id = ?"
|
||||||
|
)
|
||||||
|
txn.executemany(query, [(e_id, room_id) for e_id, _ in prev_events])
|
||||||
|
|
||||||
|
|
||||||
txn.call_after(
|
txn.call_after(
|
||||||
self.get_latest_event_ids_in_room.invalidate, room_id
|
self.get_latest_event_ids_in_room.invalidate, room_id
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue