From 672d436d7b4a3b044f74bf8e9ad841a42db4e750 Mon Sep 17 00:00:00 2001 From: Leonid Usov Date: Thu, 3 Aug 2023 19:47:31 +0300 Subject: [PATCH] mon/MDSMonitor: print a note when adding data pool to a file system that doesn't have 'bulk' flag set The note will only be printed if the pool has pg_autoscale_mode set to ON and the bulk flag is missing Signed-off-by: Leonid Usov (cherry picked from commit 7d09154ce87d24993f605c8bbf829d6415b89562) --- src/mon/FSCommands.cc | 8 ++++++++ src/mon/MDSMonitor.cc | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index ca336de089f85..1c80c1c307bfc 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -1489,6 +1489,14 @@ int FileSystemCommandHandler::_check_pool( return -EINVAL; } + if (type != POOL_METADATA && pool->pg_autoscale_mode == pg_pool_t::pg_autoscale_mode_t::ON && !pool->has_flag(pg_pool_t::FLAG_BULK)) { + // TODO: consider issuing an info event in this case + *ss << " Pool '" << pool_name << "' (id '" << pool_id + << "') has pg autoscale mode 'on' but is not marked as bulk." << std::endl + << " Consider setting the flag by running" << std::endl + << " # ceph osd pool set " << pool_name << " bulk true" << std::endl; + } + // Nothing special about this pool, so it is permissible return 0; } diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 84f2d7d14b8e3..54db3c86291ae 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1421,8 +1421,7 @@ bool MDSMonitor::prepare_command(MonOpRequestRef op) out: dout(4) << __func__ << " done, r=" << r << dendl; /* Compose response */ - string rs; - getline(ss, rs); + string rs = ss.str(); if (r >= 0) { // success.. delay reply -- 2.39.5