Skip to content

Commit 160bce9

Browse files
richvdhphil-flex
authored andcommitted
Workaround for assertion errors from db_query_to_update_function (matrix-org#7378)
Hopefully this is no worse than what we have on master...
1 parent da7d46f commit 160bce9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

changelog.d/7378.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move catchup of replication streams logic to worker.

synapse/replication/tcp/streams/_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,9 @@ async def update_function(from_token, upto_token, limit):
176176
rows = await query_function(from_token, upto_token, limit)
177177
updates = [(row[0], row[1:]) for row in rows]
178178
limited = False
179-
if len(updates) == limit:
179+
if len(updates) >= limit:
180180
upto_token = updates[-1][0]
181181
limited = True
182-
assert len(updates) <= limit
183182

184183
return updates, upto_token, limited
185184

0 commit comments

Comments
 (0)