summary refs log tree commit diff
path: root/synapse/storage/engines/sqlite.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-12-20 11:09:59 +0000
committerRichard van der Hoff <richard@matrix.org>2019-12-20 11:09:59 +0000
commit138708608bb15e7d21041d72cb4709c8d44d3ef8 (patch)
tree8223baafae411c2dbd54f812b7da670d11435912 /synapse/storage/engines/sqlite.py
parentMerge tag 'v1.7.1' (diff)
parent1.7.2 (diff)
downloadsynapse-138708608bb15e7d21041d72cb4709c8d44d3ef8.tar.xz
Merge tag 'v1.7.2'
Synapse 1.7.2 (2019-12-20)
==========================

This release fixes some regressions introduced in Synapse 1.7.0 and 1.7.1.

Bugfixes
--------

- Fix a regression introduced in Synapse 1.7.1 which caused errors when attempting to backfill rooms over federation. ([\#6576](https://github.com/matrix-org/synapse/issues/6576))
- Fix a bug introduced in Synapse 1.7.0 which caused an error on startup when upgrading from versions before 1.3.0. ([\#6578](https://github.com/matrix-org/synapse/issues/6578))
Diffstat (limited to 'synapse/storage/engines/sqlite.py')
-rw-r--r--synapse/storage/engines/sqlite.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/storage/engines/sqlite.py b/synapse/storage/engines/sqlite.py

index ddad17dc5a..cbc74cd302 100644 --- a/synapse/storage/engines/sqlite.py +++ b/synapse/storage/engines/sqlite.py
@@ -25,6 +25,9 @@ class Sqlite3Engine(object): def __init__(self, database_module, database_config): self.module = database_module + database = database_config.get("args", {}).get("database") + self._is_in_memory = database in (None, ":memory:",) + # The current max state_group, or None if we haven't looked # in the DB yet. self._current_state_group_id = None @@ -59,7 +62,12 @@ class Sqlite3Engine(object): return sql def on_new_connection(self, db_conn): - prepare_database(db_conn, self, config=None) + if self._is_in_memory: + # In memory databases need to be rebuilt each time. Ideally we'd + # reuse the same connection as we do when starting up, but that + # would involve using adbapi before we have started the reactor. + prepare_database(db_conn, self, config=None) + db_conn.create_function("rank", 1, _rank) def is_deadlock(self, error):