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

[Backport stable/8.1] fix: take snapshot if nothing was exported since last snapshot #10625

Merged
merged 2 commits into from
Oct 7, 2022

Conversation

backport-action
Copy link
Collaborator

Description

Backport of #10611 to stable/8.1.

relates to #9761

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.

(cherry picked from commit 42ee7c6)
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.

(cherry picked from commit ef090ab)
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

Test Results

   934 files  ±    0     934 suites  ±0   1h 50m 1s ⏱️ - 16m 9s
7 547 tests +240  7 539 ✔️ +240  8 💤 ±0  0 ±0 
7 735 runs  +240  7 727 ✔️ +240  8 💤 ±0  0 ±0 

Results for commit 4b70c5c. ± Comparison against base commit 8b7ebd8.

@lenaschoenburg
Copy link
Member

bors r+

@zeebe-bors-camunda
Copy link
Contributor

👎 Rejected by too few approved reviews

Copy link
Member

@lenaschoenburg lenaschoenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 19c50e5 into stable/8.1 Oct 7, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the backport-10611-to-stable/8.1 branch October 7, 2022 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants