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

fix: take snapshot if nothing was exported since last snapshot #10611

Merged
merged 2 commits into from
Oct 6, 2022

Commits on Oct 5, 2022

  1. test: verify that snapshot can be taken when no log entry exists

    In cases where the log contains no entry at the snapshot position but a
    previous snapshot exists and taking a new snapshot is desirable because
    the processed position changed, verify that a new snapshot is taken that
    has the same term and index as the previous snapshot but a higher
    processed position.
    lenaschoenburg committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    42ee7c6 View commit details
    Browse the repository at this point in the history
  2. fix: take snapshot if nothing was exported since last snapshot

    When figuring out where to take the next snapshot, we determine the
    snapshot position as the minimum of processing and exporter positions.
    
    There was an edge case where a leader could process but no export.
    In that case it'd use the exporter position as snapshot position and try
    and find a log entry at that position.
    If the log starts with the exporter position, for example
    because the same broker previously received a snapshot and compacted the
    log, no entry could be found which led to a failed snapshot.
    
    We now try and use the latest snapshot's term and index if the log entry
    could not be found. This ensures that new snapshots can be taken even if
    nothing was exported since the last snapshot.
    lenaschoenburg committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    ef090ab View commit details
    Browse the repository at this point in the history