OPTION(osd_rollback_to_cluster_snap, OPT_STR, "")
OPTION(osd_default_notify_timeout, OPT_U32, 30) // default notify timeout in seconds
OPTION(osd_kill_backfill_at, OPT_INT, 0)
+
+// Bounds how infrequently a new map epoch will be persisted for a pg
+OPTION(osd_pg_epoch_persisted_max_stale, OPT_U32, 200)
+
OPTION(osd_min_pg_log_entries, OPT_U32, 1000) // number of entries to keep in the pg log when trimming it
OPTION(osd_max_pg_log_entries, OPT_U32, 10000) // max entries, say when degraded, before we trim
OPTION(osd_op_complaint_time, OPT_FLOAT, 30) // how many seconds old makes an op complaint-worthy
PG::PG(OSDService *o, OSDMapRef curmap,
const PGPool &_pool, pg_t p, const hobject_t& loid,
const hobject_t& ioid) :
- osd(o), osdmap_ref(curmap), pool(_pool),
+ osd(o), osdmap_ref(curmap), last_persisted_osdmap_ref(curmap), pool(_pool),
_lock("PG::_lock"),
ref(0), deleting(false), dirty_info(false), dirty_log(false),
info(p), coll(p), log_oid(loid), biginfo_oid(ioid),
void PG::write_info(ObjectStore::Transaction& t)
{
+ last_persisted_osdmap_ref = osdmap_ref;
// pg state
bufferlist infobl;
__u8 struct_v = 5;
dout(10) << "handle_activate_map " << dendl;
ActMap evt;
recovery_state.handle_event(evt, rctx);
- dirty_info = true;
+ if (osdmap_ref->get_epoch() - last_persisted_osdmap_ref->get_epoch() >
+ g_conf->osd_pg_epoch_persisted_max_stale) {
+ dout(20) << __func__ << ": Dirtying info: last_persisted is "
+ << last_persisted_osdmap_ref->get_epoch()
+ << " while current is " << osdmap_ref->get_epoch() << dendl;
+ dirty_info = true;
+ } else {
+ dout(20) << __func__ << ": Not dirtying info: last_persisted is "
+ << last_persisted_osdmap_ref->get_epoch()
+ << " while current is " << osdmap_ref->get_epoch() << dendl;
+ }
}
void PG::handle_loaded(RecoveryCtx *rctx)