MatrixSynapse/tests
Erik Johnston f112cfe5bb
Fix MultiWriteIdGenerator's handling of restarts. (#8374)
On startup `MultiWriteIdGenerator` fetches the maximum stream ID for
each instance from the table and uses that as its initial "current
position" for each writer. This is problematic as a) it involves either
a scan of events table or an index (neither of which is ideal), and b)
if rows are being persisted out of order elsewhere while the process
restarts then using the maximum stream ID is not correct. This could
theoretically lead to race conditions where e.g. events that are
persisted out of order are not sent down sync streams.

We fix this by creating a new table that tracks the current positions of
each writer to the stream, and update it each time we finish persisting
a new entry. This is a relatively small overhead when persisting events.
However for the cache invalidation stream this is a much bigger relative
overhead, so instead we note that for invalidation we don't actually
care about reliability over restarts (as there's no caches to
invalidate) and simply don't bother reading and writing to the new table
in that particular case.
2020-09-24 16:53:51 +01:00
..
api
app
appservice
config
crypto
events
federation Catch-up after Federation Outage (bonus): Catch-up on Synapse Startup (#8322) 2020-09-18 14:59:13 +01:00
handlers Create function to check for long names in devices (#8364) 2020-09-22 11:42:55 +01:00
http
logging
module_api
push
replication Add EventStreamPosition type (#8388) 2020-09-24 13:24:17 +01:00
rest Fixed a bug with reactivating users with the admin API (#8362) 2020-09-22 18:19:01 +01:00
scripts
server_notices
state
storage Fix MultiWriteIdGenerator's handling of restarts. (#8374) 2020-09-24 16:53:51 +01:00
test_utils Update test logging to be able to accept braces (#8335) 2020-09-18 07:56:40 -04:00
util
__init__.py
server.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
test_distributor.py
test_event_auth.py
test_federation.py
test_mau.py
test_metrics.py
test_phone_home.py
test_preview.py
test_server.py
test_state.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
test_terms_auth.py
test_test_utils.py
test_types.py
test_visibility.py
unittest.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
utils.py