Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon/OSDMonitor: fix min_size default for replicated pools #20555

Merged
merged 1 commit into from
Feb 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions qa/standalone/mon/misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ function TEST_osd_pool_get_set() {

local size=$(ceph osd pool get $TEST_POOL size|awk '{print $2}')
local min_size=$(ceph osd pool get $TEST_POOL min_size|awk '{print $2}')
local expected_min_size=$(expr $size - $size / 2)
if [ $min_size -ne $expected_min_size ]; then
echo "default min_size is wrong: expected $expected_min_size, got $min_size"
return 1
fi

ceph osd pool set $TEST_POOL scrub_min_interval 123456 || return 1
ceph osd dump | grep 'pool ' | grep 'scrub_min_interval 123456' || return 1
Expand Down
2 changes: 1 addition & 1 deletion src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5521,7 +5521,7 @@ int OSDMonitor::prepare_pool_size(const unsigned pool_type,
switch (pool_type) {
case pg_pool_t::TYPE_REPLICATED:
*size = g_conf->get_val<uint64_t>("osd_pool_default_size");
*min_size = g_conf->get_val<uint64_t>("osd_pool_default_min_size");
*min_size = g_conf->get_osd_pool_default_min_size();
break;
case pg_pool_t::TYPE_ERASURE:
{
Expand Down