anonymousland-synapse/synapse/storage/databases/main
Sean Quah 882277008c
Fix background updates failing to add unique indexes on receipts (#14453)
As part of the database migration to support threaded receipts, there is
a possible window in between
`73/08thread_receipts_non_null.sql.postgres` removing the original
unique constraints on `receipts_linearized` and `receipts_graph` and the
`reeipts_linearized_unique_index` and `receipts_graph_unique_index`
background updates from `72/08thread_receipts.sql` completing where
the unique constraints on `receipts_linearized` and `receipts_graph` are
missing. Any emulated upserts on these tables must therefore be
performed with a lock held, otherwise duplicate rows can end up in the
tables when there are concurrent emulated upserts. Fix the missing lock.

Note that emulated upserts no longer happen by default on sqlite, since
the minimum supported version of sqlite supports native upserts by
default now.

Finally, clean up any duplicate receipts that may have crept in before
trying to create the `receipts_graph_unique_index` and
`receipts_linearized_unique_index` unique indexes.

Signed-off-by: Sean Quah <seanq@matrix.org>
2022-11-16 15:01:22 +00:00
..
__init__.py Merge/remove Slaved* stores into WorkerStores (#14375) 2022-11-11 10:51:49 +00:00
account_data.py Revert "Remove slaved id tracker (#14376)" (#14463) 2022-11-16 13:50:07 +00:00
appservice.py Check appservice user interest against the local users instead of all users (get_users_in_room mis-use) (#13958) 2022-10-27 18:29:23 +00:00
cache.py Invalidate rooms for user caches when receiving membership events (#14155) 2022-10-17 13:27:51 +01:00
censor_events.py
client_ips.py
deviceinbox.py
devices.py Revert "Remove slaved id tracker (#14376)" (#14463) 2022-11-16 13:50:07 +00:00
directory.py
e2e_room_keys.py
end_to_end_keys.py Prevent federation user keys query from returning device names if disallowed (#14304) 2022-10-28 18:06:02 +01:00
event_federation.py Stop getting missing prev_events after we already know their signature is invalid (#13816) 2022-10-15 00:36:49 -05:00
event_push_actions.py Update the thread_id right before use (in case the bg update hasn't finished) (#14222) 2022-10-18 14:55:41 +00:00
events_bg_updates.py Fix background update table-scanning events (#14374) 2022-11-07 14:28:00 +00:00
events_forward_extremities.py
events_worker.py Revert "Remove slaved id tracker (#14376)" (#14463) 2022-11-16 13:50:07 +00:00
events.py Clean-up events persistance code (#14411) 2022-11-14 08:13:11 -05:00
filtering.py Merge/remove Slaved* stores into WorkerStores (#14375) 2022-11-11 10:51:49 +00:00
keys.py
lock.py
media_repository.py
metrics.py
monthly_active_users.py
openid.py
presence.py
profile.py
purge_events.py
push_rule.py Revert "Remove slaved id tracker (#14376)" (#14463) 2022-11-16 13:50:07 +00:00
pusher.py Revert "Remove slaved id tracker (#14376)" (#14463) 2022-11-16 13:50:07 +00:00
receipts.py Fix background updates failing to add unique indexes on receipts (#14453) 2022-11-16 15:01:22 +00:00
registration.py Support OIDC backchannel logouts (#11414) 2022-10-31 13:07:30 -04:00
rejections.py
relations.py Implement MSC3912: Relation-based redactions (#14260) 2022-11-03 16:21:31 +00:00
room_batch.py
room.py When restarting a partial join resync, prioritise the server which actioned a partial join (#14126) 2022-10-18 12:33:18 +01:00
roommember.py Include heroes in partial join responses' state (#14442) 2022-11-15 17:35:19 +00:00
search.py Drop support for Postgres 10 in full text search code. (#14397) 2022-11-09 09:55:34 -05:00
session.py
signatures.py
state_deltas.py
state.py
stats.py
stream.py Merge/remove Slaved* stores into WorkerStores (#14375) 2022-11-11 10:51:49 +00:00
tags.py
transactions.py
ui_auth.py
user_directory.py
user_erasure_store.py