forked-synapse/synapse
Erik Johnston 664409b169
Fix bug in account data replication stream. (#7656)
* Ensure account data stream IDs are unique.

The account data stream is shared between three tables, and the maximum
allocated ID was tracked in a dedicated table. Updating the max ID
happened outside the transaction that allocated the ID, leading to a
race where if the server was restarted then the same ID could be
allocated but the max ID failed to be updated, leading it to be reused.

The ID generators have support for tracking across multiple tables, so
we may as well use that instead of a dedicated table.

* Fix bug in account data replication stream.

If the same stream ID was used in both global and room account data then
the getting updates for the replication stream would fail due to
`heapq.merge(..)` trying to compare a `str` with a `None`. (This is
because you'd have two rows like `(534, '!room')` and `(534, None)` from
the room and global account data tables).

Fix is just to order by stream ID, since we don't rely on the ordering
beyond that. The bug where stream IDs can be reused should be fixed now,
so this case shouldn't happen going forward.

Fixes #7617
2020-06-09 16:28:57 +01:00
..
_scripts Replace instance variations of homeserver with correct case/spacing 2019-11-12 13:08:12 +00:00
api Update to the stable SSO prefix for UI Auth. (#7630) 2020-06-05 10:50:08 -04:00
app Attempt to fix PhoneHomeStatsTestCase.test_performance_100 being flaky. (#7634) 2020-06-05 07:36:47 -04:00
appservice Fix a couple of small typos 2020-05-15 18:54:32 +01:00
config Add an option to disable autojoin for guest accounts (#6637) 2020-06-05 18:18:15 +01:00
crypto Clean up some LoggingContext stuff (#7120) 2020-03-24 14:45:33 +00:00
events Strictly enforce canonicaljson requirements in a new room version (#7381) 2020-05-14 13:24:01 -04:00
federation add a comment 2020-05-21 13:25:41 +01:00
groups Convert groups local and server to async/await. (#7600) 2020-06-01 07:28:43 -04:00
handlers Convert the registration handler to async/await. (#7649) 2020-06-08 11:15:02 -04:00
http Clean up exception handling in SAML2ResponseResource (#7614) 2020-06-03 10:41:12 +01:00
logging remove miscellaneous PY2 code 2020-05-15 19:37:41 +01:00
metrics Make inflight background metrics more efficient. (#7597) 2020-05-29 13:25:32 +01:00
module_api Convert the registration handler to async/await. (#7649) 2020-06-08 11:15:02 -04:00
push Convert sending mail to async/await. (#7557) 2020-05-22 13:41:11 +01:00
replication Fix bug in account data replication stream. (#7656) 2020-06-09 16:28:57 +01:00
res/templates Implement OpenID Connect-based login (#7256) 2020-05-08 08:30:40 -04:00
rest Fix type information on assert_*_is_admin methods (#7645) 2020-06-05 14:33:49 +01:00
server_notices Optimise some references to hs.config (#7546) 2020-05-22 21:47:07 +01:00
spam_checker_api Add type hints to the spam check module (#6915) 2020-02-14 12:49:40 -05:00
state Allow configuration of Synapse's cache without using synctl or environment variables (#6391) 2020-05-11 18:45:23 +01:00
static Accept device information at the login fallback endpoint. (#7629) 2020-06-08 10:13:24 -04:00
storage Fix bug in account data replication stream. (#7656) 2020-06-09 16:28:57 +01:00
streams Bump version of mypy 2019-12-12 15:21:12 +00:00
util Performance improvements and refactor of Ratelimiter (#7595) 2020-06-05 10:47:20 +01:00
__init__.py 1.14.0 2020-05-28 12:36:00 +02:00
event_auth.py Add type hints to event_auth code. (#7505) 2020-05-15 11:19:43 -04:00
notifier.py Fix new flake8 errors (#7489) 2020-05-13 08:24:50 -04:00
python_dependencies.py Implement OpenID Connect-based login (#7256) 2020-05-08 08:30:40 -04:00
secrets.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
server.py Performance improvements and refactor of Ratelimiter (#7595) 2020-06-05 10:47:20 +01:00
server.pyi Add ability to wait for replication streams (#7542) 2020-05-22 14:21:54 +01:00
types.py Validate the alt_aliases property of canonical alias events (#6971) 2020-03-03 07:12:45 -05:00
visibility.py Refactor a bit 2020-03-11 18:49:41 +00:00