]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/OSDMointor: Simplify check_pg_num()
authorMatan Breizman <mbreizma@redhat.com>
Mon, 19 Dec 2022 09:58:06 +0000 (09:58 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 20 Dec 2022 13:57:22 +0000 (13:57 +0000)
commitc6e4c174cb9d906537d78ff3980930439ace86da
treecd8506498dd4fcf21540c2042cceb78dd6c59321
parentf8b969785c87c421f2710ef76ed270c7d462563d
mon/OSDMointor: Simplify check_pg_num()

* See: https://tracker.ceph.com/issues/47062.
  Originally check_pg_num did not take into account the root
  osds by the crash rule.
  This behavior resulted in an inaccurate pg num per osd count.

* Avoid summing all of the projecetd pg num and only later
  on subtracting the pg num if the pool did exist.

* With this change, we only count the projected pg num which
  are part the pools affected by the crush rule.
  Same for osd number, instead of dividing the projected
  pg number by all of the osdmap osds, divide only by
  the osds used by the crush rule.

* Avoid differentiating between whether the mapping epoch
  is later than the osdmap epoch or not. Always check the pg
  num according to crush rule.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h