From 6da921e873989f2cff2c337b002b392b1d546c11 Mon Sep 17 00:00:00 2001 From: Sridhar Seshasayee Date: Tue, 5 Nov 2019 16:10:14 +0530 Subject: [PATCH] osd/OSDMap: Show health warning if a pool is configured with size 1 Introduce a config option called 'mon_warn_on_pool_no_redundancy' that is used to show a health warning if any pool in the ceph cluster is configured with a size of 1. The user can mute/unmute the warning using 'ceph health mute/unmute POOL_NO_REDUNDANCY'. Add standalone test to verify warning on setting pool size=1. Set the associated warning to 'false' in ceph.conf.template under qa/tasks so that existing tests do not break. Fixes: https://tracker.ceph.com/issues/41666 Signed-off-by: Sridhar Seshasayee (cherry picked from commit 33c647e8114b37404d8d62a08c85664cea709118) Conflicts: PendingReleaseNotes - Added release notes under 14.2.9 qa/standalone/mon/health-mute.sh - Deleted the script as 'health mute/unmute' cmd is unavailable in nautilus qa/tasks/ceph.conf.template - Removed a flag not available in nautilus src/common/options.cc - Removed a flag not available in nautilus src/osd/OSDMap.cc --- PendingReleaseNotes | 11 +++++++++++ doc/rados/configuration/mon-config-ref.rst | 8 ++++++++ qa/tasks/ceph.conf.template | 1 + src/common/options.cc | 7 +++++++ src/osd/OSDMap.cc | 20 ++++++++++++++++++++ 5 files changed, 47 insertions(+) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index a48aee634ab4c..56f5a44d2dfcb 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -15,3 +15,14 @@ ceph osd pool set pg_autoscale_mode warn * The format of MDSs in `ceph fs dump` has changed. + +* Ceph will issue a health warning if a RADOS pool's ``size`` is set to 1 + or in other words the pool is configured with no redundancy. This can + be fixed by setting the pool size to the minimum recommended value + with:: + + ceph osd pool set size + + The warning can be silenced with:: + + ceph config set global mon_warn_on_pool_no_redundancy false diff --git a/doc/rados/configuration/mon-config-ref.rst b/doc/rados/configuration/mon-config-ref.rst index 67318f490c640..554f3e845afde 100644 --- a/doc/rados/configuration/mon-config-ref.rst +++ b/doc/rados/configuration/mon-config-ref.rst @@ -412,6 +412,14 @@ by setting it in the ``[mon]`` section of the configuration file. :Default: ``0`` +``mon warn on pool no redundancy`` + +:Description: Issue a ``HEALTH_WARN`` in cluster log if any pool is + configured with no replicas. +:Type: Boolean +:Default: ``True`` + + ``mon cache target full warn ratio`` :Description: Position between pool's ``cache_target_full`` and diff --git a/qa/tasks/ceph.conf.template b/qa/tasks/ceph.conf.template index 3018bd1de5319..bb0d30efcaab0 100644 --- a/qa/tasks/ceph.conf.template +++ b/qa/tasks/ceph.conf.template @@ -27,6 +27,7 @@ mon warn on osd down out interval zero = false mon warn on too few osds = false mon_warn_on_pool_pg_num_not_power_of_two = false + mon_warn_on_pool_no_redundancy = false osd pool default erasure code profile = "plugin=jerasure technique=reed_sol_van k=2 m=1 ruleset-failure-domain=osd crush-failure-domain=osd" diff --git a/src/common/options.cc b/src/common/options.cc index 304135391320f..d7313b724d5a3 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -1739,6 +1739,13 @@ std::vector