Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: crush: backport recent upmap fixes #27963

merged 6 commits into from May 9, 2019
Commits on May 5, 2019
  1. osd/OSDMap: more improvements to upmap

    xiexingguo committed Jan 26, 2019
    - add ability of appending a 2nd, 3rd, etc... pair to existing upmaps
      when possible, rather than just continuing to the next PG
    - handle the underfull case: we can rm-pg-upmap-items if there exist
      any upmaps which remapped a PG out from an underfull OSD
    Signed-off-by: xie xingguo <>
    (cherry picked from commit a7d2adf)
    	- various option changes since luminous
    	- s/assert/ceph_assert/
            - s/conf./conf->/
  2. osd/OSDMap: using std::vector::reserve to reduce memory reallocation

    xiexingguo committed Feb 18, 2019
    In C++ vectors are dynamic arrays.
    Vectors are assigned memory in blocks of contiguous locations.
    When the memory allocated for the vector falls short of storing
    new elements, a new memory block is allocated to vector and all
    elements are copied from the old location to the new location.
    This reallocation of elements helps vectors to grow when required.
    However, it is a costly operation and time complexity is involved
    in this step is linear.
    Try to use std::vector::reserve whenever possible if performance
    Signed-off-by: xie xingguo <>
    (cherry picked from commit 4a0eabb)
  3. crush: fix upmap overkill

    xiexingguo committed Jan 19, 2019
    It appears that OSDMap::maybe_remove_pg_upmaps's sanity checks
    are overzealous. With some customized crush rules it is possible
    for osdmaptool to generate valid upmaps, but maybe_remove_pg_upmaps
    will cancel them.
    Signed-off-by: xie xingguo <>
    (cherry picked from commit 5c4d241)
    	- maybe_remove_pg_upmaps input changing
            - slight c++11 auto conflicts
  4. osd/OSDMap: drop local pool filter in calc_pg_upmaps

    xiexingguo committed Feb 23, 2019
    The local pre-loaded pool filter is completely redundant since
    the below check:
    	if (!only_pools.empty() && !only_pools.count(i.first))
    could reliably catch both cases - either optimization should be
    restricted to specific pools feeded, or all existing pools.
    Let's clean it up.
    Signed-off-by: xie xingguo <>
    (cherry picked from commit 3e6bad9)
  5. osd/OSDMap: calc_pg_upmaps - restrict optimization to origin pools only

    xiexingguo committed Mar 23, 2019
    The current implementation will try to cancel any pg_upmaps that
    would otherwise re-map a PG out from an underfull osd, which is wrong,
    e.g., because it could reliably fire the following assert:
    src/osd/ 4405: FAILED assert(osd_weight.count(i.first))
    Also it would not match the expectation if automatic balancing
    has been strictly restricted to some specific pools by admin.
    Fix by excluding any wild PG that does not belong to the origin pools
    passed in when trying to do upmap/unmap.
    Signed-off-by: xie xingguo <>
    (cherry picked from commit 01e8e94)
  6. osd/OSDMap: add log for better debugging

    xiexingguo committed Mar 25, 2019
    Signed-off-by: xie xingguo <>
    (cherry picked from commit a89281f)
You can’t perform that action at this time.