]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: ruleset-* -> crush-*
authorSage Weil <sage@redhat.com>
Fri, 30 Jun 2017 18:59:39 +0000 (14:59 -0400)
committerSage Weil <sage@redhat.com>
Thu, 6 Jul 2017 19:01:03 +0000 (15:01 -0400)
1) ruleset is an obsolete term, and
2) crush-{rule,failure-domain,...} is more descriptive.

Note that we are changing the names of the erasure code profile keys
from ruleset-* to crush-*.  We will update this on upgrade when the
luminous flag is set, but that means that during mon upgrade you cannot
create EC pools that use these fields.

When the upgrade completes (users sets require_osd_release = luminous)
existing ec profiles are updated automatically.

Signed-off-by: Sage Weil <sage@redhat.com>
61 files changed:
doc/dev/erasure-coded-pool.rst
doc/dev/osd_internals/erasure_coding/developer_notes.rst
doc/rados/operations/erasure-code-isa.rst
doc/rados/operations/erasure-code-jerasure.rst
doc/rados/operations/erasure-code-lrc.rst
doc/rados/operations/erasure-code-shec.rst
doc/rados/operations/erasure-code.rst
doc/rados/operations/pools.rst
doc/rados/troubleshooting/troubleshooting-pg.rst
doc/release-notes.rst
qa/erasure-code/ec-rados-plugin=isa-k=2-m=1.yaml
qa/erasure-code/ec-rados-plugin=jerasure-k=2-m=1.yaml
qa/erasure-code/ec-rados-plugin=jerasure-k=3-m=1.yaml
qa/erasure-code/ec-rados-plugin=lrc-k=4-m=2-l=3.yaml
qa/erasure-code/ec-rados-plugin=shec-k=4-m=3-c=2.yaml
qa/rgw_pool_type/ec-profile.yaml
qa/suites/rados/thrash/workloads/cache-agent-big.yaml
qa/suites/rbd/cli/pool/ec-data-pool.yaml
qa/suites/rbd/librbd/pool/ec-data-pool.yaml
qa/suites/rbd/qemu/pool/ec-cache-pool.yaml
qa/suites/rbd/qemu/pool/ec-data-pool.yaml
qa/suites/upgrade/hammer-jewel-x/parallel/6-workload/ec-rados-default.yaml
qa/suites/upgrade/hammer-jewel-x/tiering/2-setup-cache-tiering/0-create-base-tier/create-ec-pool.yaml
qa/suites/upgrade/jewel-x/stress-split-erasure-code/7-final-workload/ec-rados-plugin=jerasure-k=3-m=1.yaml
qa/suites/upgrade/kraken-x/stress-split-erasure-code/7-final-workload.yaml
qa/tasks/ec_lost_unfound.py
qa/tasks/rados.py
qa/tasks/radosbench.py
qa/tasks/util/rados.py
qa/workunits/rados/test_alloc_hint.sh
qa/workunits/rados/test_rados_tool.sh
qa/workunits/rbd/krbd_data_pool.sh
src/erasure-code/ErasureCodeInterface.h
src/erasure-code/isa/ErasureCodeIsa.cc
src/erasure-code/isa/ErasureCodeIsa.h
src/erasure-code/jerasure/ErasureCodeJerasure.cc
src/erasure-code/jerasure/ErasureCodeJerasure.h
src/erasure-code/lrc/ErasureCodeLrc.cc
src/erasure-code/lrc/ErasureCodeLrc.h
src/erasure-code/shec/ErasureCodeShec.cc
src/erasure-code/shec/ErasureCodeShec.h
src/mon/OSDMonitor.cc
src/test/ceph_objectstore_tool.py
src/test/erasure-code/ErasureCodeExample.h
src/test/erasure-code/TestErasureCode.cc
src/test/erasure-code/TestErasureCodeExample.cc
src/test/erasure-code/TestErasureCodeIsa.cc
src/test/erasure-code/TestErasureCodeJerasure.cc
src/test/erasure-code/TestErasureCodeLrc.cc
src/test/erasure-code/TestErasureCodeShec.cc
src/test/erasure-code/TestErasureCodeShec_all.cc
src/test/erasure-code/TestErasureCodeShec_arguments.cc
src/test/erasure-code/TestErasureCodeShec_thread.cc
src/test/erasure-code/test-erasure-code-plugins.sh
src/test/erasure-code/test-erasure-code.sh
src/test/erasure-code/test-erasure-eio.sh
src/test/librados/test.cc
src/test/mon/osd-erasure-code-profile.sh
src/test/multi_stress_watch.cc
src/test/osd/osd-scrub-repair.sh
src/vstart.sh

index 0043e171bff450d1e313642f90e13f76739dab08..4694a7a8211c39d0ed18543115f5f40f94e7f2b4 100644 (file)
@@ -60,13 +60,13 @@ Set up an erasure-coded pool and the associated crush ruleset::
 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::
@@ -127,11 +127,11 @@ Remove a profile that is no longer in use (otherwise it will fail with EBUSY)::
 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
 
