}
{
- uint8_t target_v = 9; // if bumping this, be aware of range_blocklist 11
+ uint8_t target_v = 9; // if bumping this, be aware of allow_crimson 12
if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
target_v = 2;
} else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
!old_range_blocklist.empty()) {
target_v = std::max((uint8_t)11, target_v);
}
+ if (mutate_allow_crimson != mutate_allow_crimson_t::NONE) {
+ target_v = std::max((uint8_t)12, 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_range_blocklist, bl, features);
encode(old_range_blocklist, bl, features);
}
+ if (target_v >= 12) {
+ encode(mutate_allow_crimson, bl);
+ }
ENCODE_FINISH(bl); // osd-only data
}
decode(new_range_blocklist, bl);
decode(old_range_blocklist, bl);
}
+ if (struct_v >= 12) {
+ decode(mutate_allow_crimson, bl);
+ }
DECODE_FINISH(bl); // osd-only data
}
f->dump_float("new_backfillfull_ratio", new_backfillfull_ratio);
f->dump_int("new_require_min_compat_client", to_integer<int>(new_require_min_compat_client));
f->dump_int("new_require_osd_release", to_integer<int>(new_require_osd_release));
+ f->dump_unsigned("mutate_allow_crimson", static_cast<unsigned>(mutate_allow_crimson));
if (fullmap.length()) {
f->open_object_section("full_map");
stretch_mode_bucket = inc.new_stretch_mode_bucket;
}
+ switch (inc.mutate_allow_crimson) {
+ case Incremental::mutate_allow_crimson_t::NONE:
+ break;
+ case Incremental::mutate_allow_crimson_t::SET:
+ allow_crimson = true;
+ break;
+ case Incremental::mutate_allow_crimson_t::CLEAR:
+ allow_crimson = false;
+ break;
+ }
+
calc_num_osds();
_calc_up_osd_features();
return 0;
{
// NOTE: any new encoding dependencies must be reflected by
// SIGNIFICANT_FEATURES
- uint8_t target_v = 9; // when bumping this, be aware of range blocklist
+ uint8_t target_v = 9; // when bumping this, be aware of allow_crimson
if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
target_v = 1;
} else if (!HAVE_FEATURE(features, SERVER_MIMIC)) {
if (!range_blocklist.empty()) {
target_v = std::max((uint8_t)11, target_v);
}
+ if (allow_crimson) {
+ target_v = std::max((uint8_t)12, 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);
if (target_v >= 11) {
::encode(range_blocklist, bl, features);
}
+ if (target_v >= 12) {
+ ::encode(allow_crimson, bl);
+ }
ENCODE_FINISH(bl); // osd-only data
}
calculated_ranges.emplace(i.first, i.first);
}
}
+ if (struct_v >= 12) {
+ decode(allow_crimson, bl);
+ }
DECODE_FINISH(bl); // osd-only data
}
f->dump_string("require_osd_release",
to_string(require_osd_release));
+ f->dump_bool("allow_crimson", allow_crimson);
f->open_array_section("pools");
for (const auto &pool : pools) {
std::string name("<unknown>");
}
if (get_cluster_snapshot().length())
out << "cluster_snapshot " << get_cluster_snapshot() << "\n";
+ if (allow_crimson) {
+ out << "allow_crimson=true\n";
+ }
out << "\n";
print_pools(out);
bool stretch_mode_enabled{false};
bool change_stretch_mode{false};
+ enum class mutate_allow_crimson_t : uint8_t {
+ NONE = 0,
+ SET = 1,
+ // Monitor won't allow CLEAR to be set currently, but we may allow it later
+ CLEAR = 2
+ } mutate_allow_crimson = mutate_allow_crimson_t::NONE;
+
// full (rare)
ceph::buffer::list fullmap; // in lieu of below.
ceph::buffer::list crush;
}
return p->second.contains(snap);
}
+
+ void set_allow_crimson() { mutate_allow_crimson = mutate_allow_crimson_t::SET; }
};
private:
uint32_t degraded_stretch_mode; // 0 if not degraded; else count of up sites
uint32_t recovering_stretch_mode; // 0 if not recovering; else 1
int32_t stretch_mode_bucket; // the bucket type we're stretched across
+ bool allow_crimson{false};
private:
uint32_t crush_version = 1;
return erasure_code_profiles;
}
+ bool get_allow_crimson() const {
+ return allow_crimson;
+ }
+
bool exists(int osd) const {
//assert(osd >= 0);
return osd >= 0 && osd < max_osd && (osd_state[osd] & CEPH_OSD_EXISTS);