]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: print a note when adding data pool to a file system that doesn't... 52902/head
authorLeonid Usov <leonid.usov@ibm.com>
Thu, 3 Aug 2023 16:47:31 +0000 (19:47 +0300)
committerLeonid Usov <leonid.usov@ibm.com>
Mon, 14 Aug 2023 14:48:12 +0000 (17:48 +0300)
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 <leonid.usov@ibm.com>
(cherry picked from commit 7d09154ce87d24993f605c8bbf829d6415b89562)

src/mon/FSCommands.cc
src/mon/MDSMonitor.cc

index 5acafb1ff91d9537fc55fd6a988a5e0ae177f7d0..122e7e1ba196533f59311ae26b38186f30b9274c 100644 (file)
@@ -1584,6 +1584,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;
 }
index 7a710580e3edd34318446221e070c89b738f900b..8f25d7a937df6c603b869abb885c9e745e3baa45 100644 (file)
@@ -1438,8 +1438,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