index a9ef9b55c61f0df50cfafdd8ff4ab7f2460c557e..770ff4a748d5f452abf1efa98668c911fa02cc5f 100644 (file)
@@ -166,14 +166,14 @@ key=value pairs stored in an `erasure code profile`_.
 ::
  
  $ 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
index 9d4ff7f52f0aa024a1e42207f9e286e345a00e2e..b52933ae8790b85ebd6bc0bccccd7a4008c51266 100644 (file)
@@ -16,8 +16,9 @@ To create a new *isa* erasure code profile::
              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]
 
@@ -55,7 +56,7 @@ Where:
 :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**.
@@ -64,7 +65,7 @@ Where:
 :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
@@ -76,6 +77,16 @@ Where:
 :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
index b0e6020cdf27a33fd7c26b1851cc56fc2ce5e6f0..e8da097c2c981e04b79fcddfa4de45d8b2880a47 100644 (file)
@@ -20,8 +20,9 @@ To create a new *jerasure* erasure code profile::
              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]
 
@@ -70,7 +71,7 @@ Where:
 :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**.
@@ -79,7 +80,7 @@ Where:
 :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
@@ -91,7 +92,17 @@ Where:
 :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.
index 3c9b269185a3a1552ead71071339850efcf90d15..447ce23abafc4c8885af754c9f09da62a313efa1 100644 (file)
@@ -27,7 +27,7 @@ observed.::
         $ 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
 
 
@@ -40,8 +40,8 @@ OSD is in the same rack as the lost chunk.::
         $ 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
 
 
@@ -55,9 +55,10 @@ To create a new lrc erasure code profile::
              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]
 
@@ -94,7 +95,7 @@ Where:
 :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**.
@@ -103,7 +104,7 @@ Where:
 :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
@@ -115,7 +116,7 @@ Where:
 :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
@@ -127,6 +128,16 @@ Where:
 :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
@@ -220,7 +231,7 @@ OSD is in the same rack as the lost chunk.::
                        [ "cDDD____", "" ],
                        [ "____cDDD", "" ],
                      ]' \
-             ruleset-steps='[
+             crush-steps='[
                              [ "choose", "rack", 2 ],
                              [ "chooseleaf", "host", 4 ],
                             ]'
@@ -351,7 +362,7 @@ racks.
 
 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
index 6c3b8486336f8391bdf93c147f78abaca9332ce9..e3bab376597269e4ca4a3f3bcc3a2cf6ce6e6988 100644 (file)
@@ -16,8 +16,9 @@ To create a new *shec* erasure code profile::
              [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]
 
@@ -52,7 +53,7 @@ Where:
 :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**.
@@ -61,7 +62,7 @@ Where:
 :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
@@ -73,6 +74,16 @@ Where:
 :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
@@ -129,5 +140,5 @@ Erasure code profile examples
         $ 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
index 568f26aec167049feb7e19ef18ed191e16813cb9..6ec5a097d50ffd8c3696ba6949d6d616abe4b217 100644 (file)
@@ -37,7 +37,7 @@ displayed with::
     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
@@ -45,7 +45,7 @@ after the pool is created: a new pool with a different profile needs
 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::
@@ -53,7 +53,7 @@ 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 -
@@ -62,7 +62,7 @@ the following profile can be defined::
 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::
index 7db41d6364abb599935c77b31b66331e10f38fe5..b93631d8ca82163b2fd934c2818d0f110fb81021 100644 (file)
@@ -57,9 +57,9 @@ For example::
 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: 
 
@@ -104,10 +104,10 @@ 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. 
index 4fddb389d394e4f02cae3243fdf2f9d441bab62e..e221344d171a51ee1abcb4d328bc2ec4f1eb2bb6 100644 (file)
@@ -516,7 +516,7 @@ ruleset::
 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
index 4246fd9fc554454446aec7028f7895d08f666ca3..73fa5b329b48ca249391b4b06bf0e27fb1380436 100644 (file)
@@ -309,6 +309,8 @@ Upgrade from Jewel or Kraken
 #. 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.)::
 
@@ -409,6 +411,15 @@ Upgrade compatibility notes, Kraken to Luminous
   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.
index f69963933c50a1fe8235d22e9bb44ce0d6980a62..64b59705c071e22de15c014ef8e4f3c5a7e6e3d1 100644 (file)
@@ -12,7 +12,7 @@ tasks:
       k: 2
       m: 1
       technique: reed_sol_van
-      ruleset-failure-domain: osd
+      crush-failure-domain: osd
     op_weights:
       read: 100
       write: 0
index 4fa8d9f35b20021010d1a13d2979302db66a30d3..d61b1c8affe24aa7aa6b47a8e2e7cb03e379d933 100644 (file)
@@ -11,7 +11,7 @@ tasks:
       k: 2
       m: 1
       technique: reed_sol_van
-      ruleset-failure-domain: osd
+      crush-failure-domain: osd
     op_weights:
       read: 100
       write: 0
index 3c31a8b30f45d90167d72d96ea5e670f04febd95..2ca53a799e29a21b20b2cb99825f0466a48b2f54 100644 (file)
@@ -17,7 +17,7 @@ tasks:
       k: 3
       m: 1
       technique: reed_sol_van
