Commit graph

412 commits

Author SHA1 Message Date
Neil Alexander 1464403215
Merge branch 'main' into neilalexander/jassuko 2022-09-16 10:48:21 +01:00
Neil Alexander fc1d8e479b
Ensure that all state event IDs are included in the added section when rewriting state (#2725)
This should hopefully fix an entire class of problems where components
downstream from the roomserver (i.e. the sync API) could just lose a
whole bunch of state after a rewrite operation like a federated join.

The root of the bug is that we set `RewritesState` in the output event
which instructs downstream components to purge their copy of any room
state, but then didn't send the entire state snapshot in
`adds_state_event_ids` so the downstream state ends up being incomplete
as a result.
2022-09-16 10:35:32 +01:00
Neil Alexander ec49e0919c
Merge branch 'neilalexander/downloadstate' into neilalexander/jassuko 2022-09-14 11:59:48 +01:00
Neil Alexander e87f576303
Send the glue event 2022-09-14 11:23:21 +01:00
Neil Alexander 07df8fdd42
Add an empty body 2022-09-14 11:22:00 +01:00
Neil Alexander d4cdab0a44
Admin API to redownload room state from another server 2022-09-14 11:18:50 +01:00
Neil Alexander 7f89fed1e4
Revert 482914aef4 2022-09-14 09:55:50 +01:00
Neil Alexander 482914aef4
Use AckNone on the ephemeral room input consumer 2022-09-13 15:25:02 +01:00
Neil Alexander b05e028f7d
Tweak LoadMembershipAtEvent behaviour when state not known (#2716)
Previously `LoadMembershipAtEvent` would fail if the state before one of
the events was not known, i.e. because it was an outlier. This modifies
it so that it gracefully handles not knowing the state and returns no
memberships instead, so that history visibility doesn't freak out and
kill `/sync` requests dead.
2022-09-13 12:52:09 +01:00
Neil Alexander 1728a95239
Merge branch 'neilalexander/loadmembershipatevent' into neilalexander/jassuko 2022-09-13 11:16:00 +01:00
Neil Alexander 1ca58ec9d1
Merge branch 'main' into neilalexander/purgeroom 2022-09-13 11:15:14 +01:00
Neil Alexander 7928138034
Exclude events we don't know state for 2022-09-13 11:10:57 +01:00
Neil Alexander c279229f6f
Tweak LoadMembershipAtEvent 2022-09-13 10:48:50 +01:00
Neil Alexander 3e55856254
Always resolve state in QueryStateAfterEvents 2022-09-13 09:37:38 +01:00
Till 100fa9b235
Check unique constraint errors when manually inserting migrations (#2712)
This should avoid unnecessary logging on startup if the migration (were
we need `InsertMigration`) was already executed.
This now checks for "unique constraint errors" for SQLite and Postgres
and fails the startup process if the migration couldn't be manually
inserted for some other reason.
2022-09-13 08:07:43 +02:00
Neil Alexander 31b71df1cd
Merge branch 'main' into neilalexander/purgeroom 2022-09-12 13:58:35 +01:00
Neil Alexander 2792d0490f
Fix missing signature check on the /get_missing_events response 2022-09-12 13:30:51 +01:00
Neil Alexander 47be521dd9
Merge branch 'main' into neilalexander/purgeroom 2022-09-11 20:42:32 +01:00
Neil Alexander c0e17bbe1b
Fix transactions around assigning NIDs 2022-09-09 13:30:09 +01:00
Till 8196b29657
Change detection of already executed migrations (#2665)
This changes the detection of already executed migrations for the
roomserver state block and keychange refactor. It now uses schema tables
provided by the database engine to check if the column was already
removed. We now also store the migration in the migrations table.

This should stop e.g. Postgres from logging errors like `ERROR: column
"event_nid" does not exist at character 8`.
2022-09-09 13:14:52 +01:00
Neil Alexander 31f4ae8997
Use a single context instead 2022-09-07 16:24:43 +01:00
Neil Alexander 5014b35bd7
Update state reset capture to Sentry 2022-09-07 16:23:22 +01:00
Neil Alexander 049ebda94c
Merge branch 'main' into neilalexander/purgeroom 2022-09-07 13:50:07 +01:00
Neil Alexander cd22ba22b0
Improve Sentry reporting 2022-09-05 17:25:11 +01:00
Neil Alexander ecee5f10f4
Tweak logging for detected state resets 2022-09-05 17:08:54 +01:00
Neil Alexander d1f87e63f1
Move SetLatestEvents call 2022-09-05 13:16:14 +01:00
Neil Alexander ef0dcf6bee
Use background context, don't fall through 2022-08-25 14:38:19 +01:00
Neil Alexander 11856a502e
Merge branch 'main' into neilalexander/purgeroom 2022-08-25 12:11:15 +01:00
Neil Alexander b7258dcc00
Let the roomserver work first 2022-08-25 12:11:00 +01:00
Neil Alexander c1d6e18152
Lock the room during a purge operation to prevent other input events from populating mid-operation 2022-08-25 12:09:34 +01:00
Neil Alexander 8ff3f1a7c9
Remove a couple unnecessary Sentry captures from backfill 2022-08-25 11:01:07 +01:00
Neil Alexander cd7fa34595
Tweak logging and Sentry reporting for roomserver input 2022-08-25 10:57:27 +01:00
Neil Alexander 295ba38937
Merge branch 'main' into neilalexander/purgeroom 2022-08-25 10:00:27 +01:00
Neil Alexander 16156b0b09
Fix 500s on /state, /state_ids when state not known (#2672)
This was due to bad error bubbling.
2022-08-25 09:51:36 +01:00
Neil Alexander 965f532bb0
Merge branch 'main' into neilalexander/purgeroom 2022-08-24 14:47:11 +01:00
Neil Alexander 522bd2999f
Allow un-rejecting events on reprocessing 2022-08-24 14:03:06 +01:00
Neil Alexander 14fea600bb
Detect types.MissingStateError in CheckServerAllowedToSeeEvent (#2667)
This will hopefully stop some 500 errors on `/event` where there is no state-before known.
2022-08-23 13:57:11 +01:00
Neil Alexander e31469682d
Send the output event first 2022-08-22 14:14:29 +01:00
Neil Alexander 4e4fc400a2
Consolidate purge statements as they need to be prepared after other tables are created 2022-08-22 13:48:09 +01:00
Neil Alexander cd81635cf4
Let us retry 2022-08-22 12:52:22 +01:00
Neil Alexander c45bf118a8
Send output event for purge 2022-08-22 12:27:17 +01:00
Neil Alexander 4c4de0dfc6
Purge the room entry too 2022-08-22 12:05:38 +01:00
Neil Alexander b56011514b
Fix a query 2022-08-22 12:01:23 +01:00
Neil Alexander 83c7984dba
Fix table name 2022-08-22 11:58:17 +01:00
Neil Alexander 6442aea104
Fix API trace 2022-08-22 11:57:00 +01:00
Neil Alexander 856fe9d62b
Try adding an endpoint for it 2022-08-22 11:55:22 +01:00
Neil Alexander c1dcd5b218
SQLite stubs 2022-08-22 11:49:46 +01:00
Neil Alexander d11c243599
More PostgreSQL purging 2022-08-22 11:46:44 +01:00
Neil Alexander 537f300edf
Some PostgreSQL purging 2022-08-22 11:26:18 +01:00
Neil Alexander 4ef780c076
Define output message 2022-08-22 10:38:19 +01:00