synapse-product/synapse
Erik Johnston b1433bf231
Don't table scan events on worker startup (#8419)
* Fix table scan of events on worker startup.

This happened because we assumed "new" writers had an initial stream
position of 0, so the replication code tried to fetch all events written
by the instance between 0 and the current position.

Instead, set the initial position of new writers to the current
persisted up to position, on the assumption that new writers won't have
written anything before that point.

* Consider old writers coming back as "new".

Otherwise we'd try and fetch entries between the old stale token and the
current position, even though it won't have written any rows.

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2020-09-29 16:42:19 +01:00
..
_scripts Remove obsolete __future__ imports (#8337) 2020-09-17 08:37:01 -04:00
api Don't push if an user account has expired (#8353) 2020-09-23 16:06:28 +01:00
app Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
appservice Add type annotations to SimpleHttpClient (#8372) 2020-09-24 15:47:20 +01:00
config Allow existing users to login via OpenID Connect. (#8345) 2020-09-25 07:01:45 -04:00
crypto Fix occasional "Re-starting finished log context" from keyring (#8398) 2020-09-25 12:29:54 +01:00
events Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
federation Mypy fixes for synapse.handlers.federation (#8422) 2020-09-29 15:57:36 +01:00
groups Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
handlers Mypy fixes for synapse.handlers.federation (#8422) 2020-09-29 15:57:36 +01:00
http Fix handling of connection timeouts in outgoing http requests (#8400) 2020-09-29 10:29:21 +01:00
logging Create a mechanism for marking tests "logcontext clean" (#8399) 2020-09-28 17:58:33 +01:00
metrics Use slots in attrs classes where possible (#8296) 2020-09-14 12:50:06 -04:00
module_api Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
push Don't push if an user account has expired (#8353) 2020-09-23 16:06:28 +01:00
replication Add metrics to track success/otherwise of replication requests (#8406) 2020-09-29 11:06:11 +01:00
res/templates Escape the error description on the sso_error template. (#8405) 2020-09-25 11:05:54 -04:00
rest Only assert valid next_link params when provided (#8417) 2020-09-29 12:36:44 +01:00
server_notices Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
spam_checker_api Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
state Improve logging of state resolution (#8371) 2020-09-23 16:42:44 +01:00
static Clean-up the fallback login code. (#7657) 2020-06-10 09:50:39 -04:00
storage Don't table scan events on worker startup (#8419) 2020-09-29 16:42:19 +01:00
streams Clean up types for PaginationConfig (#8250) 2020-09-08 15:00:17 +01:00
util Fix handling of connection timeouts in outgoing http requests (#8400) 2020-09-29 10:29:21 +01:00
__init__.py 1.20.1 2020-09-24 16:25:33 +01:00
event_auth.py Convert events worker database to async/await. (#8071) 2020-08-18 16:20:49 -04:00
notifier.py Add EventStreamPosition type (#8388) 2020-09-24 13:24:17 +01:00
python_dependencies.py Do not check lint/test dependencies at runtime. (#8377) 2020-09-23 11:45:37 +01:00
secrets.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
server.py Fix ratelimiting for federation /send requests. (#8342) 2020-09-18 10:49:29 +01:00
types.py Add EventStreamPosition type (#8388) 2020-09-24 13:24:17 +01:00
visibility.py Convert groups and visibility code to async / await. (#7951) 2020-07-27 12:32:08 -04:00