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

Commit 0de2f5a

Browse files
committed
Disable per-instance event stream tokens
1 parent 523d6a9 commit 0de2f5a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

synapse/handlers/sync.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,16 @@ async def generate_sync_result(
13491349
# Always use the `now_token` in `SyncResultBuilder`
13501350
now_token = self.event_sources.get_current_token()
13511351

1352+
# Beeper change: remove any per-instance stream token positions, this
1353+
# happens when one or more event persisters fall behind the others, in
1354+
# practice this is very rare and usually only ~1-2 events. By removing
1355+
# this we dramatically simplify debugging issues, checking caches and
1356+
# generating room previews.
1357+
now_token = now_token.copy_and_replace(
1358+
StreamKeyType.ROOM,
1359+
RoomStreamToken(None, now_token.room_key.stream),
1360+
)
1361+
13521362
if debug_current_token:
13531363
logger.info(
13541364
"Overriding sync current token for debugging to: %r",

0 commit comments

Comments
 (0)