From 6e46b1c0e50ad377d5db058e0452b0d956b3fad6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 23 Sep 2019 14:40:48 -0500 Subject: [PATCH] osd/OSDMap: health alert for non-power-of-two pg_num Fixes: https://tracker.ceph.com/issues/41647 Signed-off-by: Sage Weil --- PendingReleaseNotes | 10 ++++++++++ doc/rados/operations/health-checks.rst | 17 +++++++++++++++++ src/common/options.cc | 5 +++++ src/mon/OSDMonitor.cc | 2 +- src/osd/OSDMap.cc | 24 +++++++++++++++++++++++- src/osd/OSDMap.h | 2 +- src/tools/osdmaptool.cc | 2 +- 7 files changed, 58 insertions(+), 4 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index 41a8886cc63..0f305adadac 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -142,6 +142,16 @@ * New OSD daemon command dump_scrub_reservations which reveals the scrub reservations that are held for local (primary) and remote (replica) PGs. +* Ceph will now issue a health warning if a RADOS pool as a ``pg_num`` + value that is not a power of two. This can be fixed by adjusting + the pool to a nearby power of two:: + + ceph osd pool set pg_num + + Alternatively, the warning can be silenced with:: + + ceph config set global mon_warn_on_pool_pg_num_not_power_of_two false + * The ``pg_autoscale_mode`` is now set to ``on`` by default for newly created pools, which means that Ceph will automatically manage the number of PGs. To change this behavior, or to learn more about PG diff --git a/doc/rados/operations/health-checks.rst b/doc/rados/operations/health-checks.rst index 0068dc4a585..2536cd4f24d 100644 --- a/doc/rados/operations/health-checks.rst +++ b/doc/rados/operations/health-checks.rst @@ -740,6 +740,23 @@ The PG count for existing pools can be increased or new pools can be created. Please refer to :ref:`choosing-number-of-placement-groups` for more information. +POOL_PG_NUM_NOT_POWER_OF_TWO +____________________________ + +One or more pools has a ``pg_num`` value that is not a power of two. +Although this is not strictly incorrect, it does lead to a less +balanced distribution of data because some PGs have roughly twice as +much data as others. + +This is easily corrected by setting the ``pg_num`` value for the +affected pool(s) to a nearby power of two:: + + ceph osd pool set pg_num + +This health warning can be disabled with:: + + ceph config set global mon_warn_on_pool_pg_num_not_power_of_two false + POOL_TOO_FEW_PGS ________________ diff --git a/src/common/options.cc b/src/common/options.cc index 0ebbe4b3037..f60182b5fa5 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -1702,6 +1702,11 @@ std::vector