}
{
- uint8_t target_v = 9; // if bumping this, be aware of stretch_mode target_v 10!
+ uint8_t target_v = 9; // if bumping this, be aware of range_blocklist 11
if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
target_v = 2;
} else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
if (change_stretch_mode) {
target_v = std::max((uint8_t)10, target_v);
}
+ if (!new_range_blocklist.empty() ||
+ !old_range_blocklist.empty()) {
+ target_v = std::max((uint8_t)11, target_v);
+ }
ENCODE_START(target_v, 1, bl); // extended, osd-only data
if (target_v < 7) {
encode_addrvec_map_as_addr(new_hb_back_up, bl, features);
encode(new_stretch_mode_bucket, bl);
encode(stretch_mode_enabled, bl);
}
+ if (target_v >= 11) {
+ encode(new_range_blocklist, bl, features);
+ encode(old_range_blocklist, bl, features);
+ }
ENCODE_FINISH(bl); // osd-only data
}
decode(new_stretch_mode_bucket, bl);
decode(stretch_mode_enabled, bl);
}
-
+ if (struct_v >= 11) {
+ decode(new_range_blocklist, bl);
+ decode(old_range_blocklist, bl);
+ }
DECODE_FINISH(bl); // osd-only data
}
for (const auto &blist : old_blocklist)
f->dump_stream("addr") << blist;
f->close_section();
+ f->open_array_section("new_range_blocklist");
+ for (const auto &blist : new_range_blocklist) {
+ stringstream ss;
+ ss << blist.first;
+ f->dump_stream(ss.str().c_str()) << blist.second;
+ }
+ f->close_section();
+ f->open_array_section("old_range_blocklist");
+ for (const auto &blist : old_range_blocklist)
+ f->dump_stream("addr") << blist;
+ f->close_section();
f->open_array_section("new_xinfo");
for (const auto &xinfo : new_xinfo) {
for (const auto &addr : inc.old_blocklist)
blocklist.erase(addr);
+ if (!inc.new_range_blocklist.empty()) {
+ range_blocklist.insert(inc.new_range_blocklist.begin(),
+ inc.new_range_blocklist.end());
+ new_blocklist_entries = true;
+ }
+ for (const auto &addr : inc.old_range_blocklist)
+ range_blocklist.erase(addr);
+
for (auto& i : inc.new_crush_node_flags) {
if (i.second) {
crush_node_flags[i.first] = i.second;
{
// NOTE: any new encoding dependencies must be reflected by
// SIGNIFICANT_FEATURES
- uint8_t target_v = 9; // when bumping this, be aware of stretch_mode target_v 10!
+ uint8_t target_v = 9; // when bumping this, be aware of range blocklist
if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
target_v = 1;
} else if (!HAVE_FEATURE(features, SERVER_MIMIC)) {
if (stretch_mode_enabled) {
target_v = std::max((uint8_t)10, target_v);
}
+ if (!range_blocklist.empty()) {
+ target_v = std::max((uint8_t)11, target_v);
+ }
ENCODE_START(target_v, 1, bl); // extended, osd-only data
if (target_v < 7) {
encode_addrvec_pvec_as_addr(osd_addrs->hb_back_addrs, bl, features);
encode(recovering_stretch_mode, bl);
encode(stretch_mode_bucket, bl);
}
+ if (target_v >= 11) {
+ ::encode(range_blocklist, bl, features);
+ }
ENCODE_FINISH(bl); // osd-only data
}
recovering_stretch_mode = 0;
stretch_mode_bucket = 0;
}
+ if (struct_v >= 11) {
+ decode(range_blocklist, bl);
+ }
DECODE_FINISH(bl); // osd-only data
}
f->dump_stream(ss.str().c_str()) << addr.second;
}
f->close_section();
+ f->open_object_section("range_blocklist");
+ for (const auto &addr : range_blocklist) {
+ stringstream ss;
+ ss << addr.first;
+ f->dump_stream(ss.str().c_str()) << addr.second;
+ }
+ f->close_section();
dump_erasure_code_profiles(erasure_code_profiles, f);
for (const auto &addr : blocklist)
out << "blocklist " << addr.first << " expires " << addr.second << "\n";
+ for (const auto &addr : range_blocklist)
+ out << "range blocklist " << addr.first << " expires " << addr.second << "\n";
}
class OSDTreePlainDumper : public CrushTreeDumper::Dumper<TextTable> {