}
}
-bool PG::should_restart_peering(
- int newupprimary,
- int newactingprimary,
- const vector<int>& newup,
- const vector<int>& newacting,
- OSDMapRef lastmap,
- OSDMapRef osdmap)
-{
- if (PastIntervals::is_new_interval(
- primary.osd,
- newactingprimary,
- acting,
- newacting,
- up_primary.osd,
- newupprimary,
- up,
- newup,
- osdmap.get(),
- lastmap.get(),
- info.pgid.pgid)) {
- dout(20) << "new interval newup " << newup
- << " newacting " << newacting << dendl;
- return true;
- }
- if (!lastmap->is_up(osd->whoami) && osdmap->is_up(osd->whoami)) {
- dout(10) << __func__ << " osd transitioned from down -> up" << dendl;
- return true;
- }
- return false;
-}
-
bool PG::old_peering_msg(epoch_t reply_epoch, epoch_t query_epoch)
{
if (last_peering_reset > reply_epoch ||
void fulfill_log(pg_shard_t from, const pg_query_t &query, epoch_t query_epoch);
void fulfill_query(const MQuery& q, PeeringCtx *rctx);
- bool should_restart_peering(
- int newupprimary,
- int newactingprimary,
- const vector<int>& newup,
- const vector<int>& newacting,
- OSDMapRef lastmap,
- OSDMapRef osdmap);
-
// OpRequest queueing
bool can_discard_op(OpRequestRef& op);
bool can_discard_scan(OpRequestRef op);
}
}
+bool PG::should_restart_peering(
+ int newupprimary,
+ int newactingprimary,
+ const vector<int>& newup,
+ const vector<int>& newacting,
+ OSDMapRef lastmap,
+ OSDMapRef osdmap)
+{
+ if (PastIntervals::is_new_interval(
+ primary.osd,
+ newactingprimary,
+ acting,
+ newacting,
+ up_primary.osd,
+ newupprimary,
+ up,
+ newup,
+ osdmap.get(),
+ lastmap.get(),
+ info.pgid.pgid)) {
+ dout(20) << "new interval newup " << newup
+ << " newacting " << newacting << dendl;
+ return true;
+ }
+ if (!lastmap->is_up(osd->whoami) && osdmap->is_up(osd->whoami)) {
+ dout(10) << __func__ << " osd transitioned from down -> up" << dendl;
+ return true;
+ }
+ return false;
+}
/*------------ Peering State Machine----------------*/
#undef dout_prefix
PG *pg = context< PeeringMachine >().pg;
psdout(10) << "Started advmap" << dendl;
ps->check_full_transition(advmap.lastmap, advmap.osdmap);
- if (pg->should_restart_peering(
+ if (ps->should_restart_peering(
advmap.up_primary,
advmap.acting_primary,
advmap.newup,
ps->check_full_transition(advmap.lastmap, advmap.osdmap);
- if (pg->should_restart_peering(
+ if (ps->should_restart_peering(
advmap.up_primary,
advmap.acting_primary,
advmap.newup,
boost::statechart::result PeeringState::Active::react(const AdvMap& advmap)
{
PG *pg = context< PeeringMachine >().pg;
- if (pg->should_restart_peering(
+ if (ps->should_restart_peering(
advmap.up_primary,
advmap.acting_primary,
advmap.newup,
void check_recovery_sources(const OSDMapRef& map);
void set_last_peering_reset();
void check_full_transition(OSDMapRef lastmap, OSDMapRef osdmap);
+ bool should_restart_peering(
+ int newupprimary,
+ int newactingprimary,
+ const vector<int>& newup,
+ const vector<int>& newacting,
+ OSDMapRef lastmap,
+ OSDMapRef osdmap);
+
public:
PeeringState(
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals));
ASSERT_TRUE(past_intervals.empty());
}
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals));
old_primary = new_primary;
}
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
osdmap,
lastmap,
pg_t(pg_num - 1, pool_id),
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
lastmap, // reverse order!
osdmap,
pg_t(pg_num - 1, pool_id),
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
osdmap,
lastmap,
pg_t(pg_num - 1, pool_id),
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
osdmap,
lastmap,
pg_t(pg_num / 2 - 1, pool_id),
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
lastmap, // reverse order!
osdmap,
pg_t(pg_num / 2 - 1, pool_id),
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
osdmap,
lastmap,
pg_t(pg_num / 2 - 1, pool_id),
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals));
}
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals,
&out));
ASSERT_NE(string::npos, out.str().find("acting set is too small"));
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals,
&out));
ASSERT_NE(string::npos, out.str().find("acting set is too small"));
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals,
&out));
ASSERT_NE(string::npos, out.str().find("includes interval"));
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals,
&out));
ASSERT_NE(string::npos, out.str().find("presumed to have been rw"));
osdmap,
lastmap,
pgid,
- recoverable.get(),
+ *recoverable,
&past_intervals,
&out));
ASSERT_NE(string::npos, out.str().find("does not include interval"));