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

Replication fails with AssertionError in replication_notifier #7308

Closed
richvdh opened this issue Apr 20, 2020 · 3 comments
Closed

Replication fails with AssertionError in replication_notifier #7308

richvdh opened this issue Apr 20, 2020 · 3 comments
Assignees
Labels
A-Workers Problems related to running Synapse in Worker Mode (or replication)

Comments

@richvdh
Copy link
Member

richvdh commented Apr 20, 2020

my master stopped sending event notifications over replication. It was logging this sort of thing:

2020-04-20 09:36:14,977 - synapse.replication.tcp.resource - 169 - INFO - replication_notifier-231759- Failed to handle stream events
2020-04-20 09:36:14,984 - synapse.metrics.background_process_metrics - 215 - ERROR - replication_notifier-231759- Background process 'replication_notifier' threw an exception
Capture point (most recent call last):
... lots of output...
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/synapse/synapse/synapse/metrics/background_process_metrics.py", line 213, in run
    return (yield result)
  File "/opt/synapse/env3/lib/python3.5/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/opt/synapse/synapse/synapse/replication/tcp/resource.py", line 166, in _run_notifier_loop
    updates, current_token, limited = await stream.get_updates()
  File "/opt/synapse/synapse/synapse/replication/tcp/streams/_base.py", line 134, in get_updates
    self.last_token, current_token
  File "/opt/synapse/synapse/synapse/replication/tcp/streams/_base.py", line 159, in get_updates_since
    from_token, upto_token, limit,
  File "/opt/synapse/synapse/synapse/replication/tcp/streams/_base.py", line 178, in update_function
    assert len(updates) <= limit
AssertionError

Likely this only affects develop currently.

@richvdh
Copy link
Member Author

richvdh commented Apr 24, 2020

#7337 has fixed the primary cause of this, but there's more work to be done:

@richvdh
Copy link
Member Author

richvdh commented Apr 25, 2020

turns out there are more of these:

Traceback (most recent call last):
  File "/opt/synapse/synapse/synapse/metrics/background_process_metrics.py", line 213, in run
    return (yield result)
  File "/opt/synapse/env3/lib/python3.5/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/opt/synapse/synapse/synapse/replication/tcp/resource.py", line 166, in _run_notifier_loop
    updates, current_token, limited = await stream.get_updates()
  File "/opt/synapse/synapse/synapse/replication/tcp/streams/_base.py", line 138, in get_updates
    self.last_token, current_token
  File "/opt/synapse/synapse/synapse/replication/tcp/streams/_base.py", line 163, in get_updates_since
    from_token, upto_token, _STREAM_UPDATE_TARGET_ROW_COUNT,
  File "/opt/synapse/synapse/synapse/replication/tcp/streams/events.py", line 180, in _update_function
    assert len(state_rows) < target_row_count
AssertionError

This looks like it is essentially:

it still won't work properly if we hit the limit on the current_state_delta stream

@richvdh
Copy link
Member Author

richvdh commented Apr 27, 2020

File "/opt/synapse/synapse/synapse/replication/tcp/streams/events.py", line 180, in _update_function
assert len(state_rows) < target_row_count

Hopefully this is fixed for reals by #7358.

@richvdh richvdh closed this as completed Apr 29, 2020
@richvdh richvdh added the A-Workers Problems related to running Synapse in Worker Mode (or replication) label Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Workers Problems related to running Synapse in Worker Mode (or replication)
Projects
None yet
Development

No branches or pull requests

1 participant