Bug 1289658 - [RFE] crushtool should check for duplicated ruleset id
Summary: [RFE] crushtool should check for duplicated ruleset id
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat
Component: RADOS
Version: 1.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 2.0
Assignee: Kefu Chai
QA Contact: Rachana Patel
Bara Ancincova
URL:
Whiteboard:
Depends On:
Blocks: 1322504
TreeView+ depends on / blocked
 
Reported: 2015-12-08 16:32 UTC by Alexandre Marangone
Modified: 2017-07-30 15:09 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
.`crushtool` now checks for overlapping CRUSH rules The `crushtool` now checks if the CRUSH rules overlap. To check if the CRUSH rules overlap, use the following command. If `crushtool` finds any overlapping rules, it outputs them: ---- $ crushtool --check -i <crush_file> overlapped rules in ruleset 0: rule-r0, rule-r1, rule-r2 ----
Clone Of:
Environment:
Last Closed: 2016-08-23 19:28:56 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1755 normal SHIPPED_LIVE Red Hat Ceph Storage 2.0 bug fix and enhancement update 2016-08-23 23:23:52 UTC

Comment 2 Ken Dreyer (Red Hat) 2015-12-08 16:58:02 UTC
Kefu, can you please look into this issue (or re-assign as appropriate?)

Comment 6 Kefu Chai 2016-01-06 05:02:53 UTC
as Sam put, it's not entirely a bug. see http://docs.ceph.com/docs/master/rados/operations/crush-map/#crush-map-rules. but we can surely detect the ambiguous case where CRUSH could choose multiple rules from a given ruleset for a given pool.

but i'd like put this feature into crushtool:

$ crushtool --check -i <crush_file>

overlapped rules: replicated_rule0, replicated_rule1
overlapped rules: replicated_rule0, replicated_rule2

if we feed following rules to crushtool:

rule replicated_rule0 {
        ruleset 0
        type replicated
        min_size 1
        max_size 3
        step take default
        step chooseleaf firstn 0 type osd
        step emit
}

rule replicated_rule1 {
        ruleset 0
        type replicated
        min_size 1
        max_size 1
        step take default
        step chooseleaf firstn 0 type host
        step emit
}

rule replicated_rule2 {
        ruleset 0
        type replicated
        min_size 2
        max_size 3
        step take default
        step chooseleaf firstn 0 type host
        step emit
}


what do you think?

Comment 7 Alexandre Marangone 2016-01-06 14:08:26 UTC
Looks good.

Comment 8 Kefu Chai 2016-01-07 10:18:30 UTC
https://github.com/ceph/ceph/pull/7139

Comment 9 Ken Dreyer (Red Hat) 2016-02-29 22:19:39 UTC
https://github.com/ceph/ceph/pull/7139 accepted upstream

Comment 12 Kefu Chai 2016-06-08 05:43:24 UTC
Bara, i updated the "Doc Text" with some sample output if any rules are overlapped. does it make sense to you?

Comment 14 Rachana Patel 2016-06-13 21:48:36 UTC
Verified with - 10.2.1-12.el7cp.x86_64



[root@magna051 ubuntu]# crushtool -i  "/tmp/cm.new" --check
overlapped rules in ruleset 0: replicated_rule0, replicated_rule1, replicated_ruleset
overlapped rules in ruleset 0: replicated_rule0, replicated_rule2, replicated_ruleset
[root@magna051 ubuntu]# crushtool -i  "/tmp/cm" --check

Works as expected hence moving to Verified

Comment 16 errata-xmlrpc 2016-08-23 19:28:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1755


Note You need to log in before you can comment on or make changes to this bug.