Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCORE-2141 RCORE-2142 Clean up a bunch of old encryption cruft #7698

Merged
merged 2 commits into from
Jun 6, 2024

Commits on Jun 6, 2024

  1. Clean up a bunch of old encryption cruft

    The global shared cache of encrypted file maps was originally required because
    we actually opened Realm files mulitple times in normal usage, so each of the
    open files had to know about each other to copy things around. #4839 made it so
    that in normal usage we only ever have one DB instance per file per process, so
    it became dead code. Multiprocess encryption made it unneccesary even when the
    one-DB-per-process rule is violated, as the multiprocess code path covers that.
    
    This eliminates our last reliance on file UniqueIDs, so it lets us get rid of
    hacks related to that.
    
    The encryption page reclaimer mostly never actually worked. It used a very
    conserative page reclaimation rule that meant that pages would never be
    reclaimed if there was a long-lived Transaction, even if it was frozen or kept
    refreshed. This is very common in practice, and when it doesn't happen the DB
    usually isn't kept open either, making it redundant.
    
    Encryption used to rely on handling BAD_EXEC signals (or mach exceptions)
    rather than explicit barriers, so it had to read and write in page-sized
    chunks. That's no longer the case, so we can eliminate a lot of complexity by
    always reading and writing in 4k blocks.
    tgoyne committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    9ce6637 View commit details
    Browse the repository at this point in the history
  2. Fix UB in Tokenizer

    tgoyne committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    7ab83e8 View commit details
    Browse the repository at this point in the history