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

storage: mvccExportToWriter should always return buffered range keys #98289

Merged
merged 1 commit into from
Mar 9, 2023

Commits on Mar 9, 2023

  1. storage: mvccExportToWriter should return always buffered range keys

    In cockroachdb#96691, we changed the return type of mvccExportToWriter such that
    it now indicates when a CPU limit has been reached. As part of that
    change, when the CPU limit was reached, we would immedately `return`
    rather than `break`ing out of the loop. This introduced a bug, since
    the code after the loop that the `break` was taking us to is
    important. Namely, we may have previously buffered range keys that we
    need to write into our response still. By replacing the break with a
    return, these range keys were lost.
    
    The end-user impact of this is that a BACKUP that _ought_ to have
    included range keys (such as a backup of a table with a rolled back
    IMPORT) would not include those range keys and thus would end up
    resurecting deleted keys upon restore.
    
    This PR brings back the `break` and adds a test that covers exporting
    with range keys under CPU exhaustion.
    
    This bug only ever existed on master.
    
    Informs cockroachdb#97694
    
    Epic: none
    
    Release note: None
    stevendanna committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    74c8915 View commit details
    Browse the repository at this point in the history