auto blp = bl.begin();
crush.reset(new CrushWrapper);
crush->decode(blp);
+ if (require_osd_release >= CEPH_RELEASE_LUMINOUS) {
+ // only increment if this is a luminous-encoded osdmap, lest
+ // the mon's crush_version diverge from what the osds or others
+ // are decoding and applying on their end. if we won't encode
+ // it in the canonical version, don't change it.
+ ++crush_version;
+ }
}
calc_num_osds();
ENCODE_START(8, 7, bl);
{
- uint8_t v = 5;
+ uint8_t v = 6;
if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
v = 3;
}
assert(pg_upmap.empty());
assert(pg_upmap_items.empty());
}
+ if (v >= 6) {
+ ::encode(crush_version, bl);
+ }
ENCODE_FINISH(bl); // client-usable data
}
* Since we made it past that hurdle, we can use our normal paths.
*/
{
- DECODE_START(5, bl); // client-usable data
+ DECODE_START(6, bl); // client-usable data
// base
::decode(fsid, bl);
::decode(epoch, bl);
pg_upmap.clear();
pg_upmap_items.clear();
}
+ if (struct_v >= 6) {
+ ::decode(crush_version, bl);
+ }
DECODE_FINISH(bl); // client-usable data
}
f->dump_stream("created") << get_created();
f->dump_stream("modified") << get_modified();
f->dump_string("flags", get_flag_string());
+ f->dump_unsigned("crush_version", get_crush_version());
f->dump_float("full_ratio", full_ratio);
f->dump_float("backfillfull_ratio", backfillfull_ratio);
f->dump_float("nearfull_ratio", nearfull_ratio);
<< "modified " << get_modified() << "\n";
out << "flags " << get_flag_string() << "\n";
+ out << "crush_version " << get_crush_version() << "\n";
out << "full_ratio " << full_ratio << "\n";
out << "backfillfull_ratio " << backfillfull_ratio << "\n";
out << "nearfull_ratio " << nearfull_ratio << "\n";
uint32_t get_crc() const { return crc; }
ceph::shared_ptr<CrushWrapper> crush; // hierarchical map
+private:
+ uint32_t crush_version = 1;
friend class OSDMonitor;
void set_epoch(epoch_t e);
+ uint32_t get_crush_version() const {
+ return crush_version;
+ }
+
/* stamps etc */
const utime_t& get_created() const { return created; }
const utime_t& get_modified() const { return modified; }