Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit c0318af

Browse files
committed
Update receipts stream change cache before advancing ID generator
1 parent 15ce6be commit c0318af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

synapse/storage/databases/main/receipts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,12 +595,13 @@ def process_replication_rows(
595595
rows: Iterable[Any],
596596
) -> None:
597597
if stream_name == ReceiptsStream.NAME:
598-
self._receipts_id_gen.advance(instance_name, token)
599598
for row in rows:
600599
self.invalidate_caches_for_receipt(
601600
row.room_id, row.receipt_type, row.user_id
602601
)
603602
self._receipts_stream_cache.entity_has_changed(row.room_id, token)
603+
# Important that the ID gen advances after stream change caches
604+
self._receipts_id_gen.advance(instance_name, token)
604605

605606
return super().process_replication_rows(stream_name, instance_name, token, rows)
606607

0 commit comments

Comments
 (0)