*acting_primary = _acting_primary;
}
-int OSDMap::calc_pg_role(int osd, const vector<int>& acting, int nrep)
+int OSDMap::calc_pg_role_broken(int osd, const vector<int>& acting, int nrep)
{
+ // This implementation is broken for EC PGs since the osd may appear
+ // multiple times in the acting set. See
+ // https://tracker.ceph.com/issues/43213
if (!nrep)
nrep = acting.size();
for (int i=0; i<nrep; i++)
return -1;
}
-bool OSDMap::primary_changed(
+bool OSDMap::primary_changed_broken(
int oldprimary,
const vector<int> &oldacting,
int newprimary,
return true; // was empty, now not, or vice versa
if (oldprimary != newprimary)
return true; // primary changed
- if (calc_pg_role(oldprimary, oldacting) !=
- calc_pg_role(newprimary, newacting))
+ if (calc_pg_role_broken(oldprimary, oldacting) !=
+ calc_pg_role_broken(newprimary, newacting))
return true;
return false; // same primary (tho replicas may have changed)
}
}
- static int calc_pg_role(int osd, const std::vector<int>& acting, int nrep=0);
+ static int calc_pg_role_broken(int osd, const std::vector<int>& acting, int nrep=0);
static int calc_pg_role(pg_shard_t who, const std::vector<int>& acting);
- static bool primary_changed(
+ static bool primary_changed_broken(
int oldprimary,
const std::vector<int> &oldacting,
int newprimary,