Merge remote-tracking branch 'origin/next'

This commit is contained in:
John Spray 2014-06-24 16:00:28 -07:00
commit e5c565d3c1
3 changed files with 58 additions and 1 deletions

View File

@ -86,7 +86,6 @@ function expect_config_value()
fi
}
# Test SI units during injectargs and 'config set'
# We only aim at testing the units are parsed accordingly
# and don't intend to test whether the options being set
@ -315,6 +314,24 @@ ceph mds set allow_new_snaps false
ceph mds set allow_new_snaps no
expect_false ceph mds set allow_new_snaps taco
# we should never be able to add EC pools as data or metadata pools
# create an ec-pool
ceph osd pool create mds-ec-pool 10 10 erasure
set +e
ceph mds add_data_pool mds-ec-pool 2>$TMPFILE
check_response 'erasure-code' $? 22
set -e
poolnum=$(ceph osd dump | grep 'pool.*mds-ec-pool' | awk '{print $2;}')
set +e
ceph mds newfs 0 $poolnum --yes-i-really-mean-it 2>$TMPFILE
check_response 'erasure-code' $? 22
ceph mds newfs $poolnum 1 --yes-i-really-mean-it 2>$TMPFILE
check_response 'erasure-code' $? 22
ceph mds newfs $poolnum $poolnum --yes-i-really-mean-it 2>$TMPFILE
check_response 'erasure-code' $? 22
set -e
ceph osd pool delete mds-ec-pool mds-ec-pool --yes-i-really-really-mean-it
ceph mds stat
# ceph mds tell mds.a getmap
# ceph mds rm

View File

@ -1064,6 +1064,14 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
ss << "pool '" << poolname << "' does not exist";
}
}
const pg_pool_t *p = mon->osdmon()->osdmap.get_pg_pool(poolid);
assert(p != NULL);
if (p->is_erasure()) {
// I'm sorry Dave, I'm afraid I can't do that
r = -EINVAL;
poolid = -1;
ss << "can't use pool '" << poolname << "' as it's an erasure-code pool";
}
if (poolid >= 0) {
pending_mdsmap.add_data_pool(poolid);
ss << "added data pool " << poolid << " to mdsmap";
@ -1112,6 +1120,35 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
r = -EINVAL;
goto out;
}
const pg_pool_t *p = mon->osdmon()->osdmap.get_pg_pool(data);
if (!p) {
ss << "pool id '" << data << "' does not exist";
r = -ENOENT;
goto out;
} else if (p->is_erasure()) {
const char *pn = mon->osdmon()->osdmap.get_pool_name(data);
assert(pn != NULL);
ss << "pool '" << pn << "' (id '" << data << "')"
<< " is an erasure-code pool";
r = -EINVAL;
goto out;
}
p = mon->osdmon()->osdmap.get_pg_pool(metadata);
if (!p) {
ss << "pool id '" << metadata << "' does not exist";
r = -ENOENT;
goto out;
} else if (p->is_erasure()) {
const char *pn = mon->osdmon()->osdmap.get_pool_name(metadata);
assert(pn != NULL);
ss << "pool '" << pn << "' (id '" << metadata << "')"
<< " is an erasure-code pool";
r = -EINVAL;
goto out;
}
string sure;
cmd_getval(g_ceph_context, cmdmap, "sure", sure);
if (sure != "--yes-i-really-mean-it") {

View File

@ -3993,6 +3993,8 @@ TEST_F(LibRadosTierECPP, HitSetRead) {
}
}
// disable this test until hitset-get reliably works on EC pools
#if 0
TEST_F(LibRadosTierECPP, HitSetWrite) {
int num_pg = _get_pg_num(cluster, pool_name);
assert(num_pg > 0);
@ -4065,6 +4067,7 @@ TEST_F(LibRadosTierECPP, HitSetWrite) {
ASSERT_TRUE(found);
}
}
#endif
TEST_F(LibRadosTierECPP, HitSetTrim) {
unsigned count = 3;