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

db: add SharedLowerUserKeyPrefix and WriteSharedWithStrictObsolete op… #3624

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on May 15, 2024

  1. db: add SharedLowerUserKeyPrefix and WriteSharedWithStrictObsolete op…

    …tions
    
    SharedLowerUserKeyPrefix, if specified, is an additional lower bound on
    constraint on key prefixes that should be written to shared files. It
    applies only when CreateOnShared permits some shared file creation. It
    will be used by CockroachDB to exclude keys below TableDataMin from
    shared files, for both correctness (they can contain MERGEs for which
    the obsolete bit does not work) and performance reasons (low latency
    is more important and the data volume is tiny).
    
    WriteSharedWithStrictObsolete, when true, causes shared files to be
    written with WriterOptions.IsStrictObsolete set to true. This adds
    an extra measure of configuration protection to accidentally sharing
    files where the MERGE could become visible (we currently share such
    files, but file virtualization hides these MERGEs).
    
    The enforcement of SharedLowerUserKeyPrefix changes how
    PreferSharedStorage is computed during flushes and compactions. It
    will only be set if the next key to be written by compact.Runner
    permits writing to shared storage. compact.Runner optimizes this
    computation for when a compaction is fully within the shared or
    unshared bounds. Additionally compact.Runner uses the existing
    OutputSplitter to decide when a split should happen when transitioning
    from unshared to shared.
    
    While here, we do a tiny optimization in OutputSplitter to remove
    a key comparison on each iteration key.
    
    Fixes cockroachdb#2756
    sumeerbhola committed May 15, 2024
    Configuration menu
    Copy the full SHA
    38e36b2 View commit details
    Browse the repository at this point in the history