Skip to content

Commit

Permalink
cloud_storage: don't capture reference to btree element
Browse files Browse the repository at this point in the history
Reference to the absl::btree_map is not stable, so don't use a reference
that was captured before the scheduling point.
  • Loading branch information
Elena Anyusheva committed Aug 1, 2022
1 parent b6ca1cf commit 2252c1c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/v/cloud_storage/remote_partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -517,15 +517,14 @@ remote_partition::aborted_transactions(offset_range offsets) {
if (it->first > offsets.end) {
break;
}
auto& st = it->second;
auto tx = co_await ss::visit(
st,
[this, &st, offsets, offset_key = it->first](
it->second,
[this, offsets, offset_key = it->first](
offloaded_segment_state& off_state) {
auto tmp = off_state->materialize(*this, offset_key);
auto res = tmp->segment->aborted_transactions(
offsets.begin_rp, offsets.end_rp);
st = std::move(tmp);
_segments[offset_key] = std::move(tmp);
return res;
},
[offsets](materialized_segment_ptr& m_state) {
Expand Down

0 comments on commit 2252c1c

Please sign in to comment.