-      ruleset-failure-domain: osd
+      crush-failure-domain: osd
     op_weights:
       read: 100
       write: 0
index 3463a01acb5057268065839ba631bf497d2883a3..86ae0568c8843da93ea1efb601e994d54e30802a 100644 (file)
@@ -11,7 +11,7 @@ tasks:
       k: 4
       m: 2
       l: 3
-      ruleset-failure-domain: osd
+      crush-failure-domain: osd
     op_weights:
       read: 100
       write: 0
index 696baeddadf9ad71bd852249bd0c35ae485af34e..ee74c6e98d3dd5882f0a9cb939644bb96e67689b 100644 (file)
@@ -11,7 +11,7 @@ tasks:
       k: 4
       m: 3
       c: 2
-      ruleset-failure-domain: osd
+      crush-failure-domain: osd
     op_weights:
       read: 100
       write: 0
index 52798f85e72f5cb4fa971e1d082784957999a655..05384cb5309a5f5f4b51adc0ec3d701e7ae25311 100644 (file)
@@ -5,6 +5,6 @@ overrides:
       name: testprofile
       k: 3
       m: 1
-      ruleset-failure-domain: osd
+      crush-failure-domain: osd
   s3tests:
     slow_backend: true
index 047ee7c6c8094d775cb3b91dadc0f7f617403d7b..492ab8d458d546aaef64a1733595045ce5853c1f 100644 (file)
@@ -5,7 +5,7 @@ overrides:
 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
index 9558cc63a8cf04aa80a1a64a5a0723a75063f6c8..75dfc6a45534e26818a5632eabcb1ae8ad494ea4 100644 (file)
@@ -1,7 +1,7 @@
 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
 
index 9558cc63a8cf04aa80a1a64a5a0723a75063f6c8..75dfc6a45534e26818a5632eabcb1ae8ad494ea4 100644 (file)
@@ -1,7 +1,7 @@
 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
 
index 554aba3b5d0477e04323829f5af207409b0cc75f..80379a1026b7814064037dea1ea1655fa358e044 100644 (file)
@@ -1,7 +1,7 @@
 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
index 9558cc63a8cf04aa80a1a64a5a0723a75063f6c8..75dfc6a45534e26818a5632eabcb1ae8ad494ea4 100644 (file)
@@ -1,7 +1,7 @@
 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
 
index 15168a18648718e622bd404df51a2128e4a61d9d..98185415ed0e6b3df7ef606d28e3348615f83bae 100644 (file)
@@ -9,7 +9,7 @@ workload2:
         name: teuthologyprofile2
         k: 2
         m: 1
-        ruleset-failure-domain: osd
+        crush-failure-domain: osd
       clients: [client.0]
       ops: 4000
       objects: 50
index 9ab479d39bbb71429cd15aaa75e7e8412678b8ab..f0043afbdf18f4986dfc266e37538c82d4088829 100644 (file)
@@ -1,5 +1,5 @@
 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
index ab439d5216b1dc2c4d8407049e02c236b5916da8..a82f11be7850c88427027c21431ed7abce43e421 100644 (file)
@@ -21,7 +21,7 @@ tasks:
       k: 3
       m: 1
       technique: reed_sol_van
-      ruleset-failure-domain: osd
+      crush-failure-domain: osd
     op_weights:
       read: 100
       write: 0
index 8f5c95afc6a7f8f579acaf33b4ee32268581fdc5..50a1465072dcffc65a215d1d2b5d5b8abf6899b6 100644 (file)
@@ -21,7 +21,7 @@ tasks:
       k: 3
       m: 1
       technique: reed_sol_van
-      ruleset-failure-domain: osd
+      crush-failure-domain: osd
     op_weights:
       read: 100
       write: 0
index d7a55fcab6ab7de07bc3cf92a7270bf9c2489a44..cc0bdb25850d2cf5ed1344b6098ac24a9f4d38b9 100644 (file)
@@ -34,7 +34,7 @@ def task(ctx, config):
     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)
index 0732c0705ec2a8d42d3bfa388ffeee53ff3855d0..3ab93d6fb1a655aaa9578c80cf9b38032c2d805d 100644 (file)
@@ -62,7 +62,7 @@ def task(ctx, config):
               name: teuthologyprofile
               k: 2
               m: 1
-              ruleset-failure-domain: osd
+              crush-failure-domain: osd
             pool_snaps: true
            write_fadvise_dontneed: true
             runs: 10
index 88b7ae4994d941a4bd5542d02bd431dd34d1a38a..63683efebe62624d449f100786c1bbb6d055122e 100644 (file)
@@ -29,7 +29,7 @@ def task(ctx, config):
           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:
index 2d9d263d45f09f1c1dc033b215a634656d6e7aba..88ee45aa193e3db6019d432e0ef64f667b309e66 100644 (file)
@@ -57,7 +57,7 @@ def cmd_erasure_code_profile(profile_name, profile):
 
     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
