Skip to content

Commit

Permalink
mon/OSDMonitor: Warn when expected_num_objects will have no effect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Douglas Fuller committed Jul 18, 2018
1 parent 67c8b6e commit 4c108a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mon/OSDMonitor.cc
Expand Up @@ -11119,6 +11119,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(cct, cmdmap, "fast_read", fast_read_param, int64_t(-1));
FastReadType fast_read = FAST_READ_DEFAULT;
Expand Down

0 comments on commit 4c108a5

Please sign in to comment.