Make sure the reg/unreg calls for putting ourselves in the scrub schedule
bracket any PG role changes, or that initial reg happens after the role
has been initialized.
Signed-off-by: Sage Weil <sage@inktank.com>
service.init_splits_between(pg->info.pgid, pg->get_osdmap(), osdmap);
- pg->reg_next_scrub();
-
// generate state for PG's current mapping
int primary, up_primary;
vector<int> acting, up;
int role = OSDMap::calc_pg_role(whoami, pg->acting);
pg->set_role(role);
+ pg->reg_next_scrub();
+
PG::RecoveryCtx rctx(0, 0, 0, 0, 0, 0);
pg->handle_loaded(&rctx);
vector<int> oldacting, oldup;
int oldrole = get_role();
+ unreg_next_scrub();
+
pg_shard_t old_acting_primary = get_primary();
pg_shard_t old_up_primary = up_primary;
bool was_old_primary = is_primary();
else
set_role(-1);
+ reg_next_scrub();
+
// did acting, up, primary|acker change?
if (!lastmap) {
dout(10) << " no lastmap" << dendl;