osd_skip_data_digest(cct->_conf, "osd_skip_data_digest"),
publish_lock{ceph::make_mutex("OSDService::publish_lock")},
pre_publish_lock{ceph::make_mutex("OSDService::pre_publish_lock")},
- max_oldest_map(0),
m_scrub_queue{cct, *this},
agent_valid_iterator(false),
agent_ops(0),
{
MOSDMap *m = new MOSDMap(monc->get_fsid(),
osdmap->get_encoding_features());
- m->oldest_map = max_oldest_map;
+ m->oldest_map = sblock.max_oldest_map;
m->newest_map = sblock.newest_map;
int max = cct->_conf->osd_map_message_max;
// we don't have the next map the target wants, so start with a
// full map.
bufferlist bl;
- dout(10) << __func__ << " oldest map " << max_oldest_map << " > since "
- << since << ", starting with full map" << dendl;
+ dout(10) << __func__ << " oldest map " << sblock.max_oldest_map
+ << " > since " << since << ", starting with full map"
+ << dendl;
since = m->oldest_map;
if (!get_map_bl(since, bl)) {
derr << __func__ << " missing full map " << since << dendl;
// just send latest full map
MOSDMap *m = new MOSDMap(monc->get_fsid(),
osdmap->get_encoding_features());
- m->oldest_map = max_oldest_map;
+ m->oldest_map = sblock.max_oldest_map;
m->newest_map = sblock.newest_map;
get_map_bl(to, m->maps[to]);
send_map(m, con);
// We need to persist the new compat_set before we
// do anything else
dout(5) << "Upgrading superblock adding: " << diff << dendl;
+
+ if (!superblock.max_oldest_map) {
+ superblock.max_oldest_map = superblock.oldest_map;
+ }
+
ObjectStore::Transaction t;
write_superblock(t);
r = store->queue_transaction(service.meta_ch, std::move(t));
service.init();
service.publish_map(osdmap);
service.publish_superblock(superblock);
- service.max_oldest_map = superblock.oldest_map;
for (auto& shard : shards) {
// put PGs in a temporary set because we may modify pg_slots
logger->inc(l_osd_mape, last - first + 1);
if (first <= superblock.newest_map)
logger->inc(l_osd_mape_dup, superblock.newest_map - first + 1);
- if (service.max_oldest_map < m->oldest_map) {
- service.max_oldest_map = m->oldest_map;
- ceph_assert(service.max_oldest_map >= superblock.oldest_map);
+
+ if (superblock.max_oldest_map < m->oldest_map) {
+ superblock.max_oldest_map = m->oldest_map;
+ dout(10) << " superblock max_oldest_map new epoch is: "
+ << superblock.max_oldest_map << dendl;
+ ceph_assert(superblock.max_oldest_map >= superblock.oldest_map);
}
// make sure there is something new, here, before we bother flushing
void OSDSuperblock::encode(ceph::buffer::list &bl) const
{
- ENCODE_START(9, 5, bl);
+ ENCODE_START(10, 5, bl);
encode(cluster_fsid, bl);
encode(whoami, bl);
encode(current_epoch, bl);
encode((uint32_t)0, bl); // map<int64_t,epoch_t> pool_last_epoch_marked_full
encode(purged_snaps_last, bl);
encode(last_purged_snaps_scrub, bl);
+ encode(max_oldest_map, bl);
ENCODE_FINISH(bl);
}
void OSDSuperblock::decode(ceph::buffer::list::const_iterator &bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(9, 5, 5, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(10, 5, 5, bl);
if (struct_v < 3) {
string magic;
decode(magic, bl);
} else {
purged_snaps_last = 0;
}
+ if (struct_v >= 10) {
+ decode(max_oldest_map, bl);
+ } else {
+ max_oldest_map = 0;
+ }
DECODE_FINISH(bl);
}
f->dump_int("last_epoch_mounted", mounted);
f->dump_unsigned("purged_snaps_last", purged_snaps_last);
f->dump_stream("last_purged_snaps_scrub") << last_purged_snaps_scrub;
+ f->dump_int("max_oldest_map", max_oldest_map);
}
void OSDSuperblock::generate_test_instances(list<OSDSuperblock*>& o)
epoch_t purged_snaps_last = 0;
utime_t last_purged_snaps_scrub;
+ epoch_t max_oldest_map = 0; // maximum oldest map we have.
+
void encode(ceph::buffer::list &bl) const;
void decode(ceph::buffer::list::const_iterator &bl);
void dump(ceph::Formatter *f) const;
<< " e" << sb.current_epoch
<< " [" << sb.oldest_map << "," << sb.newest_map << "]"
<< " lci=[" << sb.mounted << "," << sb.clean_thru << "]"
- << ")";
+ << " max oldest=" << sb.max_oldest_map << ")";
}