t.omap_setkeys(coll, pgmeta_oid, km);
}
+void PG::trim_log()
+{
+ assert(is_primary());
+ calc_trim_to();
+ dout(10) << __func__ << " to " << pg_trim_to << dendl;
+ if (pg_trim_to != eversion_t()) {
+ // inform peers to trim log
+ assert(!actingbackfill.empty());
+ for (set<pg_shard_t>::iterator i = actingbackfill.begin();
+ i != actingbackfill.end();
+ ++i) {
+ if (*i == pg_whoami) continue;
+ osd->send_message_osd_cluster(
+ i->osd,
+ new MOSDPGTrim(
+ get_osdmap()->get_epoch(),
+ spg_t(info.pgid.pgid, i->shard),
+ pg_trim_to),
+ get_osdmap()->get_epoch());
+ }
+
+ // trim primary as well
+ pg_log.trim(pg_trim_to, info);
+ dirty_info = true;
+ }
+}
+
void PG::add_log_entry(const pg_log_entry_t& e, bool applied)
{
// raise last_complete only if we were previously up to date
pg->publish_stats_to_osd();
}
+ // trim pglog on recovered
+ pg->trim_log();
+
// adjust acting set? (e.g. because backfill completed...)
bool history_les_bound = false;
if (pg->acting != pg->up && !pg->choose_acting(auth_log_shard,
ObjectStore::Transaction &t,
bool transaction_applied = true);
bool check_log_for_corruption(ObjectStore *store);
+ void trim_log();
std::string get_corrupt_pg_log_name() const;
static int read_info(