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

crimson/os/seastore: set ExtentPlacementManager::allocated_to before rolling segments #43492

Merged
merged 1 commit into from Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/crimson/os/seastore/extent_placement_manager.cc
Expand Up @@ -69,9 +69,10 @@ SegmentedAllocator::Writer::finish_write(
SegmentedAllocator::Writer::write_iertr::future<>
SegmentedAllocator::Writer::_write(
Transaction& t,
ool_record_t& record,
const record_size_t& record_size)
ool_record_t& record)
{
record_size_t record_size = record.get_encoded_record_length();
allocated_to += record_size.mdlength + record_size.dlength;
bufferlist bl = record.encode(
record_size,
current_segment->segment->get_segment_id(),
Expand Down Expand Up @@ -165,9 +166,8 @@ SegmentedAllocator::Writer::write(
num_extents,
current_segment->segment->get_segment_id(),
allocated_to);
auto rsize = record.get_encoded_record_length();
return (num_extents ?
_write(t, record, rsize) :
_write(t, record) :
write_iertr::now()
).si_then([this]() mutable {
return roll_segment(false);
Expand All @@ -179,16 +179,14 @@ SegmentedAllocator::Writer::write(
add_extent_to_write(record, extent);
it = extents.erase(it);
}
record_size_t rsize = record.get_encoded_record_length();

DEBUGT(
"writing {} extents to segment {} at {}",
t,
record.get_num_extents(),
current_segment->segment->get_segment_id(),
allocated_to);
allocated_to += rsize.mdlength + rsize.dlength;
return _write(t, record, rsize);
return _write(t, record);
}
).si_then([]()
-> write_iertr::future<seastar::stop_iteration> {
Expand Down
3 changes: 1 addition & 2 deletions src/crimson/os/seastore/extent_placement_manager.h
Expand Up @@ -217,8 +217,7 @@ class SegmentedAllocator : public ExtentAllocator {

write_iertr::future<> _write(
Transaction& t,
ool_record_t& record,
const record_size_t& record_size);
ool_record_t& record);

using roll_segment_ertr = crimson::errorator<
crimson::ct_error::input_output_error>;
Expand Down