Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Remove option to skip locking of tables during emulated upserts #14469

Merged
merged 3 commits into from
Nov 28, 2022

Commits on Nov 16, 2022

  1. Remove option to skip locking of tables during emulated upserts

    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.
    
    Since #13760, Synapse has required SQLite >= 3.27.0, which has support
    for native upserts. This means that we now only perform emulated upserts
    while waiting for background updates to add unique indexes.
    
    Since emulated upserts are far less frequent now, 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>
    Sean Quah committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    52c054f View commit details
    Browse the repository at this point in the history
  2. Add newsfile

    Signed-off-by: Sean Quah <seanq@matrix.org>
    Sean Quah committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    2836401 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2022

  1. fixup: reword comment

    Sean Quah committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    7e5ae65 View commit details
    Browse the repository at this point in the history