Trakc the oldest clean pg, and trim osdmaps that are older than that.
Signed-off-by: Sage Weil <sage@newdream.net>
if (do_propose ||
!pending_inc.new_pg_temp.empty()) // also propose if we adjusted pg_temp
propose_pending();
+
+ if (mon->pgmon()->paxos->is_readable() &&
+ mon->pgmon()->pg_map.creating_pgs.empty()) {
+ epoch_t floor = mon->pgmon()->pg_map.calc_min_last_epoch_clean();
+ dout(10) << " min_last_epoch_clean " << floor << dendl;
+ if (floor < paxos->get_version() - 10) {
+ epoch_t of = paxos->get_first_committed();
+ paxos->trim_to(floor);
+ while (of < floor) {
+ mon->store->erase_sn("osdmap_full", of);
+ of++;
+ }
+ }
+ }
}
osd_sum.sub(s);
}
+epoch_t PGMap::calc_min_last_epoch_clean() const
+{
+ if (pg_stat.empty())
+ return 0;
+ hash_map<pg_t,pg_stat_t>::const_iterator p = pg_stat.begin();
+ epoch_t min = p->second.last_epoch_clean;
+ for (++p; p != pg_stat.end(); ++p) {
+ if (p->second.last_epoch_clean < min)
+ min = p->second.last_epoch_clean;
+ }
+ return min;
+}
+
void PGMap::encode(bufferlist &bl)
{
__u8 v = 3;
if (ssr.str().length())
out << "; " << ssr.str();
}
+
void recovery_summary(ostream& out) const;
void print_summary(ostream& out) const;
+ epoch_t calc_min_last_epoch_clean() const;
};
inline ostream& operator<<(ostream& out, const PGMap& m) {
void stash_latest(version_t v, bufferlist& bl);
version_t get_latest(bufferlist& bl);
+ version_t get_first_committed() { return first_committed; }
+
void register_observer(entity_inst_t inst, version_t v);
void update_observers();
};