forked-synapse/synapse/storage/data_stores/main
Andrew Morgan 5d92a1428c
Prevent join->join membership transitions changing member count (#7977)
`StatsHandler` handles updates to the `current_state_delta_stream`, and updates room stats such as the amount of state events, joined users, etc.

However, it counts every new join membership as a new user entering a room (and that user being in another room), whereas it's possible for a user's membership status to go from join -> join, for instance when they change their per-room profile information.

This PR adds a check for join->join membership transitions, and bails out early, as none of the further checks are necessary at that point.

Due to this bug, membership stats in many rooms have ended up being wildly larger than their true values. I am not sure if we also want to include a migration step which recalculates these statistics (possibly using the `_populate_stats_process_rooms` bg update).

Bug introduced in the initial implementation https://github.com/matrix-org/synapse/pull/4338.
2020-08-03 21:54:24 +01:00
..
schema Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
__init__.py Stop using 'device_max_stream_id' (#7882) 2020-07-17 17:03:27 +01:00
account_data.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
appservice.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
cache.py Re-implement unread counts (#7736) 2020-07-29 18:26:55 +01:00
censor_events.py Allow censoring of events to happen on workers. (#7492) 2020-05-13 17:15:40 +01:00
client_ips.py Replace iteritems/itervalues/iterkeys with native versions. (#7692) 2020-06-15 07:03:36 -04:00
deviceinbox.py Stop using 'device_max_stream_id' (#7882) 2020-07-17 17:03:27 +01:00
devices.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
directory.py Transfer alias mappings when joining an upgraded room (#6946) 2020-03-30 17:53:25 +01:00
e2e_room_keys.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
end_to_end_keys.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
event_federation.py Replace all remaining six usage with native Python 3 equivalents (#7704) 2020-06-16 08:51:47 -04:00
event_push_actions.py Convert some of the data store to async. (#7976) 2020-07-30 07:20:41 -04:00
events_bg_updates.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
events_worker.py Re-implement unread counts (#7736) 2020-07-29 18:26:55 +01:00
events.py Re-implement unread counts (#7736) 2020-07-29 18:26:55 +01:00
filtering.py Move DB pool and helper functions into dedicated Database class 2019-12-05 10:46:37 +00:00
group_server.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
keys.py remove builtins.buffer code from storage code 2020-05-15 19:37:41 +01:00
media_repository.py Allow local media to be marked as safe from being quarantined. (#7718) 2020-06-22 08:04:14 -04:00
metrics.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
monthly_active_users.py async/await get_user_id_by_threepid (#7620) 2020-06-03 17:15:57 +01:00
openid.py Move DB pool and helper functions into dedicated Database class 2019-12-05 10:46:37 +00:00
presence.py Refactor getting replication updates from database. (#7636) 2020-06-16 17:10:28 +01:00
profile.py Fix a small typo in the arguments of simple_update in update_remote_profile_cache (#7511) 2020-05-15 16:17:12 +01:00
purge_events.py Remove from the event_relations table when purging historical events. (#7978) 2020-07-29 13:55:01 -04:00
push_rule.py Convert state resolution to async/await (#7942) 2020-07-24 10:59:51 -04:00
pusher.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
receipts.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
registration.py Use a postgres sequence to generate guest user IDs 2020-07-16 13:00:25 +01:00
rejections.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
relations.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
room.py Convert some of the data store to async. (#7976) 2020-07-30 07:20:41 -04:00
roommember.py Convert state resolution to async/await (#7942) 2020-07-24 10:59:51 -04:00
search.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
signatures.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
state_deltas.py Always return a deferred from get_current_state_deltas. (#7019) 2020-03-02 16:52:15 +00:00
state.py Convert some of the data store to async. (#7976) 2020-07-30 07:20:41 -04:00
stats.py Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
stream.py Update worker docs with recent enhancements (#7969) 2020-07-29 23:22:13 +01:00
tags.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
transactions.py remove builtins.buffer code from storage code 2020-05-15 19:37:41 +01:00
ui_auth.py Consistently use db_to_json to convert from database values to JSON objects. (#7849) 2020-07-16 11:32:19 -04:00
user_directory.py Convert state resolution to async/await (#7942) 2020-07-24 10:59:51 -04:00
user_erasure_store.py Follow-up to admin API to re-activate accounts (#7908) 2020-07-22 12:33:19 -04:00