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

Fix background updates failing to add unique indexes on receipts #14453

Merged
merged 7 commits into from
Nov 16, 2022

Commits on Nov 15, 2022

  1. Fix broken upserts to receipts_linearized and receipts_graph

    As part of the database migration to support threaded receipts, there is
    a possible window in between
    `73/08thread_receipts_non_null.sql.postgres` removing the original
    unique constraints on `receipts_linearized` and `receipts_graph` and the
    `reeipts_linearized_unique_index` and `receipts_graph_unique_index`
    background updates from `72/08thread_receipts.sql` completing where
    the unique constraints on `receipts_linearized` and `receipts_graph` are
    missing. Any emulated upserts on these tables must therefore be
    performed with a lock held, otherwise duplicate rows can end up in the
    tables when there are concurrent emulated upserts.
    
    Note that emulated upserts no longer happen by default on sqlite, since
    the minimum supported version of sqlite supports native upserts by
    default now.
    
    Signed-off-by: Sean Quah <[email protected]>
    Sean Quah committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    b1d191d View commit details
    Browse the repository at this point in the history
  2. Clean up duplicate receipts when creating unique indexes

    Before creating the `receipts_graph_unique_index` and
    `receipts_linearized_unique_index` unique indexes, we have to clean up
    any duplicate receipts that may have crept in due to
    #14406.
    
    Signed-off-by: Sean Quah <[email protected]>
    Sean Quah committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    580a416 View commit details
    Browse the repository at this point in the history
  3. Add newsfile

    Signed-off-by: Sean Quah <[email protected]>
    Sean Quah committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    dfe9946 View commit details
    Browse the repository at this point in the history
  4. Merge remote-tracking branch 'origin/develop' into squah/fix_receipts…

    …_constraint_background_update
    Sean Quah committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    7bf42a9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e654f8c View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2022

  1. Merge remote-tracking branch 'origin/develop' into squah/fix_receipts…

    …_constraint_background_update
    Sean Quah committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    8cb1bcb View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'origin/develop' into squah/fix_receipts…

    …_constraint_background_update
    Sean Quah committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    6eb87c9 View commit details
    Browse the repository at this point in the history