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

c/log_eviction_stm: do not request snapshot if already progressed #15945

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Jan 4, 2024

It is perfectly possible that the install snapshot request will reach the follower right before the log_eviction_stm asks for the snapshot creation. In this case an stm_manager would do the check and throw an exception informing that the snapshot can not be taken. In order to handle the situation gracefully added a check in log eviction stm to skip taking snapshot if start offset already progressed.

Fixes: #14220

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x
  • v23.1.x

Release Notes

  • none

It is perfectly possible that the install snapshot request will reach
the follower right before the `log_eviction_stm` asks for the snapshot
creation. In this case an `stm_manager` would do the check and throw an
exception informing that the snapshot can not be taken. In order to
handle the situation gracefully added a check in log eviction stm to
skip taking snapshot if start offset already progressed.

Fixes: redpanda-data#14220

Signed-off-by: Michal Maslanka <michal@redpanda.com>
@mmaslankaprv
Copy link
Member Author

known failure: #14139

@mmaslankaprv mmaslankaprv merged commit 57e7aca into redpanda-data:dev Jan 8, 2024
23 of 26 checks passed
@mmaslankaprv mmaslankaprv deleted the fix-14220 branch January 8, 2024 09:36
@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

@vbotbuildovich
Copy link
Collaborator

Failed to create a backport PR to v23.3.x branch. I tried:

git remote add upstream https://github.com/redpanda-data/redpanda.git
git fetch --all
git checkout -b backport-pr-15945-v23.3.x-442 remotes/upstream/v23.3.x
git cherry-pick -x 443385160cbcc1e112e0d4ea64fd6c8c94827538

Workflow run logs.

@@ -184,13 +184,24 @@ log_eviction_stm::do_write_raft_snapshot(model::offset truncation_point) {
max_collectible_offset,
truncation_point);
}
if (truncation_point <= _raft->last_snapshot_index()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants