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

Fix bug in account data replication stream. #7656

Merged
merged 4 commits into from
Jun 9, 2020

Commits on Jun 8, 2020

  1. Ensure account data stream IDs are unique.

    The account data stream is shared between three tables, and the maximum
    allocated ID was tracked in a dedicated table. Updating the max ID
    happened outside the transaction that allocated the ID, leading to a
    race where if the server was eg restarted then the same ID could be
    allocated but the max ID failed to be updated, leading it to be reused.
    
    The ID generators have support for tracking across multiple tables, so
    we may as well use that instead of a dedicated table.
    erikjohnston committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    4fdd484 View commit details
    Browse the repository at this point in the history
  2. Fix bug in account data replciation stream.

    If the same stream ID was used in both global and room account data then
    the getting udpates for the replication stream would fail due to
    `heapq.merge(..)` trying to compare a `str` with a `None`. (This is
    because you'd have two rows like `(534, '!room')` and `(534, None)` from
    the room and global account data tables).
    
    Fix is just to order by stream ID, since we don't rely on the ordering
    beyond that. The bug where stream IDs can be reused should be fixed now,
    so this case shouldn't happen going forward.
    
    Fixes #7617
    erikjohnston committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    d69c879 View commit details
    Browse the repository at this point in the history
  3. Newsfile

    erikjohnston committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    6afdbd5 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2020

  1. Configuration menu
    Copy the full SHA
    9d3a00e View commit details
    Browse the repository at this point in the history