When recovery finishes on primary or on a peer, primary trims pglog
on the peer osds, or peer informs primary to trim pglog. In both of
these cases, trim primary pglog as well as pglog on the peers.
Signed-off-by: Zhiqiang Wang <zhiqiang@xsky.com>
t.omap_setkeys(coll, pgmeta_oid, km);
}
-void PG::trim_peers()
+void PG::trim_log()
{
assert(is_primary());
calc_trim_to();
- dout(10) << "trim_peers " << pg_trim_to << dendl;
+ 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();
pg_trim_to),
get_osdmap()->get_epoch());
}
+
+ // trim primary as well
+ pg_log.trim(pg_trim_to, info);
+ dirty_info = true;
}
}
ObjectStore::Transaction &t,
bool transaction_applied = true);
bool check_log_for_corruption(ObjectStore *store);
- void trim_peers();
+ void trim_log();
std::string get_corrupt_pg_log_name() const;
static int read_info(