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

Commit

Permalink
Workaround for assertion errors from db_query_to_update_function (#7378)
Browse files Browse the repository at this point in the history
Hopefully this is no worse than what we have on master...
  • Loading branch information
richvdh authored May 1, 2020
1 parent 627b0f5 commit b2dba06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/7378.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move catchup of replication streams logic to worker.
3 changes: 1 addition & 2 deletions synapse/replication/tcp/streams/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ async def update_function(from_token, upto_token, limit):
rows = await query_function(from_token, upto_token, limit)
updates = [(row[0], row[1:]) for row in rows]
limited = False
if len(updates) == limit:
if len(updates) >= limit:
upto_token = updates[-1][0]
limited = True
assert len(updates) <= limit

return updates, upto_token, limited

Expand Down

0 comments on commit b2dba06

Please sign in to comment.