]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: Warn when expected_num_objects will have no effect
authorDouglas Fuller <dfuller@redhat.com>
Thu, 28 Jun 2018 15:21:38 +0000 (11:21 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 3 Oct 2018 12:17:31 +0000 (14:17 +0200)
The expected_num_objects argument to ceph osd pool create is
only effective on filestore pools when merging is disabled
(filestore_merge_threshold < 0). Warn and disallow pool creation
in this situation.

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
(cherry picked from commit 4c108a50e5f74a56965d49687a8c817f4a5ce42b)

src/mon/OSDMonitor.cc

index 53c3769654d57b682945dca71dbec4b514be8427..cb3654036aca4df3c7cf217f495eabfba28bab92 100644 (file)
@@ -10866,6 +10866,14 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       goto reply;
     }
 
+    if (expected_num_objects > 0 &&
+       cct->_conf->osd_objectstore == "filestore" &&
+       cct->_conf->filestore_merge_threshold > 0) {
+      ss << "'expected_num_objects' requires 'filestore_merge_threshold < 0'";
+      err = -EINVAL;
+      goto reply;
+    }
+
     int64_t fast_read_param;
     cmd_getval(g_ceph_context, cmdmap, "fast_read", fast_read_param, int64_t(-1));
     FastReadType fast_read = FAST_READ_DEFAULT;