]> 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>
Thu, 9 Mar 2023 13:17:40 +0000 (13:17 +0000)
commit8d35cb4638975b05f993ceeb0a2d6917a00fb227
tree50a09d3fc1963b1dec46a534b05c2d559531fa3b
parent994292556ddf22d1687a382f16fa54fa54a46483
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>
(cherry picked from commit c6e4c174cb9d906537d78ff3980930439ace86da)

*****
Note: The following commit has been squashed to comply with Q:
*****
mon/OSDMonitor: Replace set::contains with set::count

std::set::contains is available since C++20 and is replaced by
std::set::count instead (unlike the original commit).

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