cur_map,
last_map,
info.pgid.pool(),
+ info.pgid,
&past_intervals,
&debug);
if (new_interval) {
return crashed;
}
+bool PG::is_split(OSDMapRef lastmap, OSDMapRef nextmap)
+{
+ return info.pgid.is_split(
+ lastmap->get_pg_num(pool.id),
+ nextmap->get_pg_num(pool.id),
+ 0);
+}
bool PG::acting_up_affected(const vector<int>& newup, const vector<int>& newacting)
{
info.history.same_interval_since,
info.history.last_epoch_clean,
osdmap,
- lastmap, info.pgid.pool(), &past_intervals);
+ lastmap, info.pgid.pool(), info.pgid, &past_intervals);
if (new_interval) {
dout(10) << " noting past " << past_intervals.rbegin()->second << dendl;
dirty_info = true;
}
}
- if (oldacting != acting || oldup != up) {
+ if (oldacting != acting || oldup != up || is_split(lastmap, osdmap)) {
info.history.same_interval_since = osdmap->get_epoch();
}
if (oldup != up) {
{
dout(10) << "Started advmap" << dendl;
PG *pg = context< RecoveryMachine >().pg;
- if (pg->acting_up_affected(advmap.newup, advmap.newacting)) {
+ if (pg->acting_up_affected(advmap.newup, advmap.newacting) ||
+ pg->is_split(advmap.lastmap, advmap.osdmap)) {
dout(10) << "up or acting affected, transitioning to Reset" << dendl;
post_event(advmap);
return transit< Reset >();
pg->generate_past_intervals();
pg->remove_down_peer_info(advmap.osdmap);
- if (pg->acting_up_affected(advmap.newup, advmap.newacting)) {
+ if (pg->acting_up_affected(advmap.newup, advmap.newacting) ||
+ pg->is_split(advmap.lastmap, advmap.osdmap)) {
dout(10) << "up or acting affected, calling start_peering_interval again"
<< dendl;
pg->start_peering_interval(advmap.lastmap, advmap.newup, advmap.newacting);
void fulfill_info(int from, const pg_query_t &query,
pair<int, pg_info_t> ¬ify_info);
void fulfill_log(int from, const pg_query_t &query, epoch_t query_epoch);
+ bool is_split(OSDMapRef lastmap, OSDMapRef nextmap);
bool acting_up_affected(const vector<int>& newup, const vector<int>& newacting);
// OpRequest queueing
OSDMapRef osdmap,
OSDMapRef lastmap,
int64_t pool_id,
+ pg_t pgid,
map<epoch_t, pg_interval_t> *past_intervals,
std::ostream *out)
{
// remember past interval
if (new_acting != old_acting || new_up != old_up ||
(!(lastmap->get_pools().count(pool_id))) ||
- lastmap->get_pools().find(pool_id)->second.min_size !=
- osdmap->get_pools().find(pool_id)->second.min_size) {
+ (lastmap->get_pools().find(pool_id)->second.min_size !=
+ osdmap->get_pools().find(pool_id)->second.min_size) ||
+ pgid.is_split(lastmap->get_pg_num(pgid.pool()),
+ osdmap->get_pg_num(pgid.pool()), 0)) {
pg_interval_t& i = (*past_intervals)[same_interval_since];
i.first = same_interval_since;
i.last = osdmap->get_epoch() - 1;
std::tr1::shared_ptr<const OSDMap> osdmap, ///< [in] current map
std::tr1::shared_ptr<const OSDMap> lastmap, ///< [in] last map
int64_t poolid, ///< [in] pool for pg
+ pg_t pgid, ///< [in] pgid for pg
map<epoch_t, pg_interval_t> *past_intervals,///< [out] intervals
ostream *out = 0 ///< [out] debug ostream
);