diff options
author | Erik Johnston <erik@matrix.org> | 2020-10-14 15:40:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-14 15:40:06 +0100 |
commit | 618d405a322590d022d839b6d72ba51e992a71c3 (patch) | |
tree | 1a48de01d547ef3c491483424e7e3e1b10366e2f /synapse/storage/util | |
parent | Add note to manhole.md about bind_address when using with docker (#8526) (diff) | |
download | synapse-618d405a322590d022d839b6d72ba51e992a71c3.tar.xz |
Remove racey assertion in MultiWriterIDGenerator (#8530)
We asserted that the IDs returned by postgres sequence was greater than any we had seen, however this is technically racey as we may update the current positions out of order. We now assert that the sequences are correct on startup, so the assertion is no longer really required, so we remove them.
Diffstat (limited to 'synapse/storage/util')
-rw-r--r-- | synapse/storage/util/id_generators.py | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/synapse/storage/util/id_generators.py b/synapse/storage/util/id_generators.py index 3d8da48f2d..02d71302ea 100644 --- a/synapse/storage/util/id_generators.py +++ b/synapse/storage/util/id_generators.py @@ -618,14 +618,7 @@ class _MultiWriterCtxManager: db_autocommit=True, ) - # Assert the fetched ID is actually greater than any ID we've already - # seen. If not, then the sequence and table have got out of sync - # somehow. with self.id_gen._lock: - assert max(self.id_gen._current_positions.values(), default=0) < min( - self.stream_ids - ) - self.id_gen._unfinished_ids.update(self.stream_ids) if self.multiple_ids is None: |