@@ -71,7 +71,7 @@ def cmd_erasure_code_profile(profile_name, profile):
         profile = {
             'k': '2',
             'm': '1',
-            'ruleset-failure-domain': 'osd'
+            'crush-failure-domain': 'osd'
         }
     return [
         'osd', 'erasure-code-profile', 'set',
index b3e185adefd6e0ef3c12f2ad26b906ecdccfc99e..85be5d75c1ff8d693d8a5887c40f9403d8cbaa79 100755 (executable)
@@ -153,7 +153,7 @@ ceph osd pool delete "${POOL}" "${POOL}" --yes-i-really-really-mean-it
 
 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}"
 
index a792835d09995aaa0e83ebd31c765fe1ad25de70..6a3ebe0b22e2ddda1a0fedd0ef6b3834861bbac1 100755 (executable)
@@ -87,7 +87,7 @@ run_expect_nosignal "$RADOS_TOOL" --object_locator "asdf" ls
 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
 
 
index c3f48e3816dc800661ee8a609db38efee750b4a2..9c37ff2f81c54fdef47168db0c08b0ec035dbd20 100755 (executable)
@@ -99,7 +99,7 @@ function get_num_clones() {
 }
 
 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
index fbe9eea27260de8f22c870db73ea022de11f163c..2159ae1ce5d2e04e43b4777833c230b360f8bc98 100644 (file)
@@ -196,22 +196,22 @@ namespace ceph {
     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**
index bd6c37ecc2ce7132b15dd9a0842f78358dd92356..787acb6d7d3a55db0f1427d7486247794f3d7f7f 100644 (file)
@@ -47,14 +47,14 @@ const std::string ErasureCodeIsaDefault::DEFAULT_K("7");
 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,
@@ -64,7 +64,7 @@ ErasureCodeIsa::create_ruleset(const string &name,
     return ruleid;
   else {
     crush.set_rule_mask_max_size(ruleid, get_chunk_count());
-    return crush.get_rule_mask_ruleset(ruleid);
+    return ruleid;
   }
 }
 
@@ -74,12 +74,12 @@ int
 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;
index ccf8d8437ceb31f65bb4392bf1bd329bc55dedb1..bdf1197f857b5198f3117c5d74221b83cf5eccc6 100644 (file)
@@ -30,8 +30,8 @@
 #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:
@@ -46,8 +46,8 @@ 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) :
@@ -56,8 +56,8 @@ public:
   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)
   {
   }
 
@@ -66,9 +66,9 @@ public:
   {
   }
 
-  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
index 85858773de31c1308a1fa9df41b3c2916b5ef120..1db7d7e63b9900fd2afc2e0754603f3f9b27f37c 100644 (file)
@@ -42,18 +42,23 @@ static ostream& _prefix(std::ostream* _dout)
   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;
   }
 }
 
@@ -62,12 +67,12 @@ int ErasureCodeJerasure::init(ErasureCodeProfile& profile, ostream *ss)
   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;
index 5696c6e90c4fd92fb321c6a7af2e0ff6b98dd587..a0e7d7ab4869abfaeb428ea3ccb956aaa7ea4360 100644 (file)
@@ -20,8 +20,8 @@
 
 #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:
@@ -32,8 +32,8 @@ 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) :
@@ -44,16 +44,16 @@ public:
     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;
index 52dc2d8793470631cf1231ffae5481532acf5748..6a1080ea3c73e789d30217479d4a78745e4d4bd5 100644 (file)
@@ -43,7 +43,7 @@ static ostream& _prefix(std::ostream* _dout)
   return *_dout << "ErasureCodeLrc: ";
 }
 
