}
{
- uint8_t target_v = 7;
+ uint8_t target_v = 8;
if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
target_v = 2;
} else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
encode(new_require_min_compat_client, bl);
encode(new_require_osd_release, bl);
}
+ if (target_v >= 8) {
+ encode(new_crush_node_flags, bl);
+ }
ENCODE_FINISH(bl); // osd-only data
}
}
{
- DECODE_START(7, bl); // extended, osd-only data
+ DECODE_START(8, bl); // extended, osd-only data
decode(new_hb_back_up, bl);
decode(new_up_thru, bl);
decode(new_last_clean_interval, bl);
new_require_osd_release = -1;
}
}
+ if (struct_v >= 8) {
+ decode(new_crush_node_flags, bl);
+ }
DECODE_FINISH(bl); // osd-only data
}
f->close_section();
f->close_section();
}
+ f->open_array_section("new_crush_node_flags");
+ for (auto& i : new_crush_node_flags) {
+ f->open_object_section("node");
+ f->dump_int("id", i.first);
+ set<string> st;
+ calc_state_set(i.second, st);
+ for (auto& j : st) {
+ f->dump_string("flag", j);
+ }
+ f->close_section();
+ }
+ f->close_section();
f->close_section();
}
for (const auto &addr : inc.old_blacklist)
blacklist.erase(addr);
+ for (auto& i : inc.new_crush_node_flags) {
+ if (i.second) {
+ crush_node_flags[i.first] = i.second;
+ } else {
+ crush_node_flags.erase(i.first);
+ }
+ }
+
// cluster snapshot?
if (inc.cluster_snapshot.length()) {
cluster_snapshot = inc.cluster_snapshot;
{
// NOTE: any new encoding dependencies must be reflected by
// SIGNIFICANT_FEATURES
- uint8_t target_v = 7;
+ uint8_t target_v = 8;
if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
target_v = 1;
} else if (!HAVE_FEATURE(features, SERVER_MIMIC)) {
if (target_v >= 6) {
encode(removed_snaps_queue, bl);
}
+ if (target_v >= 8) {
+ encode(crush_node_flags, bl);
+ }
ENCODE_FINISH(bl); // osd-only data
}
}
{
- DECODE_START(7, bl); // extended, osd-only data
+ DECODE_START(8, bl); // extended, osd-only data
decode(osd_addrs->hb_back_addrs, bl);
decode(osd_info, bl);
decode(blacklist, bl);
if (struct_v >= 6) {
decode(removed_snaps_queue, bl);
}
+ if (struct_v >= 8) {
+ decode(crush_node_flags, bl);
+ } else {
+ crush_node_flags.clear();
+ }
DECODE_FINISH(bl); // osd-only data
}
f->close_section();
}
f->close_section();
+ f->open_object_section("crush_node_flags");
+ for (auto& i : crush_node_flags) {
+ string s = crush->item_exists(i.first) ? crush->get_item_name(i.first)
+ : stringify(i.first);
+ f->open_array_section(s.c_str());
+ set<string> st;
+ calc_state_set(i.second, st);
+ for (auto& j : st) {
+ f->dump_string("flag", j);
+ }
+ f->close_section();
+ }
+ f->close_section();
}
void OSDMap::generate_test_instances(list<OSDMap*>& o)
mempool::osdmap::map<int64_t, snap_interval_set_t> new_removed_snaps;
mempool::osdmap::map<int64_t, snap_interval_set_t> new_purged_snaps;
+ mempool::osdmap::map<int32_t,uint32_t> new_crush_node_flags;
+
std::string cluster_snapshot;
float new_nearfull_ratio = -1;
int32_t max_osd;
std::vector<uint32_t> osd_state;
+ mempool::osdmap::map<int32_t,uint32_t> crush_node_flags; // crush node -> CEPH_OSD_* flags
+
utime_t last_up_change, last_in_change;
// These features affect OSDMap[::Incremental] encoding, or the