This has the following effects:
- Don't wrap the schema in a transaction
- `CREATE VIRTUAL TABLE` for full text search, which means we don't have
to do `PRAGMA writable_scshema=...`
- Don't insert initial values for stream positions and similarly locked
things
Both of these seem to better match the sqlite full schema dump we have
in the source tree.
Also use `--indent` to produce something that's more human readable.
```
$ diff dump/sqlite-{dump,schema}-sorted
6,7d5
< BEGIN TRANSACTION;
< COMMIT;
287a286,287
> CREATE VIRTUAL TABLE event_search USING fts4 ( event_id, room_id, sender, key, value )
> CREATE VIRTUAL TABLE user_directory_search USING fts4 ( user_id, value )
289a290
> /* event_search(event_id,room_id,sender,"key",value) */;
291,300d291
< INSERT INTO appservice_stream_position VALUES('X',0);
< INSERT INTO event_push_summary_last_receipt_stream_id VALUES('X',0);
< INSERT INTO event_push_summary_stream_ordering VALUES('X',0);
< INSERT INTO federation_stream_position VALUES('events',-1,'master');
< INSERT INTO federation_stream_position VALUES('federation',-1,'master');
< INSERT INTO schema_compat_version VALUES('X',72);
< INSERT INTO sqlite_schema(type,name,tbl_name,rootpage,sql)VALUES('table','event_search','event_search',0,'CREATE VIRTUAL TABLE event_search USING fts4 ( event_id, room_id, sender, key, value )');
< INSERT INTO sqlite_schema(type,name,tbl_name,rootpage,sql)VALUES('table','user_directory_search','user_directory_search',0,'CREATE VIRTUAL TABLE user_directory_search USING fts4 ( user_id, value )');
< INSERT INTO stats_incremental_position VALUES('X',1);
< INSERT INTO user_directory_stream_pos VALUES('X',1);
302,304d292
< PRAGMA foreign_keys=OFF;
< PRAGMA writable_schema=OFF;
< PRAGMA writable_schema=ON;
307a296
> /* user_directory_search(user_id,value) */;
```
This avoids doing work that will never be used (since the
resulting unread counts will never be sent in a /sync
response).
The negative of doing this is that unread counts will be
incorrect when the feature is initially enabled.
* Add monthly active users documentation
* changelog
* Tidy up notes
* more tidyup
* Rewrite #1
* link back to mau docs
* fix links
* s/appservice|AS/application service
* further review
* a newline
* Remove bit about shadow banned users.
I think talking about them is confusing, and the current text doesn't imply they get any special treatment.
* Update docs/usage/administration/monthly_active_users.md
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Update docs/usage/administration/monthly_active_users.md
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
The method doesn't actually do any data fetching and the method that
does, `_get_joined_profile_from_event_id`, has its own cache.
Signed off by Nick @ Beeper (@Fizzadar).
The --force flag of dpkg-statoverride has been deprecated (apparently starting
with the dpkg version in Debian buster). It offers --force-all as q quick fix,
but the usage in the Debian postinst script is probably covered by
--force-statoverride-add.
Fixes: #8391
Signed-off-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
We incorrectly didn't use the returned `Responder` if the client had
disconnected, which meant that the resource used by the Responder
wasn't correctly released.
In particular, this exhausted the thread pools so that *all* requests
timed out.
Media downloaded as part of a URL preview is normally deleted after two days.
However, while a background database migration is running, the process is
stopped. A long-running database migration can therefore cause the media
store to fill up with old preview files.
This logic was added in #2697 to make sure that we didn't try to run the expiry
without an index on `local_media_repository.created_ts`; the original logic that
needs that index was added in #2478 (in `get_url_cache_media_before`, as
amended by 93247a424a), and is still present.
Given that the background update was added before Synapse v1.0.0, just drop
this check and assume the index exists.