493e25d554 
								
							
								 
							
						 
						
							
							
								
								Move storage functions for push calculations  
							
							... 
							
							
							
							This will allow push actions for an event to be calculated on workers. 
							
						 
						
							2018-02-27 13:58:16 +00:00  
				
					
						
							
							
								 
						
							
							
								70349872c2 
								
							
								 
							
						 
						
							
							
								
								Update copyright  
							
							
							
						 
						
							2018-02-23 11:14:35 +00:00  
				
					
						
							
							
								 
						
							
							
								3dec9c66b3 
								
							
								 
							
						 
						
							
							
								
								Split out RoomMemberStore  
							
							
							
						 
						
							2018-02-21 12:07:26 +00:00  
				
					
						
							
							
								 
						
							
							
								6cfee09be9 
								
							
								 
							
						 
						
							
							
								
								Make __init__ consitstent across Store heirarchy  
							
							... 
							
							
							
							Add db_conn parameters to the `__init__` methods of the *Store classes, so that
they are all consistent, which makes the multiple inheritance work correctly
(and so that we can later extract mixins which can be used in the slavedstores) 
							
						 
						
							2017-11-13 10:46:07 +00:00  
				
					
						
							
							
								 
						
							
							
								eaaabc6c4f 
								
							
								 
							
						 
						
							
							
								
								replace 'except:' with 'except Exception:'  
							
							... 
							
							
							
							what could possibly go wrong 
							
						 
						
							2017-10-23 15:52:32 +01:00  
				
					
						
							
							
								 
						
							
							
								e8496efe84 
								
							
								 
							
						 
						
							
							
								
								Fix up comment  
							
							
							
						 
						
							2017-10-09 15:17:34 +01:00  
				
					
						
							
							
								 
						
							
							
								e4ab96021e 
								
							
								 
							
						 
						
							
							
								
								Update comments  
							
							
							
						 
						
							2017-10-03 14:10:41 +01:00  
				
					
						
							
							
								 
						
							
							
								30848c0fcd 
								
							
								 
							
						 
						
							
							
								
								Ignore incoming events for rooms that we have left  
							
							... 
							
							
							
							When synapse receives an event for a room its not in over federation, it
double checks with the remote server to see if it is in fact in the
room. This is done so that if the server has forgotten about the room
(usually as a result of the database being dropped) it can recover from
it.
However, in the presence of state resets in large rooms, this can cause
a lot of work for servers that have legitimately left. As a hacky
solution that supports both cases we drop incoming events for rooms that
we have explicitly left.
This means that we no longer support the case of servers having
forgotten that they've rejoined a room, but that is sufficiently rare
that we're not going to support it for now. 
							
						 
						
							2017-10-03 11:18:21 +01:00  
				
					
						
							
							
								 
						
							
							
								d53fe399eb 
								
							
								 
							
						 
						
							
							
								
								Add cache for is_host_joined  
							
							
							
						 
						
							2017-06-13 09:56:18 +01:00  
				
					
						
							
							
								 
						
							
							
								935e588799 
								
							
								 
							
						 
						
							
							
								
								Tweak SQL  
							
							
							
						 
						
							2017-06-09 13:01:23 +01:00  
				
					
						
							
							
								 
						
							
							
								0185b75381 
								
							
								 
							
						 
						
							
							
								
								Change is_host_joined to use current_state table  
							
							... 
							
							
							
							This bypasses a bug where using the state groups to figure out if a host
is in a room sometimes errors if the servers isn't in the room. (For
example when the server rejected an invite to a remote room) 
							
						 
						
							2017-06-09 10:52:26 +01:00  
				
					
						
							
							
								 
						
							
							
								6ba21bf2b8 
								
							
								 
							
						 
						
							
							
								
								Comments  
							
							
							
						 
						
							2017-06-07 11:08:36 +01:00  
				
					
						
							
							
								 
						
							
							
								6e2a7ee1bc 
								
							
								 
							
						 
						
							
							
								
								Remove spurious log lines  
							
							
							
						 
						
							2017-06-07 11:05:17 +01:00  
				
					
						
							
							
								 
						
							
							
								619e8ecd0c 
								
							
								 
							
						 
						
							
							
								
								Handle None state group correctly  
							
							
							
						 
						
							2017-05-26 10:46:03 +01:00  
				
					
						
							
							
								 
						
							
							
								dfbda5e025 
								
							
								 
							
						 
						
							
							
								
								Faster cache for get_joined_hosts  
							
							
							
						 
						
							2017-05-25 17:24:44 +01:00  
				
					
						
							
							
								 
						
							
							
								85e8092cca 
								
							
								 
							
						 
						
							
							
								
								Comment  
							
							
							
						 
						
							2017-05-17 10:03:09 +01:00  
				
					
						
							
							
								 
						
							
							
								ad53fc3cf4 
								
							
								 
							
						 
						
							
							
								
								Short circuit when we have delta ids  
							
							
							
						 
						
							2017-05-17 09:57:34 +01:00  
				
					
						
							
							
								 
						
							
							
								13f540ef1b 
								
							
								 
							
						 
						
							
							
								
								Speed up get_joined_hosts  
							
							
							
						 
						
							2017-05-16 16:05:22 +01:00  
				
					
						
							
							
								 
						
							
							
								ffad4fe35b 
								
							
								 
							
						 
						
							
							
								
								Don't update event cache hit ratio from get_joined_users  
							
							... 
							
							
							
							Otherwise the hit ration of plain get_events gets completely skewed by
