mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 12:45:03 -04:00
Reduce serialization errors in MultiWriterIdGen (#8456)
We call `_update_stream_positions_table_txn` a lot, which is an UPSERT that can conflict in `REPEATABLE READ` isolation level. Instead of doing a transaction consisting of a single query we may as well run it outside of a transaction.
This commit is contained in:
parent
52a50e8686
commit
ae5b2a72c0
7 changed files with 112 additions and 8 deletions
|
@ -56,6 +56,7 @@ class SQLBaseStoreTestCase(unittest.TestCase):
|
|||
engine = create_engine(sqlite_config)
|
||||
fake_engine = Mock(wraps=engine)
|
||||
fake_engine.can_native_upsert = False
|
||||
fake_engine.in_transaction.return_value = False
|
||||
|
||||
db = DatabasePool(Mock(), Mock(config=sqlite_config), fake_engine)
|
||||
db._db_pool = self.db_pool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue