if (!pg)
continue;
+ if (pg->old_peering_msg(m->get_epoch())) {
+ dout(10) << "ignoring old peering message " << *m << dendl;
+ pg->unlock();
+ continue;
+ }
+
PG::RecoveryCtx rctx(&query_map, &info_map, 0, &fin->contexts, t);
pg->handle_notify(from, *it, &rctx);
return;
}
+ if (pg->old_peering_msg(m->get_epoch())) {
+ dout(10) << "ignoring old peering message " << *m << dendl;
+ pg->unlock();
+ return;
+ }
+
map< int, map<pg_t,PG::Query> > query_map;
map< int, MOSDPGInfo* > info_map;
PG::RecoveryCtx rctx(&query_map, &info_map, 0, &fin->contexts, t);
PG::RecoveryCtx rctx(0, &info_map, 0, &fin->contexts, t);
if (!pg)
continue;
+
+ if (pg->old_peering_msg(m->get_epoch())) {
+ dout(10) << "ignoring old peering message " << *m << dendl;
+ pg->unlock();
+ continue;
+ }
+
pg->handle_info(from, *p, &rctx);
int tr = store->queue_transaction(&pg->osr, t, new ObjectStore::C_DeleteTransaction(t), fin);
continue;
}
+ if (pg->old_peering_msg(m->get_epoch())) {
+ dout(10) << "ignoring old peering message " << *m << dendl;
+ pg->unlock();
+ continue;
+ }
+
if (pg->deleting) {
/*
* We cancel deletion on pg change. And the primary will never
}
}
+bool PG::old_peering_msg(const epoch_t &msg_epoch)
+{
+ return (last_warm_restart > msg_epoch);
+}
+
/* Called before initializing peering during advance_map */
void PG::warm_restart(const OSDMap& lastmap, const vector<int>& newup, const vector<int>& newacting)
{
// -- there was a change! --
kick();
+ last_warm_restart = osdmap.get_epoch();
+
vector<int> oldacting, oldup;
int oldrole = get_role();
int oldprimary = get_primary();
}
-/*----RecoverState Methods-----*/
+/*----RecoveryState Methods-----*/
#undef dout_prefix
#define dout_prefix *_dout << machine.pg->gen_prefix()
// primary-only, recovery-only state
set<int> might_have_unfound; // These osds might have objects on them
// which are unfound on the primary
+
+ epoch_t last_warm_restart;
+
friend class OSD;
have_master_log(true),
recovery_state(this),
need_up_thru(false),
+ last_warm_restart(0),
pg_stats_lock("PG::pg_stats_lock"),
pg_stats_valid(false),
finish_sync_event(NULL),
pair<int, Info> ¬ify_info);
void fulfill_log(int from, const Query &query);
bool acting_up_affected(const vector<int>& newup, const vector<int>& newacting);
-
+ bool old_peering_msg(const epoch_t &msg_epoch);
+
// recovery bits
void handle_notify(int from, PG::Info& i, RecoveryCtx *rctx) {
recovery_state.handle_notify(from, i, rctx);