mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-22 17:46:08 +03:00
f792dd74e1
To perform an emulated upsert into a table safely, we must either: * lock the table, * be the only writer upserting into the table * or rely on another unique index being present. When the 2nd or 3rd cases were applicable, we previously avoided locking the table as an optimization. However, as seen in #14406, it is easy to slip up when adding new schema deltas and corrupt the database. The only time we lock when performing emulated upserts is while waiting for background updates on postgres. On sqlite, we do no locking at all. Let's remove the option to skip locking tables, so that we don't shoot ourselves in the foot again. Signed-off-by: Sean Quah <seanq@matrix.org>
1 line
110 B
Text
1 line
110 B
Text
Remove option to skip locking of tables when performing emulated upserts, to avoid a class of bugs in future.
|