calls to get_joined_users* functions. 
							
						 
						
							2017-05-08 16:06:17 +01:00  
				
					
						
							
							
								 
						
							
							
								66f371e8b8 
								
							
								 
							
						 
						
							
							
								
								Merge pull request  #2176  from matrix-org/erikj/faster_get_joined  
							
							... 
							
							
							
							Make get_joined_users faster 
							
						 
						
							2017-05-05 10:59:55 +01:00  
				
					
						
							
							
								 
						
							
							
								e3aa8a7aa8 
								
							
								 
							
						 
						
							
							
								
								Merge pull request  #2185  from matrix-org/erikj/smaller_caches  
							
							... 
							
							
							
							Optimise caches for single key 
							
						 
						
							2017-05-05 10:19:05 +01:00  
				
					
						
							
							
								 
						
							
							
								cf589f2c1e 
								
							
								 
							
						 
						
							
							
								
								Fixes  
							
							
							
						 
						
							2017-05-05 10:17:56 +01:00  
				
					
						
							
							
								 
						
							
							
								aa93cb9f44 
								
							
								 
							
						 
						
							
							
								
								Add comment  
							
							
							
						 
						
							2017-05-04 14:59:28 +01:00  
				
					
						
							
							
								 
						
							
							
								537dbadea0 
								
							
								 
							
						 
						
							
							
								
								Intern host strings  
							
							
							
						 
						
							2017-05-04 14:55:28 +01:00  
				
					
						
							
							
								 
						
							
							
								07a07588a0 
								
							
								 
							
						 
						
							
							
								
								Make caches bigger  
							
							
							
						 
						
							2017-05-04 14:52:28 +01:00  
				
					
						
							
							
								 
						
							
							
								dfaa58f72d 
								
							
								 
							
						 
						
							
							
								
								Fix comment and num args  
							
							
							
						 
						
							2017-05-04 14:50:24 +01:00  
				
					
						
							
							
								 
						
							
							
								5d8290429c 
								
							
								 
							
						 
						
							
							
								
								Reduce size of get_users_in_room  
							
							
							
						 
						
							2017-05-04 13:43:19 +01:00  
				
					
						
							
							
								 
						
							
							
								7ebf518c02 
								
							
								 
							
						 
						
							
							
								
								Make get_joined_users faster  
							
							
							
						 
						
							2017-05-03 15:55:54 +01:00  
				
					
						
							
							
								 
						
							
							
								7166854f41 
								
							
								 
							
						 
						
							
							
								
								Add cache for get_current_hosts_in_room  
							
							
							
						 
						
							2017-05-02 10:36:35 +01:00  
				
					
						
							
							
								 
						
							
							
								f144365281 
								
							
								 
							
						 
						
							
							
								
								Comment  
							
							
							
						 
						
							2017-04-25 15:18:26 +01:00  
				
					
						
							
							
								 
						
							
							
								d9aa645f86 
								
							
								 
							
						 
						
							
							
								
								Reduce size of joined_user cache  
							
							... 
							
							
							
							The _get_joined_users_from_context cache stores a mapping from user_id
to avatar_url and display_name. Instead of storing those in a dict,
store them in a namedtuple as that uses much less memory.
We also try converting the string to ascii to further reduce the size. 
							
						 
						
							2017-04-25 14:38:51 +01:00  
				
					
						
							
							
								 
						
							
							
								7fc1f1e2b6 
								
							
								 
							
						 
						
							
							
								
								Cache hosts in room  
							
							
							
						 
						
							2017-03-24 11:46:24 +00:00  
				
					
						
							
							
								 
						
							
							
								d58b1ffe94 
								
							
								 
							
						 
						
							
							
								
								Replace some calls to cursor_to_dict  
							
							... 
							
							
							
							cursor_to_dict can be surprisinglh expensive for large result sets, so lets
only call it when we need to. 
							
						 
						
							2017-03-24 11:07:02 +00:00  
				
					
						
							
							
								 
						
							
							
								da146657c9 
								
							
								 
							
						 
						
							
							
								
								Comments  
							
							
							
						 
						
							2017-03-16 13:04:07 +00:00  
				
					
						
							
							
								 
						
							
							
								6957bfdca6 
								
							
								 
							
						 
						
							
							
								
								Don't recreate so many sets  
							
							
							
						 
						
							2017-03-16 11:54:26 +00:00  
				
					
						
							
							
								 
						
							
							
								38258a0976 
								
							
								 
							
						 
						
							
							
								
								Bump cache sizes for common membership queries  
							
							
							
						 
						
							2017-02-02 18:45:55 +00:00  
				
					
						
							
							
								 
						
							
							
								832e9c52ca 
								
							
								 
							
						 
						
							
							
								
								Comment  
							
							
							
						 
						
							2017-02-02 13:09:56 +00:00  
				
					
						
							
							
								 
						
							
							
								54a79c1d37 
								
							
								 
							
						 
						
							
							
								
								Make presence.get_new_events a bit faster  
							
							... 
							
							
							
							We do this by caching the set of users a user shares rooms with. 
							
						 
						
							2017-02-02 13:07:18 +00:00  
				
					
						
							
							
								 
						
							
							
								62f6b86ba7 
								
							
								 
							
						 
						
							
							
								
								Merge pull request  #1868  from matrix-org/erikj/replication_cache  
							
							... 
							
							
							
							Only invalidate membership caches based on the cache stream 
							
						 
						
							2017-02-01 13:12:30 +00:00  
				
					
						
							
							
								 
						
							
							
								f6124311fd 
								
							
								 
							
						 
						
							
							
								
								Add m.room.member type to query  
							
							
							
						 
						
							2017-02-01 11:59:17 +00:00  
				
					
						
							
							
								 
						
							
							
								458b6f4733 
								
							
								 
							
						 
						
							
							
								
								Only invalidate membership caches based on the cache stream  
							
							... 
							
							
							
							Before we completely invalidated get_users_in_room whenever we updated
any current_state_events table. This was way too aggressive. 
							
						 
						
							2017-01-31 16:09:03 +00:00  
				
					
						
							
							
								 
						
							
							
								21b7375778 
								
							
								 
							
						 
						
							
							
								
								Add an index to make membership queries faster  
							
							
							
						 
						
							2017-01-31 15:15:57 +00:00  
				
					
						
							
							
								 
						
							
							
								1c13c9f6b6 
								
							
								 
							
						 
						
							
							
								
								Don't have such a large cache  
							
							
							
						 
						
							2017-01-30 17:12:14 +00:00  
				
					
						
							
							
								 
						
							
							
								828db669ec 
								
							
								 
							
						 
						
							
							
								
								Use get_users_in_room and declare it iterable  
							
							
							
						 
						
							2017-01-30 16:37:22 +00:00  
				
					
						
							
							
								 
						
							
							
								897f8752da 
								
							
								 
							
						 
						
							
							
								
								Up cache max entries for state  
							
							
							
						 
						
							2017-01-16 15:08:17 +00:00  
				
					
						
							
							
								 
						
							
							
								01521299c7 
								
							
								 
							
						 
						
							
							
								
								Increase cache size limit  
							
							
							
						 
						
							2017-01-16 11:56:51 +00:00  
				
					
						
							
							
								 
						
							
							
								2fae34bd2c 
								
							
								 
							
						 
						
							
							
								
								Optionally measure size of cache by sum of length of values  
							
							
							
						 
						
							2017-01-13 17:46:17 +00:00  
				
					
						
							
							
								 
						
							
							
								8cfc0165e9 
								
							
								 
							
						 
						
							
							
								
								fix annoying typos  
							
							
							
						 
						
							2017-01-05 13:39:43 +00:00  
				
					
						
							
							
								 
						
							
							
								c3208e45c9 
								
							
								 
							
						 
						
							
							
								
								Fixup membership query  
							
							
							
						 
						
							2016-12-14 10:46:58 +00:00  
				
					
						
							
							
								 
						
							
							
								7ec2bf9b77 
								
							
								 
							
						 
						
							
							
								
								Fix background update that prematurely stopped  
							
							
							
						 
						
							2016-12-12 16:54:58 +00:00