synapse-old/synapse/storage
Erik Johnston 8f35f8148e
Fix bug where a new writer advances their token too quickly (#16473)
* Fix bug where a new writer advances their token too quickly

When starting a new writer (for e.g. persisting events), the
`MultiWriterIdGenerator` doesn't have a minimum token for it as there
are no rows matching that new writer in the DB.

This results in the the first stream ID it acquired being announced as
persisted *before* it actually finishes persisting, if another writer
gets and persists a subsequent stream ID. This is due to the logic of
setting the minimum persisted position to the minimum known position of
across all writers, and the new writer starts off not being considered.

* Fix sending out POSITIONs when our token advances without update

Broke in #14820

* For replication HTTP requests, only wait for minimal position
2023-10-23 16:57:30 +01:00
..
controllers Convert state delta processing from a dict to attrs. (#16469) 2023-10-16 07:35:22 -04:00
databases Fix bug that could cause a `/sync` to tightloop with sqlite after restart (#16540) 2023-10-23 13:39:25 +00:00
engines Delete device messages asynchronously and in staged batches (#16240) 2023-09-06 09:30:53 +02:00
schema Remove the last reference to event_txn_id. (#16521) 2023-10-23 07:37:45 -04:00
util Fix bug where a new writer advances their token too quickly (#16473) 2023-10-23 16:57:30 +01:00
__init__.py Rename storage classes (#12913) 2022-05-31 12:17:50 +00:00
_base.py Clear event caches when we purge history (#15609) 2023-06-08 13:14:40 +01:00
background_updates.py Add support for pydantic v2 via pydantic.v1 compat module (#16332) 2023-09-25 15:19:08 +00:00
database.py Convert simple_select_many_batch, simple_select_many_txn to tuples. (#16444) 2023-10-11 13:24:56 -04:00
keys.py Add cache to `get_server_keys_json_for_remote` (#16123) 2023-08-18 11:05:01 +01:00
prepare_database.py Run pyupgrade for python 3.7 & 3.8. (#16110) 2023-08-15 08:11:20 -04:00
push_rule.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
roommember.py mypy plugin to check `@cached` return types (#14911) 2023-10-02 14:22:36 +00:00
types.py Bump types-psycopg2 from 2.9.21.11 to 2.9.21.14 (#16381) 2023-09-25 17:48:42 +01:00