-int ErasureCodeLrc::create_ruleset(const string &name,
+int ErasureCodeLrc::create_rule(const string &name,
                                   CrushWrapper &crush,
                                   ostream *ss) const
 {
@@ -51,25 +51,25 @@ int ErasureCodeLrc::create_ruleset(const string &name,
     *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;
@@ -82,8 +82,8 @@ int ErasureCodeLrc::create_ruleset(const string &name,
   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;
@@ -98,7 +98,7 @@ int ErasureCodeLrc::create_ruleset(const string &name,
   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,
@@ -275,7 +275,7 @@ int ErasureCodeLrc::parse(ErasureCodeProfile &profile,
   if (r)
     return r;
 
-  return parse_ruleset(profile, ss);
+  return parse_rule(profile, ss);
 }
 
 const string ErasureCodeLrc::DEFAULT_KML("-1");
@@ -302,7 +302,7 @@ int ErasureCodeLrc::parse_kml(ErasureCodeProfile &profile,
 
   const char *generated[] = { "mapping",
                              "layers",
-                             "ruleset-steps" };
+                             "crush-steps" };
 
   for (int i = 0; i < 3; i++) {
     if (profile.count(generated[i])) {
@@ -363,54 +363,54 @@ int ErasureCodeLrc::parse_kml(ErasureCodeProfile &profile,
   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;
@@ -429,7 +429,7 @@ int ErasureCodeLrc::parse_ruleset(ErasureCodeProfile &profile,
            << " 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;
     }
@@ -437,7 +437,7 @@ int ErasureCodeLrc::parse_ruleset(ErasureCodeProfile &profile,
   return 0;
 }
 
-int ErasureCodeLrc::parse_ruleset_step(string description_string,
+int ErasureCodeLrc::parse_rule_step(string description_string,
                                       json_spirit::mArray description,
                                       ostream *ss)
 {
@@ -456,14 +456,14 @@ int ErasureCodeLrc::parse_ruleset_step(string description_string,
          << 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)
@@ -473,7 +473,7 @@ int ErasureCodeLrc::parse_ruleset_step(string description_string,
     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;
 }
 
index fac4d54a5ab4d660d434645ff45cc99e994bc5fc..a92bff23986282f57dc61a2458ddfce05a8195d2 100644 (file)
@@ -35,9 +35,9 @@
 #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)
@@ -62,7 +62,7 @@ public:
   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),
@@ -72,13 +72,13 @@ public:
     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 {}
@@ -90,7 +90,7 @@ public:
                                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;
 
@@ -117,11 +117,11 @@ public:
 
   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,
index 66d7d2b8c5fc2eff86a88ac48c70cccb79493c23..f47127e0db9445723972a64080acf33d016982a3 100644 (file)
@@ -47,18 +47,23 @@ static ostream& _prefix(std::ostream* _dout)
   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;
   }
 }
 
@@ -66,12 +71,12 @@ int ErasureCodeShec::init(ErasureCodeProfile &profile,
                          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;
index 2974bce9d38cc02afd65d6e5f677f6d4ffbd1d69..fc580706e658ec51be45b500f792f133cb9ea790 100644 (file)
@@ -24,8 +24,8 @@
 #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 {
 
@@ -45,8 +45,8 @@ public:
   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,
@@ -61,16 +61,16 @@ public:
     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;
index 2c8a7e5dc59ccca4a7ad9de25d0d243468b1db89..8659560959c307b5f2653ba344b50a6fa6fdc845 100644 (file)
@@ -970,6 +970,31 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
                          << "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;
+         }
+       }
+      }
     }
   }
 
@@ -5243,7 +5268,7 @@ int OSDMonitor::crush_rule_create_erasure(const string &name,
       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;
index 6ed596c8283f812600a57a3b66126ee8414add37..52850523bb10991045d2f610ec8eeb50bae3f385 100755 (executable)
@@ -713,7 +713,7 @@ def main(argv):
 
     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)
index 5dbc73b383a9c4656f88cfe36665c525a548e650..e180f9c6b0bb5aa36305577e80a721f25e2f9ea2 100644 (file)
@@ -39,7 +39,7 @@ class ErasureCodeExample : public ErasureCode {
 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", "",
index 0bf01b05c3e15a0fa887414ab8663c371bb0d4fd..3e7d90cd58983d2966a548d6b2a027566cd2d2bf 100644 (file)
@@ -47,10 +47,9 @@ public:
     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; }
 };
 
 /*
index dab2dd700ae41116fd4b2fecce546e2465e83183..3367fa7b34bc2bd77c290751286a28e47e7e5675 100644 (file)
@@ -201,7 +201,7 @@ TEST(ErasureCodeExample, decode)
   EXPECT_EQ(-ERANGE, example.decode_concat(degraded, &out));
 }
 
-TEST(ErasureCodeExample, create_ruleset)
+TEST(ErasureCodeExample, create_rule)
 {
   CrushWrapper *c = new CrushWrapper;
   c->create();
@@ -229,7 +229,7 @@ TEST(ErasureCodeExample, create_ruleset)
 
   stringstream ss;
   ErasureCodeExample example;
-  EXPECT_EQ(0, example.create_ruleset("myrule", *c, &ss));
+  EXPECT_EQ(0, example.create_rule("myrule", *c, &ss));
 }
 
 /*
index 40295cf4a6419ae322d83639d7a8e08abb3d4375..828349c6ca3e98f7e41a1a9fecdac599ae9a1876 100644 (file)
@@ -874,7 +874,7 @@ TEST_F(IsaErasureCodeTest, isa_xor_codec)
   EXPECT_EQ(5, cnt_cf);
 }
 
-TEST_F(IsaErasureCodeTest, create_ruleset)
+TEST_F(IsaErasureCodeTest, create_rule)
 {
   CrushWrapper *c = new CrushWrapper;
   c->create();
@@ -913,9 +913,9 @@ TEST_F(IsaErasureCodeTest, create_ruleset)
     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,
@@ -936,9 +936,9 @@ TEST_F(IsaErasureCodeTest, create_ruleset)
     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());
   }
   {
@@ -948,9 +948,9 @@ TEST_F(IsaErasureCodeTest, create_ruleset)
     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());
   }
 }
index 0922e50a4bc191c44cbd9abfb3719f0cd44f0316..63fc536b1859e6a1f6e5f48de45db41e15f66242 100644 (file)
@@ -277,7 +277,7 @@ TEST(ErasureCodeTest, encode)
   }
 }
 
-TEST(ErasureCodeTest, create_ruleset)
+TEST(ErasureCodeTest, create_rule)
 {
   CrushWrapper *c = new CrushWrapper;
   c->create();
@@ -316,9 +316,9 @@ TEST(ErasureCodeTest, create_ruleset)
     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,
@@ -339,9 +339,9 @@ TEST(ErasureCodeTest, create_ruleset)
     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());
   }
   {
@@ -351,9 +351,9 @@ TEST(ErasureCodeTest, create_ruleset)
     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());
   }
 }
index 50543945e3a769bf55ecf082dc45a9620b313f45..72747a5a60bae069eece6afe2e774ce0d32e6bab 100644 (file)
 #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();
@@ -131,19 +131,19 @@ TEST(ErasureCodeTest, create_ruleset)
   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++)
@@ -178,7 +178,7 @@ TEST(ErasureCodeLrc, parse_kml)
   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";
 
@@ -208,38 +208,38 @@ TEST(ErasureCodeLrc, parse_kml)
            " [ \"____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"));
 }
index 8b2c8aa4eba52d80f791bfaf17554ac4d4afe0f6..fab8e7081de44ffd7a7cb817d0f9549021fbf39a 100644 (file)
@@ -48,7 +48,7 @@ TEST(ErasureCodeShec, init_1)
   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";
@@ -61,8 +61,8 @@ TEST(ErasureCodeShec, init_1)
   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);
 
@@ -80,8 +80,8 @@ TEST(ErasureCodeShec, init_2)
   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";
@@ -95,8 +95,8 @@ TEST(ErasureCodeShec, init_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);
 
@@ -114,7 +114,7 @@ TEST(ErasureCodeShec, init_3)
   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";
@@ -128,8 +128,8 @@ TEST(ErasureCodeShec, init_3)
   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);
 
@@ -147,7 +147,7 @@ TEST(ErasureCodeShec, init_4)
   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";
@@ -161,8 +161,8 @@ TEST(ErasureCodeShec, init_4)
   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);
 
@@ -179,7 +179,7 @@ TEST(ErasureCodeShec, init_5)
   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";
@@ -202,7 +202,7 @@ TEST(ErasureCodeShec, init_6)
   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";
@@ -225,7 +225,7 @@ TEST(ErasureCodeShec, init_7)
   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";
@@ -248,7 +248,7 @@ TEST(ErasureCodeShec, init_8)
   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";
@@ -271,8 +271,8 @@ TEST(ErasureCodeShec, init_9)
   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";
@@ -295,7 +295,7 @@ TEST(ErasureCodeShec, init_10)
   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";
@@ -318,7 +318,7 @@ TEST(ErasureCodeShec, init_11)
   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";
@@ -341,7 +341,7 @@ TEST(ErasureCodeShec, init_12)
   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";
@@ -363,7 +363,7 @@ TEST(ErasureCodeShec, init_13)
   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";
@@ -385,7 +385,7 @@ TEST(ErasureCodeShec, init_14)
   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";
@@ -407,7 +407,7 @@ TEST(ErasureCodeShec, init_15)
   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";
@@ -429,7 +429,7 @@ TEST(ErasureCodeShec, init_16)
   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";
@@ -451,7 +451,7 @@ TEST(ErasureCodeShec, init_17)
   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";
@@ -473,7 +473,7 @@ TEST(ErasureCodeShec, init_18)
   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";
@@ -495,7 +495,7 @@ TEST(ErasureCodeShec, init_19)
   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";
@@ -517,7 +517,7 @@ TEST(ErasureCodeShec, init_20)
   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
@@ -539,7 +539,7 @@ TEST(ErasureCodeShec, init_21)
   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
@@ -561,7 +561,7 @@ TEST(ErasureCodeShec, init_22)
   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
@@ -583,7 +583,7 @@ TEST(ErasureCodeShec, init_23)
   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
@@ -605,7 +605,7 @@ TEST(ErasureCodeShec, init_24)
   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";
@@ -634,7 +634,7 @@ TEST(ErasureCodeShec, init_25)
   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";
@@ -663,7 +663,7 @@ TEST(ErasureCodeShec, init_26)
   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";
@@ -692,7 +692,7 @@ TEST(ErasureCodeShec, init_27)
   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";
@@ -721,7 +721,7 @@ TEST(ErasureCodeShec, init_28)
   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
@@ -743,7 +743,7 @@ TEST(ErasureCodeShec, init_29)
   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
@@ -770,7 +770,7 @@ TEST(ErasureCodeShec, init_30)
   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";
@@ -796,7 +796,7 @@ TEST(ErasureCodeShec, init_31)
   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";
@@ -818,7 +818,7 @@ TEST(ErasureCodeShec, init_32)
   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";
@@ -840,7 +840,7 @@ TEST(ErasureCodeShec, init_33)
   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";
@@ -862,7 +862,7 @@ TEST(ErasureCodeShec, init_34)
   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";
@@ -885,7 +885,7 @@ TEST(ErasureCodeShec, init2_4)
   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";
@@ -898,8 +898,8 @@ TEST(ErasureCodeShec, init2_4)
   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);
 
@@ -918,7 +918,7 @@ TEST(ErasureCodeShec, init2_5)
   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";
@@ -929,7 +929,7 @@ TEST(ErasureCodeShec, init2_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";
@@ -940,8 +940,8 @@ TEST(ErasureCodeShec, init2_5)
   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);
 
@@ -959,7 +959,7 @@ TEST(ErasureCodeShec, minimum_to_decode_8)
   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";
@@ -995,7 +995,7 @@ TEST(ErasureCodeShec, minimum_to_decode_9)
   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";
@@ -1031,7 +1031,7 @@ TEST(ErasureCodeShec, minimum_to_decode_10)
   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";
@@ -1067,7 +1067,7 @@ TEST(ErasureCodeShec, minimum_to_decode_11)
   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";
@@ -1103,7 +1103,7 @@ TEST(ErasureCodeShec, minimum_to_decode_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";
@@ -1136,7 +1136,7 @@ TEST(ErasureCodeShec, minimum_to_decode_13)
   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";
@@ -1177,7 +1177,7 @@ TEST(ErasureCodeShec, minimum_to_decode2_1)
   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";
@@ -1213,7 +1213,7 @@ TEST(ErasureCodeShec, minimum_to_decode2_3)
   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";
@@ -1262,7 +1262,7 @@ TEST(ErasureCodeShec, minimum_to_decode_with_cost_1)
   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";
@@ -1298,7 +1298,7 @@ TEST(ErasureCodeShec, minimum_to_decode_with_cost_2_3)
   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";
@@ -1347,7 +1347,7 @@ TEST(ErasureCodeShec, encode_1)
   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";
@@ -1408,7 +1408,7 @@ TEST(ErasureCodeShec, encode_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";
@@ -1464,7 +1464,7 @@ TEST(ErasureCodeShec, encode_3)
   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";
@@ -1521,7 +1521,7 @@ TEST(ErasureCodeShec, encode_4)
   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";
@@ -1580,7 +1580,7 @@ TEST(ErasureCodeShec, encode_8)
   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";
@@ -1614,7 +1614,7 @@ TEST(ErasureCodeShec, encode_9)
   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";
@@ -1652,7 +1652,7 @@ TEST(ErasureCodeShec, encode2_1)
   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";
@@ -1711,7 +1711,7 @@ TEST(ErasureCodeShec, encode2_3)
   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";
@@ -1782,7 +1782,7 @@ TEST(ErasureCodeShec, decode_1)
   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";
@@ -1848,7 +1848,7 @@ TEST(ErasureCodeShec, decode_8)
   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";
@@ -1914,7 +1914,7 @@ TEST(ErasureCodeShec, decode_9)
   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";
@@ -1992,7 +1992,7 @@ TEST(ErasureCodeShec, decode_10)
   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";
@@ -2043,7 +2043,7 @@ TEST(ErasureCodeShec, decode_11)
   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";
@@ -2093,7 +2093,7 @@ TEST(ErasureCodeShec, decode_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";
@@ -2141,7 +2141,7 @@ TEST(ErasureCodeShec, decode_13)
   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";
@@ -2196,7 +2196,7 @@ TEST(ErasureCodeShec, decode2_1)
   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";
@@ -2252,7 +2252,7 @@ TEST(ErasureCodeShec, decode2_3)
   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";
@@ -2319,7 +2319,7 @@ TEST(ErasureCodeShec, decode2_4)
   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";
@@ -2361,7 +2361,7 @@ TEST(ErasureCodeShec, decode2_4)
   delete profile;
 }
 
-TEST(ErasureCodeShec, create_ruleset_1_2)
+TEST(ErasureCodeShec, create_rule_1_2)
 {
   //create ruleset
   CrushWrapper *crush = new CrushWrapper;
@@ -2397,21 +2397,21 @@ TEST(ErasureCodeShec, create_ruleset_1_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";
   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;
@@ -2419,7 +2419,7 @@ TEST(ErasureCodeShec, create_ruleset_1_2)
   delete crush;
 }
 
-TEST(ErasureCodeShec, create_ruleset_4)
+TEST(ErasureCodeShec, create_rule_4)
 {
   //create ruleset
   CrushWrapper *crush = new CrushWrapper;
@@ -2455,14 +2455,14 @@ TEST(ErasureCodeShec, create_ruleset_4)
   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;
@@ -2470,7 +2470,7 @@ TEST(ErasureCodeShec, create_ruleset_4)
   delete crush;
 }
 
-TEST(ErasureCodeShec, create_ruleset2_1)
+TEST(ErasureCodeShec, create_rule2_1)
 {
   //create ruleset
   CrushWrapper *crush = new CrushWrapper;
@@ -2506,16 +2506,16 @@ TEST(ErasureCodeShec, create_ruleset2_1)
   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());
 
@@ -2529,7 +2529,7 @@ struct CreateRuleset2_3_Param_d {
   CrushWrapper *crush;
 };
 
-TEST(ErasureCodeShec, create_ruleset2_3)
+TEST(ErasureCodeShec, create_rule2_3)
 {
   //create ruleset
   CrushWrapper *crush = new CrushWrapper;
@@ -2565,13 +2565,13 @@ TEST(ErasureCodeShec, create_ruleset2_3)
   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;
@@ -2582,7 +2582,7 @@ TEST(ErasureCodeShec, create_ruleset2_3)
   }
   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;
@@ -2603,7 +2603,7 @@ TEST(ErasureCodeShec, get_chunk_count_1)
   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";
@@ -2626,7 +2626,7 @@ TEST(ErasureCodeShec, get_data_chunk_count_1)
   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";
@@ -2649,7 +2649,7 @@ TEST(ErasureCodeShec, get_chunk_size_1_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";
@@ -2750,7 +2750,7 @@ void* thread3(void* pParam)
   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");
index 6ab69fe6b5cf42e62e10b5d6384d2c63ca08b767..310fd88cb83f036e3a7f953fbfac349a33b31749 100644 (file)
@@ -77,7 +77,7 @@ TEST_P(ParameterTest, parameter_all)
   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;
@@ -90,8 +90,8 @@ TEST_P(ParameterTest, parameter_all)
   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);
 
@@ -215,7 +215,7 @@ TEST_P(ParameterTest, parameter_all)
   EXPECT_FALSE(out1 == in);
   EXPECT_TRUE(usable == in);
 
-  //create_ruleset
+  //create_rule
   stringstream ss;
   CrushWrapper *crush = new CrushWrapper;
   crush->create();
@@ -242,7 +242,7 @@ TEST_P(ParameterTest, parameter_all)
     }
   }
 
-  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());
 
index 2a9da936f4a5dd6cb72bc93c040eb0654f624484..9caa9a8dd29ea3be63dab46a7c989b268c831c26 100644 (file)
@@ -189,7 +189,7 @@ TEST(ParameterTest, combination_all)
                                                         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;
@@ -202,8 +202,8 @@ TEST(ParameterTest, combination_all)
   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);
 
index aa2e89daeb5c2e96669e7bba74b62512c843a7be..6024692b51665e78675a15a9ae548a44311e58da 100644 (file)
@@ -129,7 +129,7 @@ void* thread1(void* pParam)
     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;
@@ -147,8 +147,8 @@ void* thread1(void* pParam)
     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;
index ffba85b7f80efbd0abef9ac90de9dbcef6908877..5bdb34f3f0f7af85908338e29d12d682375a90c6 100755 (executable)
@@ -100,13 +100,13 @@ function TEST_ec_profile_warning() {
     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
index cb1123febe0da9a20a0b8ac3789cbdd4fc17a26e..d9eb953fe2ae15833bb8d2012e78d10e5c2abbf0 100755 (executable)
@@ -56,7 +56,7 @@ function create_erasure_coded_pool() {
     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
@@ -162,7 +162,7 @@ function TEST_rados_put_get_lrc_advanced() {
     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
@@ -181,7 +181,7 @@ function TEST_rados_put_get_lrc_kml() {
     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
 
@@ -201,7 +201,7 @@ function TEST_rados_put_get_isa() {
 
     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
 
@@ -221,7 +221,7 @@ function TEST_rados_put_get_jerasure() {
     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
 
@@ -241,7 +241,7 @@ function TEST_rados_put_get_shec() {
     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
 
@@ -316,7 +316,7 @@ function TEST_chunk_mapping() {
         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
index 710b20343e98bfb7a05b33a3d83dc7142f6f6924..8928f19d3084c29684809abe61230ee842ca4bdb 100755 (executable)
@@ -58,7 +58,7 @@ function create_erasure_coded_pool() {
     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
index ac1e55fba800250e579325cfd621408279677d31..7c9ee59b3ac7e62c25c2e9270b9308e61620c36c 100644 (file)
@@ -114,7 +114,7 @@ std::string create_one_ec_pool(const std::string &pool_name, rados_t *cluster)
   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) {
@@ -207,7 +207,7 @@ std::string create_one_ec_pool_pp(const std::string &pool_name, Rados &cluster)
 
   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();
index f7a9cc3800e21b6ba6ac01494ca42255a912dcc4..f99e091d18785b3f2b9b77aeac56f9cf48336802 100755 (executable)
@@ -142,9 +142,9 @@ function TEST_set_idempotent() {
     #
     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
 
     #
@@ -152,9 +152,9 @@ function TEST_set_idempotent() {
     #
     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
 }
 
index 0d1e19ca9d1d0790d0f809b417fc8de805efc1a6..9b1b715f34828964a69c40b0d26ed7f0a2454732 100644 (file)
@@ -85,7 +85,7 @@ test_erasure(Rados &cluster, std::string pool_name, std::string obj_name)
   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;
index 06f007208b77b0813d8da738ccd20511e5b26313..31b76dcee8bfb4eccae1ba3c4c8b9a6b98e92216 100755 (executable)
@@ -181,7 +181,7 @@ function create_ec_pool() {
     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
 
index 12f6c540c79b205c1adcc3c47e1b3057112ec3bb..3d23996ee1ba5a90cfc44d3355e3c9e0ecaae04e 100755 (executable)
@@ -409,7 +409,7 @@ prepare_conf() {
         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=