}
if (layout.current_index.layout.type == rgw::BucketIndexType::Normal) {
- layout.logs.push_back(log_layout_from_index(
- layout.current_index.gen,
- layout.current_index.layout.normal));
+ layout.logs.push_back(log_layout_from_index(0, layout.current_index));
}
}
l.logs.clear();
// initialize the log layout to match the current index layout
if (l.current_index.layout.type == BucketIndexType::Normal) {
- const auto gen = l.current_index.gen;
- const auto& index = l.current_index.layout.normal;
- l.logs.push_back(log_layout_from_index(gen, index));
+ l.logs.push_back(log_layout_from_index(0, l.current_index));
}
} else {
decode(l.logs, bl);
// return a log layout that shares its layout with the index
inline bucket_log_layout_generation log_layout_from_index(
- uint64_t gen, const bucket_index_normal_layout& index)
+ uint64_t gen, const bucket_index_layout_generation& index)
{
- return {gen, {BucketLogType::InIndex, {gen, index}}};
+ return {gen, {BucketLogType::InIndex, {index.gen, index.layout.normal}}};
}
inline auto matches_gen(uint64_t gen)
if (layout.logs.empty() &&
layout.current_index.layout.type == rgw::BucketIndexType::Normal) {
- layout.logs.push_back(rgw::log_layout_from_index(0, layout.current_index.layout.normal));
+ layout.logs.push_back(rgw::log_layout_from_index(0, layout.current_index));
}
DECODE_FINISH(bl);
}
l.current_index.layout.normal.num_shards = 11;
l.logs.push_back(log_layout_from_index(
l.current_index.gen,
- l.current_index.layout.normal));
+ l.current_index));
};
layout.current_index = std::move(*layout.target_index);
layout.target_index = std::nullopt;
layout.resharding = rgw::BucketReshardState::None;
+ // add the in-index log layout
+ const auto next_log_gen = layout.logs.back().gen + 1;
+ layout.logs.push_back(log_layout_from_index(next_log_gen, layout.current_index));
int ret = fault.check("commit_target_layout");
if (ret == 0) { // no fault injected, write the bucket instance metadata