From: Sage Weil Date: Thu, 30 Jan 2014 16:22:58 +0000 (-0800) Subject: ceph_psim: some futzing to test primary_affinity X-Git-Tag: v0.78~173^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c360c604aa806a43f9cae8cf9bfc122102de710e;p=ceph.git ceph_psim: some futzing to test primary_affinity - map to acting - count first position, primary Signed-off-by: Sage Weil --- diff --git a/src/tools/psim.cc b/src/tools/psim.cc index ecc176d2c81d..7f094b9b874e 100644 --- a/src/tools/psim.cc +++ b/src/tools/psim.cc @@ -21,15 +21,25 @@ int main(int argc, char **argv) OSDMap osdmap; osdmap.decode(bl); + //osdmap.set_primary_affinity(0, 0x8000); + //osdmap.set_primary_affinity(3, 0); + int n = osdmap.get_max_osd(); int count[n]; + int first_count[n]; + int primary_count[n]; for (int i=0; itype = pg_pool_t::TYPE_ERASURE; + int size[4]; for (int i=0; i<4; i++) size[i] = 0; @@ -48,7 +58,7 @@ int main(int argc, char **argv) pg_t pgid = pg_t(l.ol_pgid); //pgid.u.ps = f * 4 + b; int primary; - osdmap.pg_to_osds(pgid, &osds, &primary); + osdmap.pg_to_acting_osds(pgid, &osds, &primary); size[osds.size()]++; #if 0 if (0) { @@ -66,13 +76,20 @@ int main(int argc, char **argv) //cout << " rep " << i << " on " << osds[i] << std::endl; count[osds[i]]++; } + if (osds.size()) + first_count[osds[0]]++; + if (primary >= 0) + primary_count[primary]++; } } } uint64_t avg = 0; for (int i=0; i