Set the ruleset failure domain to osd (instead of the host which is the default)::
$ ceph osd erasure-code-profile set myprofile \
- ruleset-failure-domain=osd
+ crush-failure-domain=osd
$ ceph osd erasure-code-profile get myprofile
k=2
m=1
plugin=jerasure
technique=reed_sol_van
- ruleset-failure-domain=osd
+ crush-failure-domain=osd
$ ceph osd pool create ecpool 12 12 erasure myprofile
Control the parameters of the erasure code plugin::
Set the ruleset to take ssd (instead of default)::
$ ceph osd erasure-code-profile set myprofile \
- ruleset-root=ssd
+ crush-root=ssd
$ ceph osd erasure-code-profile get myprofile
k=2
m=1
plugin=jerasure
technique=reed_sol_van
- ruleset-root=ssd
+ crush-root=ssd
::
$ ceph osd erasure-code-profile set myprofile \
- ruleset-failure-domain=osd
+ crush-failure-domain=osd
$ ceph osd erasure-code-profile get myprofile
directory=/usr/lib/ceph/erasure-code
k=2
m=1
plugin=jerasure
technique=reed_sol_van
- ruleset-failure-domain=osd
+ crush-failure-domain=osd
$ ceph osd pool create ecpool 12 12 erasure myprofile
The *plugin* is dynamically loaded from *directory* and expected to
technique={reed_sol_van|cauchy} \
[k={data-chunks}] \
[m={coding-chunks}] \
- [ruleset-root={root}] \
- [ruleset-failure-domain={bucket-type}] \
+ [crush-root={root}] \
+ [crush-failure-domain={bucket-type}] \
+ [crush-device-class={device-class}] \
[directory={directory}] \
[--force]
:Required: No.
:Default: reed_sol_van
-``ruleset-root={root}``
+``crush-root={root}``
:Description: The name of the crush bucket used for the first step of
the ruleset. For intance **step take default**.
:Required: No.
:Default: default
-``ruleset-failure-domain={bucket-type}``
+``crush-failure-domain={bucket-type}``
:Description: Ensure that no two chunks are in a bucket with the same
failure domain. For instance, if the failure domain is
:Required: No.
:Default: host
+``crush-device-class={device-class}``
+
+:Description: Restrict placement to devices of a specific class (e.g.,
+ ``ssd`` or ``hdd``), using the crush device class names
+ in the CRUSH map.
+
+:Type: String
+:Required: No.
+:Default:
+
``directory={directory}``
:Description: Set the **directory** name from which the erasure code
k={data-chunks} \
m={coding-chunks} \
technique={reed_sol_van|reed_sol_r6_op|cauchy_orig|cauchy_good|liberation|blaum_roth|liber8tion} \
- [ruleset-root={root}] \
- [ruleset-failure-domain={bucket-type}] \
+ [crush-root={root}] \
+ [crush-failure-domain={bucket-type}] \
+ [crush-device-class={device-class}] \
[directory={directory}] \
[--force]
:Required: No.
:Default: 2048
-``ruleset-root={root}``
+``crush-root={root}``
:Description: The name of the crush bucket used for the first step of
the ruleset. For intance **step take default**.
:Required: No.
:Default: default
-``ruleset-failure-domain={bucket-type}``
+``crush-failure-domain={bucket-type}``
:Description: Ensure that no two chunks are in a bucket with the same
failure domain. For instance, if the failure domain is
:Required: No.
:Default: host
-``directory={directory}``
+``crush-device-class={device-class}``
+
+:Description: Restrict placement to devices of a specific class (e.g.,
+ ``ssd`` or ``hdd``), using the crush device class names
+ in the CRUSH map.
+
+:Type: String
+:Required: No.
+:Default:
+
+ ``directory={directory}``
:Description: Set the **directory** name from which the erasure code
plugin is loaded.
$ ceph osd erasure-code-profile set LRCprofile \
plugin=lrc \
k=4 m=2 l=3 \
- ruleset-failure-domain=host
+ crush-failure-domain=host
$ ceph osd pool create lrcpool 12 12 erasure LRCprofile
$ ceph osd erasure-code-profile set LRCprofile \
plugin=lrc \
k=4 m=2 l=3 \
- ruleset-locality=rack \
- ruleset-failure-domain=host
+ crush-locality=rack \
+ crush-failure-domain=host
$ ceph osd pool create lrcpool 12 12 erasure LRCprofile
k={data-chunks} \
m={coding-chunks} \
l={locality} \
- [ruleset-root={root}] \
- [ruleset-locality={bucket-type}] \
- [ruleset-failure-domain={bucket-type}] \
+ [crush-root={root}] \
+ [crush-locality={bucket-type}] \
+ [crush-failure-domain={bucket-type}] \
+ [crush-device-class={device-class}] \
[directory={directory}] \
[--force]
:Required: Yes.
:Example: 3
-``ruleset-root={root}``
+``crush-root={root}``
:Description: The name of the crush bucket used for the first step of
the ruleset. For intance **step take default**.
:Required: No.
:Default: default
-``ruleset-locality={bucket-type}``
+``crush-locality={bucket-type}``
:Description: The type of the crush bucket in which each set of chunks
defined by **l** will be stored. For instance, if it is
:Type: String
:Required: No.
-``ruleset-failure-domain={bucket-type}``
+``crush-failure-domain={bucket-type}``
:Description: Ensure that no two chunks are in a bucket with the same
failure domain. For instance, if the failure domain is
:Required: No.
:Default: host
+``crush-device-class={device-class}``
+
+:Description: Restrict placement to devices of a specific class (e.g.,
+ ``ssd`` or ``hdd``), using the crush device class names
+ in the CRUSH map.
+
+:Type: String
+:Required: No.
+:Default:
+
``directory={directory}``
:Description: Set the **directory** name from which the erasure code
[ "cDDD____", "" ],
[ "____cDDD", "" ],
]' \
- ruleset-steps='[
+ crush-steps='[
[ "choose", "rack", 2 ],
[ "chooseleaf", "host", 4 ],
]'
For instance::
- ruleset-steps='[ [ "choose", "rack", 2 ], [ "chooseleaf", "host", 4 ] ]'
+ crush-steps='[ [ "choose", "rack", 2 ], [ "chooseleaf", "host", 4 ] ]'
will create a ruleset that will select two crush buckets of type
*rack* and for each of them choose four OSDs, each of them located in
[k={data-chunks}] \
[m={coding-chunks}] \
[c={durability-estimator}] \
- [ruleset-root={root}] \
- [ruleset-failure-domain={bucket-type}] \
+ [crush-root={root}] \
+ [crush-failure-domain={bucket-type}] \
+ [crush-device-class={device-class}] \
[directory={directory}] \
[--force]
:Required: No.
:Default: 2
-``ruleset-root={root}``
+``crush-root={root}``
:Description: The name of the crush bucket used for the first step of
the ruleset. For intance **step take default**.
:Required: No.
:Default: default
-``ruleset-failure-domain={bucket-type}``
+``crush-failure-domain={bucket-type}``
:Description: Ensure that no two chunks are in a bucket with the same
failure domain. For instance, if the failure domain is
:Required: No.
:Default: host
+``crush-device-class={device-class}``
+
+:Description: Restrict placement to devices of a specific class (e.g.,
+ ``ssd`` or ``hdd``), using the crush device class names
+ in the CRUSH map.
+
+:Type: String
+:Required: No.
+:Default:
+
``directory={directory}``
:Description: Set the **directory** name from which the erasure code
$ ceph osd erasure-code-profile set SHECprofile \
plugin=shec \
k=8 m=4 c=3 \
- ruleset-failure-domain=host
+ crush-failure-domain=host
$ ceph osd pool create shecpool 256 256 erasure SHECprofile
k=2
m=1
plugin=jerasure
- ruleset-failure-domain=host
+ crush-failure-domain=host
technique=reed_sol_van
Choosing the right profile is important because it cannot be modified
to be created and all objects from the previous pool moved to the new.
The most important parameters of the profile are *K*, *M* and
-*ruleset-failure-domain* because they define the storage overhead and
+*crush-failure-domain* because they define the storage overhead and
the data durability. For instance, if the desired architecture must
sustain the loss of two racks with a storage overhead of 40% overhead,
the following profile can be defined::
$ ceph osd erasure-code-profile set myprofile \
k=3 \
m=2 \
- ruleset-failure-domain=rack
+ crush-failure-domain=rack
$ ceph osd pool create ecpool 12 12 erasure myprofile
$ echo ABCDEFGHI | rados --pool ecpool put NYAN -
$ rados --pool ecpool get NYAN -
The *NYAN* object will be divided in three (*K=3*) and two additional
*chunks* will be created (*M=2*). The value of *M* defines how many
OSD can be lost simultaneously without losing any data. The
-*ruleset-failure-domain=rack* will create a CRUSH ruleset that ensures
+*crush-failure-domain=rack* will create a CRUSH ruleset that ensures
no two *chunks* are stored in the same rack.
.. ditaa::
To create a pool, execute::
ceph osd pool create {pool-name} {pg-num} [{pgp-num}] [replicated] \
- [crush-ruleset-name] [expected-num-objects]
+ [crush-rule-name] [expected-num-objects]
ceph osd pool create {pool-name} {pg-num} {pgp-num} erasure \
- [erasure-code-profile] [crush-ruleset-name] [expected_num_objects]
+ [erasure-code-profile] [crush-rule-name] [expected_num_objects]
Where:
:Required: No.
:Default: replicated
-``[crush-ruleset-name]``
+``[crush-rule-name]``
-:Description: The name of a CRUSH ruleset to use for this pool. The specified
- ruleset must exist.
+:Description: The name of a CRUSH rule to use for this pool. The specified
+ rule must exist.
:Type: String
:Required: No.
You can resolve the problem by creating a new pool in which PGs are allowed
to have OSDs residing on the same host with::
- ceph osd erasure-code-profile set myprofile ruleset-failure-domain=osd
+ ceph osd erasure-code-profile set myprofile crush-failure-domain=osd
ceph osd pool create erasurepool 16 16 erasure myprofile
CRUSH gives up too soon
#. Make sure your cluster is stable and healthy (no down or
recoverying OSDs). (Optional, but recommended.)
+#. Do not create any new erasure-code pools while upgrading the monitors.
+
#. Set the ``noout`` flag for the duration of the upgrade. (Optional
but recommended.)::
The code is mature and unlikely to change, but we are only
continuing to test the Jewel stable branch against btrfs. We
recommend moving these OSDs to FileStore with XFS or BlueStore.
+* The ``ruleset-*`` properties for the erasure code profiles have been
+ renamed to ``crush-*`` to (1) move away from the obsolete 'ruleset'
+ term and to be more clear about their purpose. There is also a new
+ optional ``crush-device-class`` property to specify a CRUSH device
+ class to use for the erasure coded pool. Existing erasure code
+ profiles will be converted automatically when upgrade completes
+ (when the ``ceph osd require-osd-release luminous`` command is run)
+ but any provisioning tools that create erasure coded pools may need
+ to be updated.
* When assigning a network to the public network and not to
the cluster network the network specification of the public
network will be used for the cluster network as well.
k: 2
m: 1
technique: reed_sol_van
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
op_weights:
read: 100
write: 0
k: 2
m: 1
technique: reed_sol_van
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
op_weights:
read: 100
write: 0
k: 3
m: 1
technique: reed_sol_van
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
op_weights:
read: 100
write: 0
k: 4
m: 2
l: 3
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
op_weights:
read: 100
write: 0
k: 4
m: 3
c: 2
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
op_weights:
read: 100
write: 0
name: testprofile
k: 3
m: 1
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
s3tests:
slow_backend: true
tasks:
- exec:
client.0:
- - sudo ceph osd erasure-code-profile set teuthologyprofile ruleset-failure-domain=osd m=1 k=2
+ - sudo ceph osd erasure-code-profile set teuthologyprofile crush-failure-domain=osd m=1 k=2
- sudo ceph osd pool create base 4 4 erasure teuthologyprofile
- sudo ceph osd pool set base min_size 2
- sudo ceph osd pool create cache 4
tasks:
- exec:
client.0:
- - sudo ceph osd erasure-code-profile set teuthologyprofile ruleset-failure-domain=osd m=1 k=2
+ - sudo ceph osd erasure-code-profile set teuthologyprofile crush-failure-domain=osd m=1 k=2
- sudo ceph osd pool create datapool 4 4 erasure teuthologyprofile
- sudo ceph osd pool set datapool allow_ec_overwrites true
tasks:
- exec:
client.0:
- - sudo ceph osd erasure-code-profile set teuthologyprofile ruleset-failure-domain=osd m=1 k=2
+ - sudo ceph osd erasure-code-profile set teuthologyprofile crush-failure-domain=osd m=1 k=2
- sudo ceph osd pool create datapool 4 4 erasure teuthologyprofile
- sudo ceph osd pool set datapool allow_ec_overwrites true
tasks:
- exec:
client.0:
- - sudo ceph osd erasure-code-profile set teuthologyprofile ruleset-failure-domain=osd m=1 k=2
+ - sudo ceph osd erasure-code-profile set teuthologyprofile crush-failure-domain=osd m=1 k=2
- sudo ceph osd pool delete rbd rbd --yes-i-really-really-mean-it
- sudo ceph osd pool create rbd 4 4 erasure teuthologyprofile
- sudo ceph osd pool create cache 4
tasks:
- exec:
client.0:
- - sudo ceph osd erasure-code-profile set teuthologyprofile ruleset-failure-domain=osd m=1 k=2
+ - sudo ceph osd erasure-code-profile set teuthologyprofile crush-failure-domain=osd m=1 k=2
- sudo ceph osd pool create datapool 4 4 erasure teuthologyprofile
- sudo ceph osd pool set datapool allow_ec_overwrites true
name: teuthologyprofile2
k: 2
m: 1
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
clients: [client.0]
ops: 4000
objects: 50
tasks:
- exec:
client.0:
- - ceph osd erasure-code-profile set t-profile ruleset-failure-domain=osd k=2 m=1
+ - ceph osd erasure-code-profile set t-profile crush-failure-domain=osd k=2 m=1
- ceph osd pool create base-pool 4 4 erasure t-profile
k: 3
m: 1
technique: reed_sol_van
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
op_weights:
read: 100
write: 0
k: 3
m: 1
technique: reed_sol_van
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
op_weights:
read: 100
write: 0
profile = config.get('erasure_code_profile', {
'k': '2',
'm': '2',
- 'ruleset-failure-domain': 'osd'
+ 'crush-failure-domain': 'osd'
})
profile_name = profile.get('name', 'lost_unfound')
manager.create_erasure_code_profile(profile_name, profile)
name: teuthologyprofile
k: 2
m: 1
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
pool_snaps: true
write_fadvise_dontneed: true
runs: 10
name: teuthologyprofile
k: 2
m: 1
- ruleset-failure-domain: osd
+ crush-failure-domain: osd
cleanup: false (defaults to true)
type: <write|seq|rand> (defaults to write)
example:
If profile is {}, it is replaced with
- { 'k': '2', 'm': '1', 'ruleset-failure-domain': 'osd'}
+ { 'k': '2', 'm': '1', 'crush-failure-domain': 'osd'}
for backward compatibility. In previous versions of teuthology,
these values were hardcoded as function arguments and some yaml
profile = {
'k': '2',
'm': '1',
- 'ruleset-failure-domain': 'osd'
+ 'crush-failure-domain': 'osd'
}
return [
'osd', 'erasure-code-profile', 'set',
PROFILE="alloc_hint-ecprofile"
POOL="alloc_hint-ec"
-ceph osd erasure-code-profile set "${PROFILE}" k=2 m=1 ruleset-failure-domain=osd
+ceph osd erasure-code-profile set "${PROFILE}" k=2 m=1 crush-failure-domain=osd
ceph osd erasure-code-profile get "${PROFILE}" # just so it's logged
ceph osd pool create "${POOL}" "${NUM_PG}" "${NUM_PGP}" erasure "${PROFILE}"
run_expect_nosignal "$RADOS_TOOL" --namespace "asdf" ls
run_expect_succ "$RADOS_TOOL" mkpool "$POOL"
-run_expect_succ "$CEPH_TOOL" osd erasure-code-profile set myprofile k=2 m=1 stripe_unit=2K ruleset-failure-domain=osd --force
+run_expect_succ "$CEPH_TOOL" osd erasure-code-profile set myprofile k=2 m=1 stripe_unit=2K crush-failure-domain=osd --force
run_expect_succ "$CEPH_TOOL" osd pool create "$POOL_EC" 100 100 erasure myprofile
}
ceph osd pool create repdata 24 24
-ceph osd erasure-code-profile set teuthologyprofile ruleset-failure-domain=osd m=1 k=2
+ceph osd erasure-code-profile set teuthologyprofile crush-failure-domain=osd m=1 k=2
ceph osd pool create ecdata 24 24 erasure teuthologyprofile
ceph osd pool set ecdata allow_ec_overwrites true
ceph osd pool create rbdnonzero 24 24
virtual const ErasureCodeProfile &get_profile() const = 0;
/**
- * Create a new ruleset in **crush** under the name **name**,
+ * Create a new rule in **crush** under the name **name**,
* unless it already exists.
*
- * Return the ruleset number that was created on success. If a
- * ruleset **name** already exists, return -EEXISTS, otherwise
+ * Return the rule number that was created on success. If a
+ * rule **name** already exists, return -EEXISTS, otherwise
* return a negative value indicating an error with a semantic
* defined by the implementation.
*
- * @param [in] name of the ruleset to create
- * @param [in] crush crushmap in which the ruleset is created
+ * @param [in] name of the rule to create
+ * @param [in] crush crushmap in which the rule is created
* @param [out] ss contains informative messages when an error occurs
- * @return a ruleset on success or a negative errno on error.
+ * @return a rule on success or a negative errno on error.
*/
- virtual int create_ruleset(const std::string &name,
- CrushWrapper &crush,
- std::ostream *ss) const = 0;
+ virtual int create_rule(const std::string &name,
+ CrushWrapper &crush,
+ std::ostream *ss) const = 0;
/**
* Return the number of chunks created by a call to the **encode**
const std::string ErasureCodeIsaDefault::DEFAULT_M("3");
int
-ErasureCodeIsa::create_ruleset(const string &name,
- CrushWrapper &crush,
- ostream *ss) const
+ErasureCodeIsa::create_rule(const string &name,
+ CrushWrapper &crush,
+ ostream *ss) const
{
int ruleid = crush.add_simple_rule(
name,
- ruleset_root,
- ruleset_failure_domain,
+ rule_root,
+ rule_failure_domain,
"",
"indep",
pg_pool_t::TYPE_ERASURE,
return ruleid;
else {
crush.set_rule_mask_max_size(ruleid, get_chunk_count());
- return crush.get_rule_mask_ruleset(ruleid);
+ return ruleid;
}
}
ErasureCodeIsa::init(ErasureCodeProfile &profile, ostream *ss)
{
int err = 0;
- err |= to_string("ruleset-root", profile,
- &ruleset_root,
- DEFAULT_RULESET_ROOT, ss);
- err |= to_string("ruleset-failure-domain", profile,
- &ruleset_failure_domain,
- DEFAULT_RULESET_FAILURE_DOMAIN, ss);
+ err |= to_string("crush-root", profile,
+ &rule_root,
+ DEFAULT_RULE_ROOT, ss);
+ err |= to_string("crush-failure-domain", profile,
+ &rule_failure_domain,
+ DEFAULT_RULE_FAILURE_DOMAIN, ss);
err |= parse(profile, ss);
if (err)
return err;
#include "ErasureCodeIsaTableCache.h"
// -----------------------------------------------------------------------------
-#define DEFAULT_RULESET_ROOT "default"
-#define DEFAULT_RULESET_FAILURE_DOMAIN "host"
+#define DEFAULT_RULE_ROOT "default"
+#define DEFAULT_RULE_FAILURE_DOMAIN "host"
class ErasureCodeIsa : public ErasureCode {
public:
ErasureCodeIsaTableCache &tcache;
const char *technique;
- std::string ruleset_root;
- std::string ruleset_failure_domain;
+ std::string rule_root;
+ std::string rule_failure_domain;
ErasureCodeIsa(const char *_technique,
ErasureCodeIsaTableCache &_tcache) :
w(0),
tcache(_tcache),
technique(_technique),
- ruleset_root(DEFAULT_RULESET_ROOT),
- ruleset_failure_domain(DEFAULT_RULESET_FAILURE_DOMAIN)
+ rule_root(DEFAULT_RULE_ROOT),
+ rule_failure_domain(DEFAULT_RULE_FAILURE_DOMAIN)
{
}
{
}
- int create_ruleset(const std::string &name,
- CrushWrapper &crush,
- std::ostream *ss) const override;
+ int create_rule(const std::string &name,
+ CrushWrapper &crush,
+ std::ostream *ss) const override;
unsigned int
get_chunk_count() const override
return *_dout << "ErasureCodeJerasure: ";
}
-int ErasureCodeJerasure::create_ruleset(const string &name,
+int ErasureCodeJerasure::create_rule(const string &name,
CrushWrapper &crush,
ostream *ss) const
{
int ruleid = crush.add_simple_rule(
- name, ruleset_root, ruleset_failure_domain, "",
- "indep", pg_pool_t::TYPE_ERASURE, ss);
+ name,
+ rule_root,
+ rule_failure_domain,
+ "",
+ "indep",
+ pg_pool_t::TYPE_ERASURE,
+ ss);
if (ruleid < 0)
return ruleid;
else {
crush.set_rule_mask_max_size(ruleid, get_chunk_count());
- return crush.get_rule_mask_ruleset(ruleid);
+ return ruleid;
}
}
int err = 0;
dout(10) << "technique=" << technique << dendl;
profile["technique"] = technique;
- err |= to_string("ruleset-root", profile,
- &ruleset_root,
- DEFAULT_RULESET_ROOT, ss);
- err |= to_string("ruleset-failure-domain", profile,
- &ruleset_failure_domain,
- DEFAULT_RULESET_FAILURE_DOMAIN, ss);
+ err |= to_string("crush-root", profile,
+ &rule_root,
+ DEFAULT_RULE_ROOT, ss);
+ err |= to_string("crush-failure-domain", profile,
+ &rule_failure_domain,
+ DEFAULT_RULE_FAILURE_DOMAIN, ss);
err |= parse(profile, ss);
if (err)
return err;
#include "erasure-code/ErasureCode.h"
-#define DEFAULT_RULESET_ROOT "default"
-#define DEFAULT_RULESET_FAILURE_DOMAIN "host"
+#define DEFAULT_RULE_ROOT "default"
+#define DEFAULT_RULE_FAILURE_DOMAIN "host"
class ErasureCodeJerasure : public ErasureCode {
public:
int w;
std::string DEFAULT_W;
const char *technique;
- std::string ruleset_root;
- std::string ruleset_failure_domain;
+ std::string rule_root;
+ std::string rule_failure_domain;
bool per_chunk_alignment;
explicit ErasureCodeJerasure(const char *_technique) :
w(0),
DEFAULT_W("8"),
technique(_technique),
- ruleset_root(DEFAULT_RULESET_ROOT),
- ruleset_failure_domain(DEFAULT_RULESET_FAILURE_DOMAIN),
+ rule_root(DEFAULT_RULE_ROOT),
+ rule_failure_domain(DEFAULT_RULE_FAILURE_DOMAIN),
per_chunk_alignment(false)
{}
~ErasureCodeJerasure() override {}
- int create_ruleset(const std::string &name,
- CrushWrapper &crush,
- std::ostream *ss) const override;
+ int create_rule(const std::string &name,
+ CrushWrapper &crush,
+ std::ostream *ss) const override;
unsigned int get_chunk_count() const override {
return k + m;
return *_dout << "ErasureCodeLrc: ";
}
-int ErasureCodeLrc::create_ruleset(const string &name,
+int ErasureCodeLrc::create_rule(const string &name,
CrushWrapper &crush,
ostream *ss) const
{
*ss << "rule " << name << " exists";
return -EEXIST;
}
- if (!crush.name_exists(ruleset_root)) {
- *ss << "root item " << ruleset_root << " does not exist";
+ if (!crush.name_exists(rule_root)) {
+ *ss << "root item " << rule_root << " does not exist";
return -ENOENT;
}
- int root = crush.get_item_id(ruleset_root);
+ int root = crush.get_item_id(rule_root);
- int ruleset = 0;
+ int rule = 0;
int rno = 0;
for (rno = 0; rno < crush.get_max_rules(); rno++) {
if (!crush.rule_exists(rno) && !crush.ruleset_exists(rno))
break;
}
- ruleset = rno;
+ rule = rno;
- int steps = 4 + ruleset_steps.size();
+ int steps = 4 + rule_steps.size();
int min_rep = 3;
int max_rep = get_chunk_count();
int ret;
- ret = crush.add_rule(steps, ruleset, pg_pool_t::TYPE_ERASURE,
+ ret = crush.add_rule(steps, rule, pg_pool_t::TYPE_ERASURE,
min_rep, max_rep, rno);
assert(ret == rno);
int step = 0;
assert(ret == 0);
// [ [ "choose", "rack", 2 ],
// [ "chooseleaf", "host", 5 ] ]
- for (vector<Step>::const_iterator i = ruleset_steps.begin();
- i != ruleset_steps.end();
+ for (vector<Step>::const_iterator i = rule_steps.begin();
+ i != rule_steps.end();
++i) {
int op = i->op == "chooseleaf" ?
CRUSH_RULE_CHOOSELEAF_INDEP : CRUSH_RULE_CHOOSE_INDEP;
ret = crush.set_rule_step(rno, step++, CRUSH_RULE_EMIT, 0, 0);
assert(ret == 0);
crush.set_rule_name(rno, name);
- return ruleset;
+ return rule;
}
int ErasureCodeLrc::layers_description(const ErasureCodeProfile &profile,
if (r)
return r;
- return parse_ruleset(profile, ss);
+ return parse_rule(profile, ss);
}
const string ErasureCodeLrc::DEFAULT_KML("-1");
const char *generated[] = { "mapping",
"layers",
- "ruleset-steps" };
+ "crush-steps" };
for (int i = 0; i < 3; i++) {
if (profile.count(generated[i])) {
profile["layers"] = layers + "]";
ErasureCodeProfile::const_iterator parameter;
- string ruleset_locality;
- parameter = profile.find("ruleset-locality");
+ string rule_locality;
+ parameter = profile.find("crush-locality");
if (parameter != profile.end())
- ruleset_locality = parameter->second;
- string ruleset_failure_domain = "host";
- parameter = profile.find("ruleset-failure-domain");
+ rule_locality = parameter->second;
+ string rule_failure_domain = "host";
+ parameter = profile.find("crush-failure-domain");
if (parameter != profile.end())
- ruleset_failure_domain = parameter->second;
+ rule_failure_domain = parameter->second;
- if (ruleset_locality != "") {
- ruleset_steps.clear();
- ruleset_steps.push_back(Step("choose", ruleset_locality,
+ if (rule_locality != "") {
+ rule_steps.clear();
+ rule_steps.push_back(Step("choose", rule_locality,
local_group_count));
- ruleset_steps.push_back(Step("chooseleaf", ruleset_failure_domain,
+ rule_steps.push_back(Step("chooseleaf", rule_failure_domain,
l + 1));
- } else if (ruleset_failure_domain != "") {
- ruleset_steps.clear();
- ruleset_steps.push_back(Step("chooseleaf", ruleset_failure_domain, 0));
+ } else if (rule_failure_domain != "") {
+ rule_steps.clear();
+ rule_steps.push_back(Step("chooseleaf", rule_failure_domain, 0));
}
return err;
}
-int ErasureCodeLrc::parse_ruleset(ErasureCodeProfile &profile,
+int ErasureCodeLrc::parse_rule(ErasureCodeProfile &profile,
ostream *ss)
{
int err = 0;
- err |= to_string("ruleset-root", profile,
- &ruleset_root,
+ err |= to_string("crush-root", profile,
+ &rule_root,
"default", ss);
- if (profile.count("ruleset-steps") != 0) {
- ruleset_steps.clear();
- string str = profile.find("ruleset-steps")->second;
+ if (profile.count("crush-steps") != 0) {
+ rule_steps.clear();
+ string str = profile.find("crush-steps")->second;
json_spirit::mArray description;
try {
json_spirit::mValue json;
json_spirit::read_or_throw(str, json);
if (json.type() != json_spirit::array_type) {
- *ss << "ruleset-steps='" << str
+ *ss << "crush-steps='" << str
<< "' must be a JSON array but is of type "
<< json.type() << " instead" << std::endl;
return ERROR_LRC_ARRAY;
}
description = json.get_array();
} catch (json_spirit::Error_position &e) {
- *ss << "failed to parse ruleset-steps='" << str << "'"
+ *ss << "failed to parse crush-steps='" << str << "'"
<< " at line " << e.line_ << ", column " << e.column_
<< " : " << e.reason_ << std::endl;
return ERROR_LRC_PARSE_JSON;
<< " is of type " << i->type() << " instead" << std::endl;
return ERROR_LRC_ARRAY;
}
- int r = parse_ruleset_step(str, i->get_array(), ss);
+ int r = parse_rule_step(str, i->get_array(), ss);
if (r)
return r;
}
return 0;
}
-int ErasureCodeLrc::parse_ruleset_step(string description_string,
+int ErasureCodeLrc::parse_rule_step(string description_string,
json_spirit::mArray description,
ostream *ss)
{
<< json_string.str() << " found in " << description_string
<< " must be a JSON string but is of type "
<< i->type() << " instead" << std::endl;
- return position == 0 ? ERROR_LRC_RULESET_OP : ERROR_LRC_RULESET_TYPE;
+ return position == 0 ? ERROR_LRC_RULE_OP : ERROR_LRC_RULE_TYPE;
}
if (position == 2 && i->type() != json_spirit::int_type) {
*ss << "element " << position << " of the array "
<< json_string.str() << " found in " << description_string
<< " must be a JSON int but is of type "
<< i->type() << " instead" << std::endl;
- return ERROR_LRC_RULESET_N;
+ return ERROR_LRC_RULE_N;
}
if (position == 0)
if (position == 2)
n = i->get_int();
}
- ruleset_steps.push_back(Step(op, type, n));
+ rule_steps.push_back(Step(op, type, n));
return 0;
}
#define ERROR_LRC_COUNT_CONSTRAINT -(MAX_ERRNO + 11)
#define ERROR_LRC_CONFIG_OPTIONS -(MAX_ERRNO + 12)
#define ERROR_LRC_LAYERS_COUNT -(MAX_ERRNO + 13)
-#define ERROR_LRC_RULESET_OP -(MAX_ERRNO + 14)
-#define ERROR_LRC_RULESET_TYPE -(MAX_ERRNO + 15)
-#define ERROR_LRC_RULESET_N -(MAX_ERRNO + 16)
+#define ERROR_LRC_RULE_OP -(MAX_ERRNO + 14)
+#define ERROR_LRC_RULE_TYPE -(MAX_ERRNO + 15)
+#define ERROR_LRC_RULE_N -(MAX_ERRNO + 16)
#define ERROR_LRC_ALL_OR_NOTHING -(MAX_ERRNO + 17)
#define ERROR_LRC_GENERATED -(MAX_ERRNO + 18)
#define ERROR_LRC_K_M_MODULO -(MAX_ERRNO + 19)
std::string directory;
unsigned int chunk_count;
unsigned int data_chunk_count;
- std::string ruleset_root;
+ std::string rule_root;
struct Step {
Step(std::string _op, std::string _type, int _n) :
op(_op),
std::string type;
int n;
};
- std::vector<Step> ruleset_steps;
+ std::vector<Step> rule_steps;
explicit ErasureCodeLrc(const std::string &dir)
: directory(dir),
- chunk_count(0), data_chunk_count(0), ruleset_root("default")
+ chunk_count(0), data_chunk_count(0), rule_root("default")
{
- ruleset_steps.push_back(Step("chooseleaf", "host", 0));
+ rule_steps.push_back(Step("chooseleaf", "host", 0));
}
~ErasureCodeLrc() override {}
const std::set<int> &available,
std::set<int> *minimum) override;
- int create_ruleset(const std::string &name,
+ int create_rule(const std::string &name,
CrushWrapper &crush,
std::ostream *ss) const override;
int parse_kml(ErasureCodeProfile &profile, std::ostream *ss);
- int parse_ruleset(ErasureCodeProfile &profile, std::ostream *ss);
+ int parse_rule(ErasureCodeProfile &profile, std::ostream *ss);
- int parse_ruleset_step(std::string description_string,
- json_spirit::mArray description,
- std::ostream *ss);
+ int parse_rule_step(std::string description_string,
+ json_spirit::mArray description,
+ std::ostream *ss);
int layers_description(const ErasureCodeProfile &profile,
json_spirit::mArray *description,
return *_dout << "ErasureCodeShec: ";
}
-int ErasureCodeShec::create_ruleset(const string &name,
+int ErasureCodeShec::create_rule(const string &name,
CrushWrapper &crush,
ostream *ss) const
{
int ruleid = crush.add_simple_rule(
- name, ruleset_root, ruleset_failure_domain, "",
- "indep", pg_pool_t::TYPE_ERASURE, ss);
+ name,
+ rule_root,
+ rule_failure_domain,
+ "",
+ "indep",
+ pg_pool_t::TYPE_ERASURE,
+ ss);
if (ruleid < 0) {
return ruleid;
} else {
crush.set_rule_mask_max_size(ruleid, get_chunk_count());
- return crush.get_rule_mask_ruleset(ruleid);
+ return ruleid;
}
}
ostream *ss)
{
int err = 0;
- err |= ErasureCode::to_string("ruleset-root", profile,
- &ruleset_root,
- DEFAULT_RULESET_ROOT, ss);
- err |= ErasureCode::to_string("ruleset-failure-domain", profile,
- &ruleset_failure_domain,
- DEFAULT_RULESET_FAILURE_DOMAIN, ss);
+ err |= ErasureCode::to_string("crush-root", profile,
+ &rule_root,
+ DEFAULT_RULE_ROOT, ss);
+ err |= ErasureCode::to_string("crush-failure-domain", profile,
+ &rule_failure_domain,
+ DEFAULT_RULE_FAILURE_DOMAIN, ss);
err |= parse(profile);
if (err)
return err;
#include "erasure-code/ErasureCode.h"
#include "ErasureCodeShecTableCache.h"
-#define DEFAULT_RULESET_ROOT "default"
-#define DEFAULT_RULESET_FAILURE_DOMAIN "host"
+#define DEFAULT_RULE_ROOT "default"
+#define DEFAULT_RULE_FAILURE_DOMAIN "host"
class ErasureCodeShec : public ErasureCode {
int w;
int DEFAULT_W;
int technique;
- string ruleset_root;
- string ruleset_failure_domain;
+ string rule_root;
+ string rule_failure_domain;
int *matrix;
ErasureCodeShec(const int _technique,
w(0),
DEFAULT_W(8),
technique(_technique),
- ruleset_root(DEFAULT_RULESET_ROOT),
- ruleset_failure_domain(DEFAULT_RULESET_FAILURE_DOMAIN),
+ rule_root(DEFAULT_RULE_ROOT),
+ rule_failure_domain(DEFAULT_RULE_FAILURE_DOMAIN),
matrix(0)
{}
~ErasureCodeShec() override {}
- int create_ruleset(const string &name,
- CrushWrapper &crush,
- ostream *ss) const override;
+ int create_rule(const string &name,
+ CrushWrapper &crush,
+ ostream *ss) const override;
unsigned int get_chunk_count() const override {
return k + m;
<< "required " << ceph_release_name(mv);
pending_inc.new_require_min_compat_client = mv;
}
+
+ if (osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) {
+ // convert ec profile ruleset-* -> crush-*
+ for (auto& p : tmp.erasure_code_profiles) {
+ bool changed = false;
+ map<string,string> newprofile;
+ for (auto& q : p.second) {
+ if (q.first.find("ruleset-") == 0) {
+ string key = "crush-";
+ key += q.first.substr(8);
+ newprofile[key] = q.second;
+ changed = true;
+ dout(20) << " updating ec profile " << p.first
+ << " key " << q.first << " -> " << key << dendl;
+ } else {
+ newprofile[q.first] = q.second;
+ }
+ }
+ if (changed) {
+ dout(10) << " updated ec profile " << p.first << ": "
+ << newprofile << dendl;
+ pending_inc.new_erasure_code_profiles[p.first] = newprofile;
+ }
+ }
+ }
}
}
return err;
}
- err = erasure_code->create_ruleset(name, newcrush, ss);
+ err = erasure_code->create_rule(name, newcrush, ss);
erasure_code.reset();
if (err < 0)
return err;
print("Created Replicated pool #{repid}".format(repid=REPID))
- cmd = "{path}/ceph osd erasure-code-profile set {prof} ruleset-failure-domain=osd".format(prof=PROFNAME, path=CEPH_BIN)
+ cmd = "{path}/ceph osd erasure-code-profile set {prof} crush-failure-domain=osd".format(prof=PROFNAME, path=CEPH_BIN)
logging.debug(cmd)
call(cmd, shell=True, stdout=nullfd, stderr=nullfd)
cmd = "{path}/ceph osd erasure-code-profile get {prof}".format(prof=PROFNAME, path=CEPH_BIN)
public:
~ErasureCodeExample() override {}
- int create_ruleset(const string &name,
+ int create_rule(const string &name,
CrushWrapper &crush,
ostream *ss) const override {
return crush.add_simple_rule(name, "default", "host", "",
encode_chunks_encoded = *encoded;
return 0;
}
- int create_ruleset(const string &name,
- CrushWrapper &crush,
- ostream *ss) const override { return 0; }
-
+ int create_rule(const string &name,
+ CrushWrapper &crush,
+ ostream *ss) const override { return 0; }
};
/*
EXPECT_EQ(-ERANGE, example.decode_concat(degraded, &out));
}
-TEST(ErasureCodeExample, create_ruleset)
+TEST(ErasureCodeExample, create_rule)
{
CrushWrapper *c = new CrushWrapper;
c->create();
stringstream ss;
ErasureCodeExample example;
- EXPECT_EQ(0, example.create_ruleset("myrule", *c, &ss));
+ EXPECT_EQ(0, example.create_rule("myrule", *c, &ss));
}
/*
EXPECT_EQ(5, cnt_cf);
}
-TEST_F(IsaErasureCodeTest, create_ruleset)
+TEST_F(IsaErasureCodeTest, create_rule)
{
CrushWrapper *c = new CrushWrapper;
c->create();
profile["m"] = "2";
profile["w"] = "8";
isa.init(profile, &cerr);
- int ruleset = isa.create_ruleset("myrule", *c, &ss);
+ int ruleset = isa.create_rule("myrule", *c, &ss);
EXPECT_EQ(0, ruleset);
- EXPECT_EQ(-EEXIST, isa.create_ruleset("myrule", *c, &ss));
+ EXPECT_EQ(-EEXIST, isa.create_rule("myrule", *c, &ss));
//
// the minimum that is expected from the created ruleset is to
// successfully map get_chunk_count() devices from the crushmap,
profile["k"] = "2";
profile["m"] = "2";
profile["w"] = "8";
- profile["ruleset-root"] = "BAD";
+ profile["crush-root"] = "BAD";
isa.init(profile, &cerr);
- EXPECT_EQ(-ENOENT, isa.create_ruleset("otherrule", *c, &ss));
+ EXPECT_EQ(-ENOENT, isa.create_rule("otherrule", *c, &ss));
EXPECT_EQ("root item BAD does not exist", ss.str());
}
{
profile["k"] = "2";
profile["m"] = "2";
profile["w"] = "8";
- profile["ruleset-failure-domain"] = "WORSE";
+ profile["crush-failure-domain"] = "WORSE";
isa.init(profile, &cerr);
- EXPECT_EQ(-EINVAL, isa.create_ruleset("otherrule", *c, &ss));
+ EXPECT_EQ(-EINVAL, isa.create_rule("otherrule", *c, &ss));
EXPECT_EQ("unknown type WORSE", ss.str());
}
}
}
}
-TEST(ErasureCodeTest, create_ruleset)
+TEST(ErasureCodeTest, create_rule)
{
CrushWrapper *c = new CrushWrapper;
c->create();
profile["m"] = "2";
profile["w"] = "8";
jerasure.init(profile, &cerr);
- int ruleset = jerasure.create_ruleset("myrule", *c, &ss);
+ int ruleset = jerasure.create_rule("myrule", *c, &ss);
EXPECT_EQ(0, ruleset);
- EXPECT_EQ(-EEXIST, jerasure.create_ruleset("myrule", *c, &ss));
+ EXPECT_EQ(-EEXIST, jerasure.create_rule("myrule", *c, &ss));
//
// the minimum that is expected from the created ruleset is to
// successfully map get_chunk_count() devices from the crushmap,
profile["k"] = "2";
profile["m"] = "2";
profile["w"] = "8";
- profile["ruleset-root"] = "BAD";
+ profile["crush-root"] = "BAD";
jerasure.init(profile, &cerr);
- EXPECT_EQ(-ENOENT, jerasure.create_ruleset("otherrule", *c, &ss));
+ EXPECT_EQ(-ENOENT, jerasure.create_rule("otherrule", *c, &ss));
EXPECT_EQ("root item BAD does not exist", ss.str());
}
{
profile["k"] = "2";
profile["m"] = "2";
profile["w"] = "8";
- profile["ruleset-failure-domain"] = "WORSE";
+ profile["crush-failure-domain"] = "WORSE";
jerasure.init(profile, &cerr);
- EXPECT_EQ(-EINVAL, jerasure.create_ruleset("otherrule", *c, &ss));
+ EXPECT_EQ(-EINVAL, jerasure.create_rule("otherrule", *c, &ss));
EXPECT_EQ("unknown type WORSE", ss.str());
}
}
#include "gtest/gtest.h"
-TEST(ErasureCodeLrc, parse_ruleset)
+TEST(ErasureCodeLrc, parse_rule)
{
ErasureCodeLrc lrc(g_conf->get_val<std::string>("erasure_code_dir"));
- EXPECT_EQ("default", lrc.ruleset_root);
- EXPECT_EQ("host", lrc.ruleset_steps.front().type);
+ EXPECT_EQ("default", lrc.rule_root);
+ EXPECT_EQ("host", lrc.rule_steps.front().type);
ErasureCodeProfile profile;
- profile["ruleset-root"] = "other";
- EXPECT_EQ(0, lrc.parse_ruleset(profile, &cerr));
- EXPECT_EQ("other", lrc.ruleset_root);
+ profile["crush-root"] = "other";
+ EXPECT_EQ(0, lrc.parse_rule(profile, &cerr));
+ EXPECT_EQ("other", lrc.rule_root);
- profile["ruleset-steps"] = "[]";
- EXPECT_EQ(0, lrc.parse_ruleset(profile, &cerr));
- EXPECT_TRUE(lrc.ruleset_steps.empty());
+ profile["crush-steps"] = "[]";
+ EXPECT_EQ(0, lrc.parse_rule(profile, &cerr));
+ EXPECT_TRUE(lrc.rule_steps.empty());
- profile["ruleset-steps"] = "0";
- EXPECT_EQ(ERROR_LRC_ARRAY, lrc.parse_ruleset(profile, &cerr));
+ profile["crush-steps"] = "0";
+ EXPECT_EQ(ERROR_LRC_ARRAY, lrc.parse_rule(profile, &cerr));
- profile["ruleset-steps"] = "{";
- EXPECT_EQ(ERROR_LRC_PARSE_JSON, lrc.parse_ruleset(profile, &cerr));
+ profile["crush-steps"] = "{";
+ EXPECT_EQ(ERROR_LRC_PARSE_JSON, lrc.parse_rule(profile, &cerr));
- profile["ruleset-steps"] = "[0]";
- EXPECT_EQ(ERROR_LRC_ARRAY, lrc.parse_ruleset(profile, &cerr));
+ profile["crush-steps"] = "[0]";
+ EXPECT_EQ(ERROR_LRC_ARRAY, lrc.parse_rule(profile, &cerr));
- profile["ruleset-steps"] = "[[0]]";
- EXPECT_EQ(ERROR_LRC_RULESET_OP, lrc.parse_ruleset(profile, &cerr));
+ profile["crush-steps"] = "[[0]]";
+ EXPECT_EQ(ERROR_LRC_RULE_OP, lrc.parse_rule(profile, &cerr));
- profile["ruleset-steps"] = "[[\"choose\", 0]]";
- EXPECT_EQ(ERROR_LRC_RULESET_TYPE, lrc.parse_ruleset(profile, &cerr));
+ profile["crush-steps"] = "[[\"choose\", 0]]";
+ EXPECT_EQ(ERROR_LRC_RULE_TYPE, lrc.parse_rule(profile, &cerr));
- profile["ruleset-steps"] = "[[\"choose\", \"host\", []]]";
- EXPECT_EQ(ERROR_LRC_RULESET_N, lrc.parse_ruleset(profile, &cerr));
+ profile["crush-steps"] = "[[\"choose\", \"host\", []]]";
+ EXPECT_EQ(ERROR_LRC_RULE_N, lrc.parse_rule(profile, &cerr));
- profile["ruleset-steps"] = "[[\"choose\", \"host\", 2]]";
- EXPECT_EQ(0, lrc.parse_ruleset(profile, &cerr));
+ profile["crush-steps"] = "[[\"choose\", \"host\", 2]]";
+ EXPECT_EQ(0, lrc.parse_rule(profile, &cerr));
- const ErasureCodeLrc::Step &step = lrc.ruleset_steps.front();
+ const ErasureCodeLrc::Step &step = lrc.rule_steps.front();
EXPECT_EQ("choose", step.op);
EXPECT_EQ("host", step.type);
EXPECT_EQ(2, step.n);
- profile["ruleset-steps"] =
+ profile["crush-steps"] =
"["
" [\"choose\", \"rack\", 2], "
" [\"chooseleaf\", \"host\", 5], "
"]";
- EXPECT_EQ(0, lrc.parse_ruleset(profile, &cerr));
- EXPECT_EQ(2U, lrc.ruleset_steps.size());
+ EXPECT_EQ(0, lrc.parse_rule(profile, &cerr));
+ EXPECT_EQ(2U, lrc.rule_steps.size());
{
- const ErasureCodeLrc::Step &step = lrc.ruleset_steps[0];
+ const ErasureCodeLrc::Step &step = lrc.rule_steps[0];
EXPECT_EQ("choose", step.op);
EXPECT_EQ("rack", step.type);
EXPECT_EQ(2, step.n);
}
{
- const ErasureCodeLrc::Step &step = lrc.ruleset_steps[1];
+ const ErasureCodeLrc::Step &step = lrc.rule_steps[1];
EXPECT_EQ("chooseleaf", step.op);
EXPECT_EQ("host", step.type);
EXPECT_EQ(5, step.n);
}
}
-TEST(ErasureCodeTest, create_ruleset)
+TEST(ErasureCodeTest, create_rule)
{
CrushWrapper *c = new CrushWrapper;
c->create();
c->finalize();
ErasureCodeLrc lrc(g_conf->get_val<std::string>("erasure_code_dir"));
- EXPECT_EQ(0, lrc.create_ruleset("rule1", *c, &cerr));
+ EXPECT_EQ(0, lrc.create_rule("rule1", *c, &cerr));
ErasureCodeProfile profile;
unsigned int racks = 2;
unsigned int hosts = 5;
- profile["ruleset-steps"] =
+ profile["crush-steps"] =
"["
" [\"choose\", \"rack\", " + stringify(racks) + "], "
" [\"chooseleaf\", \"host\", " + stringify(hosts) + "], "
"]";
const char *rule_name = "rule2";
- EXPECT_EQ(0, lrc.parse_ruleset(profile, &cerr));
- EXPECT_EQ(1, lrc.create_ruleset(rule_name, *c, &cerr));
+ EXPECT_EQ(0, lrc.parse_rule(profile, &cerr));
+ EXPECT_EQ(1, lrc.create_rule(rule_name, *c, &cerr));
vector<__u32> weight;
for (int o = 0; o < c->get_max_devices(); o++)
EXPECT_EQ(ERROR_LRC_ALL_OR_NOTHING, lrc.parse_kml(profile, &cerr));
const char *generated[] = { "mapping",
"layers",
- "ruleset-steps" };
+ "crush-steps" };
profile["m"] = "2";
profile["l"] = "3";
" [ \"____DDDc\", \"\" ],"
"]", profile["layers"]);
EXPECT_EQ("DD__DD__", profile["mapping"]);
- EXPECT_EQ("chooseleaf", lrc.ruleset_steps[0].op);
- EXPECT_EQ("host", lrc.ruleset_steps[0].type);
- EXPECT_EQ(0, lrc.ruleset_steps[0].n);
- EXPECT_EQ(1U, lrc.ruleset_steps.size());
+ EXPECT_EQ("chooseleaf", lrc.rule_steps[0].op);
+ EXPECT_EQ("host", lrc.rule_steps[0].type);
+ EXPECT_EQ(0, lrc.rule_steps[0].n);
+ EXPECT_EQ(1U, lrc.rule_steps.size());
profile.erase(profile.find("mapping"));
profile.erase(profile.find("layers"));
profile["k"] = "4";
profile["m"] = "2";
profile["l"] = "3";
- profile["ruleset-failure-domain"] = "osd";
+ profile["crush-failure-domain"] = "osd";
EXPECT_EQ(0, lrc.parse_kml(profile, &cerr));
- EXPECT_EQ("chooseleaf", lrc.ruleset_steps[0].op);
- EXPECT_EQ("osd", lrc.ruleset_steps[0].type);
- EXPECT_EQ(0, lrc.ruleset_steps[0].n);
- EXPECT_EQ(1U, lrc.ruleset_steps.size());
+ EXPECT_EQ("chooseleaf", lrc.rule_steps[0].op);
+ EXPECT_EQ("osd", lrc.rule_steps[0].type);
+ EXPECT_EQ(0, lrc.rule_steps[0].n);
+ EXPECT_EQ(1U, lrc.rule_steps.size());
profile.erase(profile.find("mapping"));
profile.erase(profile.find("layers"));
profile["k"] = "4";
profile["m"] = "2";
profile["l"] = "3";
- profile["ruleset-failure-domain"] = "osd";
- profile["ruleset-locality"] = "rack";
+ profile["crush-failure-domain"] = "osd";
+ profile["crush-locality"] = "rack";
EXPECT_EQ(0, lrc.parse_kml(profile, &cerr));
- EXPECT_EQ("choose", lrc.ruleset_steps[0].op);
- EXPECT_EQ("rack", lrc.ruleset_steps[0].type);
- EXPECT_EQ(2, lrc.ruleset_steps[0].n);
- EXPECT_EQ("chooseleaf", lrc.ruleset_steps[1].op);
- EXPECT_EQ("osd", lrc.ruleset_steps[1].type);
- EXPECT_EQ(4, lrc.ruleset_steps[1].n);
- EXPECT_EQ(2U, lrc.ruleset_steps.size());
+ EXPECT_EQ("choose", lrc.rule_steps[0].op);
+ EXPECT_EQ("rack", lrc.rule_steps[0].type);
+ EXPECT_EQ(2, lrc.rule_steps[0].n);
+ EXPECT_EQ("chooseleaf", lrc.rule_steps[1].op);
+ EXPECT_EQ("osd", lrc.rule_steps[1].type);
+ EXPECT_EQ(4, lrc.rule_steps[1].n);
+ EXPECT_EQ(2U, lrc.rule_steps.size());
profile.erase(profile.find("mapping"));
profile.erase(profile.find("layers"));
}
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
EXPECT_EQ(2, shec->c);
EXPECT_EQ(8, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("default", shec->ruleset_root.c_str());
- EXPECT_STREQ("osd", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("default", shec->rule_root.c_str());
+ EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-root"] = "test";
- (*profile)["ruleset-failure-domain"] = "host";
+ (*profile)["crush-root"] = "test";
+ (*profile)["crush-failure-domain"] = "host";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
EXPECT_EQ(2, shec->c);
EXPECT_EQ(8, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("test", shec->ruleset_root.c_str());
- EXPECT_STREQ("host", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("test", shec->rule_root.c_str());
+ EXPECT_STREQ("host", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
EXPECT_EQ(2, shec->c);
EXPECT_EQ(16, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("default", shec->ruleset_root.c_str());
- EXPECT_STREQ("osd", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("default", shec->rule_root.c_str());
+ EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
EXPECT_EQ(2, shec->c);
EXPECT_EQ(32, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("default", shec->ruleset_root.c_str());
- EXPECT_STREQ("osd", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("default", shec->rule_root.c_str());
+ EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
ErasureCodeProfile *profile = new ErasureCodeProfile();
//plugin is not specified
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "jerasure"; //unexpected value
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "abc"; //unexpected value
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-root"] = "abc"; //unexpected value
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-root"] = "abc"; //unexpected value
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "abc"; //unexpected value
+ (*profile)["crush-failure-domain"] = "abc"; //unexpected value
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "abc"; //unexpected value
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "-1"; //unexpected value
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "abc";
+ (*profile)["crush-failure-domain"] = "abc";
(*profile)["k"] = "0.1"; //unexpected value
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "a"; //unexpected value
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
//k is not specified
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "-1"; //unexpected value
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "0.1"; //unexpected value
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "a"; //unexpected value
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
//m is not specified
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "-1"; //unexpected value
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "0.1"; //unexpected value
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "a"; //unexpected value
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
//c is not specified
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "10"; //c > m
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
//k is not specified
//m is not specified
//c is not specified
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "12";
(*profile)["m"] = "8";
(*profile)["c"] = "8";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "13";
(*profile)["m"] = "7";
(*profile)["c"] = "7";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "7";
(*profile)["m"] = "13";
(*profile)["c"] = "13";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "12";
(*profile)["m"] = "9";
(*profile)["c"] = "8";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "8";
(*profile)["m"] = "12";
(*profile)["c"] = "12";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
EXPECT_EQ(2, shec->c);
EXPECT_EQ(8, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("default", shec->ruleset_root.c_str());
- EXPECT_STREQ("osd", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("default", shec->rule_root.c_str());
+ EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
ErasureCodeProfile *profile2 = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "host";
+ (*profile)["crush-failure-domain"] = "host";
(*profile)["k"] = "10";
(*profile)["m"] = "6";
(*profile)["c"] = "5";
//reexecute init
(*profile2)["plugin"] = "shec";
(*profile2)["technique"] = "";
- (*profile2)["ruleset-failure-domain"] = "osd";
+ (*profile2)["crush-failure-domain"] = "osd";
(*profile2)["k"] = "4";
(*profile2)["m"] = "3";
(*profile2)["c"] = "2";
EXPECT_EQ(2, shec->c);
EXPECT_EQ(8, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("default", shec->ruleset_root.c_str());
- EXPECT_STREQ("osd", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("default", shec->rule_root.c_str());
+ EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
delete profile;
}
-TEST(ErasureCodeShec, create_ruleset_1_2)
+TEST(ErasureCodeShec, create_rule_1_2)
{
//create ruleset
CrushWrapper *crush = new CrushWrapper;
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
shec->init(*profile, &cerr);
- //create_ruleset
+ //create_rule
stringstream ss;
- int r = shec->create_ruleset("myrule", *crush, &ss);
+ int r = shec->create_rule("myrule", *crush, &ss);
EXPECT_EQ(0, r);
EXPECT_STREQ("myrule", crush->rule_name_map[0].c_str());
- //reexecute create_ruleset
- r = shec->create_ruleset("myrule", *crush, &ss);
+ //reexecute create_rule
+ r = shec->create_rule("myrule", *crush, &ss);
EXPECT_EQ(-EEXIST, r);
delete shec;
delete crush;
}
-TEST(ErasureCodeShec, create_ruleset_4)
+TEST(ErasureCodeShec, create_rule_4)
{
//create ruleset
CrushWrapper *crush = new CrushWrapper;
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
shec->init(*profile, &cerr);
- //create_ruleset
- int r = shec->create_ruleset("myrule", *crush, NULL); //ss = NULL
+ //create_rule
+ int r = shec->create_rule("myrule", *crush, NULL); //ss = NULL
EXPECT_EQ(0, r);
delete shec;
delete crush;
}
-TEST(ErasureCodeShec, create_ruleset2_1)
+TEST(ErasureCodeShec, create_rule2_1)
{
//create ruleset
CrushWrapper *crush = new CrushWrapper;
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
shec->init(*profile, &cerr);
- //create_ruleset
+ //create_rule
stringstream ss;
- int r = shec->create_ruleset("myrule", *crush, &ss);
+ int r = shec->create_rule("myrule", *crush, &ss);
EXPECT_EQ(0, r);
EXPECT_STREQ("myrule", crush->rule_name_map[0].c_str());
CrushWrapper *crush;
};
-TEST(ErasureCodeShec, create_ruleset2_3)
+TEST(ErasureCodeShec, create_rule2_3)
{
//create ruleset
CrushWrapper *crush = new CrushWrapper;
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
shec->init(*profile, &cerr);
- //create_ruleset
+ //create_rule
stringstream ss;
pthread_t tid;
}
sleep(1);
printf("*** test start ***\n");
- int r = (shec->create_ruleset("myrule", *crush, &ss));
+ int r = (shec->create_rule("myrule", *crush, &ss));
EXPECT_TRUE(r >= 0);
printf("*** test end ***\n");
g_flag = 0;
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = "4";
(*profile)["m"] = "3";
(*profile)["c"] = "2";
g_flag = 1;
while (g_flag == 1) {
sprintf(name, "myrule%d", i);
- shec->create_ruleset(name, *crush, &ss);
+ shec->create_rule(name, *crush, &ss);
++i;
}
printf("*** thread loop end ***\n");
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = k;
(*profile)["m"] = m;
(*profile)["c"] = c;
EXPECT_EQ(i_c, shec->c);
EXPECT_EQ(8, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("default", shec->ruleset_root.c_str());
- EXPECT_STREQ("osd", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("default", shec->rule_root.c_str());
+ EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, result);
EXPECT_FALSE(out1 == in);
EXPECT_TRUE(usable == in);
- //create_ruleset
+ //create_rule
stringstream ss;
CrushWrapper *crush = new CrushWrapper;
crush->create();
}
}
- result = shec->create_ruleset("myrule", *crush, &ss);
+ result = shec->create_rule("myrule", *crush, &ss);
EXPECT_EQ(0, result);
EXPECT_STREQ("myrule", crush->rule_name_map[0].c_str());
std::string>();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = k;
(*profile)["m"] = m;
(*profile)["c"] = c;
EXPECT_EQ(i_c, shec->c);
EXPECT_EQ(8, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("default", shec->ruleset_root.c_str());
- EXPECT_STREQ("osd", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("default", shec->rule_root.c_str());
+ EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, result);
ErasureCodeProfile *profile = new ErasureCodeProfile();
(*profile)["plugin"] = "shec";
(*profile)["technique"] = "multiple";
- (*profile)["ruleset-failure-domain"] = "osd";
+ (*profile)["crush-failure-domain"] = "osd";
(*profile)["k"] = param->k;
(*profile)["m"] = param->m;
(*profile)["c"] = param->c;
EXPECT_EQ(i_c, shec->c);
EXPECT_EQ(i_w, shec->w);
EXPECT_EQ(ErasureCodeShec::MULTIPLE, shec->technique);
- EXPECT_STREQ("default", shec->ruleset_root.c_str());
- EXPECT_STREQ("osd", shec->ruleset_failure_domain.c_str());
+ EXPECT_STREQ("default", shec->rule_root.c_str());
+ EXPECT_STREQ("osd", shec->rule_failure_domain.c_str());
EXPECT_TRUE(shec->matrix != NULL);
if ((shec->matrix == NULL)) {
std::cout << "matrix is null" << std::endl;
wait_for_clean || return 1
for plugin in ${legacy_jerasure_plugins[*]}; do
- ceph osd erasure-code-profile set prof-${plugin} ruleset-failure-domain=osd technique=reed_sol_van plugin=${plugin} || return 1
+ ceph osd erasure-code-profile set prof-${plugin} crush-failure-domain=osd technique=reed_sol_van plugin=${plugin} || return 1
CEPH_ARGS='' ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
grep "WARNING: erasure coding profile prof-${plugin} uses plugin ${plugin}" $dir/mon.a.log || return 1
done
for plugin in ${legacy_shec_plugins[*]}; do
- ceph osd erasure-code-profile set prof-${plugin} ruleset-failure-domain=osd plugin=${plugin} || return 1
+ ceph osd erasure-code-profile set prof-${plugin} crush-failure-domain=osd plugin=${plugin} || return 1
CEPH_ARGS='' ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
grep "WARNING: erasure coding profile prof-${plugin} uses plugin ${plugin}" $dir/mon.a.log || return 1
done
local poolname=$1
ceph osd erasure-code-profile set myprofile \
- ruleset-failure-domain=osd || return 1
+ crush-failure-domain=osd || return 1
ceph osd pool create $poolname 12 12 erasure myprofile \
|| return 1
wait_for_clean || return 1
ceph osd erasure-code-profile set $profile \
plugin=lrc \
mapping=DD_ \
- ruleset-steps='[ [ "chooseleaf", "osd", 0 ] ]' \
+ crush-steps='[ [ "chooseleaf", "osd", 0 ] ]' \
layers='[ [ "DDc", "" ] ]' || return 1
ceph osd pool create $poolname 12 12 erasure $profile \
|| return 1
ceph osd erasure-code-profile set $profile \
plugin=lrc \
k=4 m=2 l=3 \
- ruleset-failure-domain=osd || return 1
+ crush-failure-domain=osd || return 1
ceph osd pool create $poolname 12 12 erasure $profile \
|| return 1
ceph osd erasure-code-profile set profile-isa \
plugin=isa \
- ruleset-failure-domain=osd || return 1
+ crush-failure-domain=osd || return 1
ceph osd pool create $poolname 1 1 erasure profile-isa \
|| return 1
ceph osd erasure-code-profile set $profile \
plugin=jerasure \
k=4 m=2 \
- ruleset-failure-domain=osd || return 1
+ crush-failure-domain=osd || return 1
ceph osd pool create $poolname 12 12 erasure $profile \
|| return 1
ceph osd erasure-code-profile set $profile \
plugin=shec \
k=2 m=1 c=1 \
- ruleset-failure-domain=osd || return 1
+ crush-failure-domain=osd || return 1
ceph osd pool create $poolname 12 12 erasure $profile \
|| return 1
plugin=lrc \
layers='[ [ "_DD", "" ] ]' \
mapping='_DD' \
- ruleset-steps='[ [ "choose", "osd", 0 ] ]' || return 1
+ crush-steps='[ [ "choose", "osd", 0 ] ]' || return 1
ceph osd erasure-code-profile get remap-profile
ceph osd pool create remap-pool 12 12 erasure remap-profile \
|| return 1
ceph osd erasure-code-profile set myprofile \
plugin=jerasure \
k=2 m=1 \
- ruleset-failure-domain=osd || return 1
+ crush-failure-domain=osd || return 1
ceph osd pool create $poolname 1 1 erasure myprofile \
|| return 1
wait_for_clean || return 1
char *cmd[2];
cmd[1] = NULL;
- std::string profile_create = "{\"prefix\": \"osd erasure-code-profile set\", \"name\": \"testprofile-" + pool_name + "\", \"profile\": [ \"k=2\", \"m=1\", \"ruleset-failure-domain=osd\"]}";
+ std::string profile_create = "{\"prefix\": \"osd erasure-code-profile set\", \"name\": \"testprofile-" + pool_name + "\", \"profile\": [ \"k=2\", \"m=1\", \"crush-failure-domain=osd\"]}";
cmd[0] = (char *)profile_create.c_str();
ret = rados_mon_command(*cluster, (const char **)cmd, 1, "", 0, NULL, 0, NULL, 0);
if (ret) {
bufferlist inbl;
ret = cluster.mon_command(
- "{\"prefix\": \"osd erasure-code-profile set\", \"name\": \"testprofile-" + pool_name + "\", \"profile\": [ \"k=2\", \"m=1\", \"ruleset-failure-domain=osd\"]}",
+ "{\"prefix\": \"osd erasure-code-profile set\", \"name\": \"testprofile-" + pool_name + "\", \"profile\": [ \"k=2\", \"m=1\", \"crush-failure-domain=osd\"]}",
inbl, NULL, NULL);
if (ret) {
cluster.shutdown();
#
profile=profileidempotent1
! ceph osd erasure-code-profile ls | grep $profile || return 1
- ceph osd erasure-code-profile set $profile k=2 ruleset-failure-domain=osd 2>&1 || return 1
+ ceph osd erasure-code-profile set $profile k=2 crush-failure-domain=osd 2>&1 || return 1
ceph osd erasure-code-profile ls | grep $profile || return 1
- ceph osd erasure-code-profile set $profile k=2 ruleset-failure-domain=osd 2>&1 || return 1
+ ceph osd erasure-code-profile set $profile k=2 crush-failure-domain=osd 2>&1 || return 1
ceph osd erasure-code-profile rm $profile # cleanup
#
#
profile=profileidempotent2
! ceph osd erasure-code-profile ls | grep $profile || return 1
- ceph osd erasure-code-profile set $profile plugin=lrc k=4 m=2 l=3 ruleset-failure-domain=osd 2>&1 || return 1
+ ceph osd erasure-code-profile set $profile plugin=lrc k=4 m=2 l=3 crush-failure-domain=osd 2>&1 || return 1
ceph osd erasure-code-profile ls | grep $profile || return 1
- ceph osd erasure-code-profile set $profile plugin=lrc k=4 m=2 l=3 ruleset-failure-domain=osd 2>&1 || return 1
+ ceph osd erasure-code-profile set $profile plugin=lrc k=4 m=2 l=3 crush-failure-domain=osd 2>&1 || return 1
ceph osd erasure-code-profile rm $profile # cleanup
}
bufferlist inbl;
int ret;
ret = cluster.mon_command(
- "{\"prefix\": \"osd erasure-code-profile set\", \"name\": \"testprofile\", \"profile\": [ \"k=2\", \"m=1\", \"ruleset-failure-domain=osd\"]}",
+ "{\"prefix\": \"osd erasure-code-profile set\", \"name\": \"testprofile\", \"profile\": [ \"k=2\", \"m=1\", \"crush-failure-domain=osd\"]}",
inbl, NULL, &outs);
if (ret < 0) {
std::cerr << "mon_command erasure-code-profile set failed with " << ret << std::endl;
local pool_name=$1
local allow_overwrites=$2
- ceph osd erasure-code-profile set myprofile ruleset-failure-domain=osd $3 $4 $5 $6 $7 || return 1
+ ceph osd erasure-code-profile set myprofile crush-failure-domain=osd $3 $4 $5 $6 $7 || return 1
ceph osd pool create "$poolname" 1 1 erasure myprofile || return 1
mon data avail crit = 1
erasure code dir = $EC_PATH
plugin dir = $CEPH_LIB
- osd pool default erasure code profile = plugin=jerasure technique=reed_sol_van k=2 m=1 ruleset-failure-domain=osd
+ osd pool default erasure code profile = plugin=jerasure technique=reed_sol_van k=2 m=1 crush-failure-domain=osd
rgw frontends = $rgw_frontend port=$CEPH_RGW_PORT
; needed for s3tests
rgw crypt s3 kms encryption keys = testkey-1=YmluCmJvb3N0CmJvb3N0LWJ1aWxkCmNlcGguY29uZgo= testkey-2=aWIKTWFrZWZpbGUKbWFuCm91dApzcmMKVGVzdGluZwo=