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

raft/tests: fix use-after-move when replication is retried #23018

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

bharathv
Copy link
Contributor

@bharathv bharathv commented Aug 22, 2024

Fixes #23012

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
  • v24.2.x
  • v24.1.x
  • v23.3.x

Release Notes

  • none

@vbotbuildovich
Copy link
Collaborator

@mmaslankaprv mmaslankaprv merged commit 435ae65 into redpanda-data:dev Aug 23, 2024
19 checks passed
Comment on lines 168 to +171
[b = std::move(builder).build()](
raft_node_instance& leader_node) mutable {
return leader_node.raft()->replicate(
model::make_memory_record_batch_reader(std::move(b)),
model::make_memory_record_batch_reader(b.share()),
Copy link
Member

Choose a reason for hiding this comment

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

@bharathv why was this a use-after-move? from what i can tell, the std::move was the last reference to b

Copy link
Member

Choose a reason for hiding this comment

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

oh i see the retry will invoke the lambda more than once

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