Bug 1289658

Summary: [RFE] crushtool should check for duplicated ruleset id
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Alexandre Marangone <amarango>
Component: RADOSAssignee: Kefu Chai <kchai>
Status: CLOSED ERRATA QA Contact: Rachana Patel <racpatel>
Severity: medium Docs Contact: Bara Ancincova <bancinco>
Priority: unspecified    
Version: 1.3.0CC: amarango, ceph-eng-bugs, dzafman, flucifre, hnallurv, kchai, kdreyer, nlevine, shohn, sjust
Target Milestone: rcKeywords: FutureFeature
Target Release: 2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 ----
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-23 19:28:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1322504    

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