Project

General

Profile

Fix #8362

an invalid '-1' crush ruleset is offered during pool creation

Added by John Spray over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Backend (REST API)
Target version:
% Done:

0%

Source:
other
Tags:
Backport:
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

When creating a pool, the UI has a blank selection by default for crush ruleset, which appears to correspond to sending '-1' for the ruleset during the POST. The crush_rule and crush_rule_set API resources appear to be correctly reporting a single rule+ruleset:

GET /api/v2/cluster/b562bf19-89b1-497d-b78c-7a062cc53211/crush_rule
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS

[
    {
        "id": 0, 
        "name": "replicated_ruleset", 
        "ruleset": 0, 
        "type": "replicated", 
        "min_size": 1, 
        "max_size": 10, 
        "steps": [
            {
                "item_name": "default", 
                "item": -1, 
                "op": "take" 
            }, 
            {
                "num": 0, 
                "type": "host", 
                "op": "chooseleaf_firstn" 
            }, 
            {
                "op": "emit" 
            }
        ], 
        "osd_count": 6
    }
]
GET /api/v2/cluster/b562bf19-89b1-497d-b78c-7a062cc53211/crush_rule_set
HTTP 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Allow: GET, HEAD, OPTIONS

[
    {
        "id": 0, 
        "rules": [
            {
                "id": 0, 
                "name": "replicated_ruleset", 
                "ruleset": 0, 
                "type": "replicated", 
                "min_size": 1, 
                "max_size": 10, 
                "steps": [
                    {
                        "item_name": "default", 
                        "item": -1, 
                        "op": "take" 
                    }, 
                    {
                        "num": 0, 
                        "type": "host", 
                        "op": "chooseleaf_firstn" 
                    }, 
                    {
                        "op": "emit" 
                    }
                ], 
                "osd_count": 6
            }
        ]
    }
]

ceph master bfce3d4, clients master 89eb7523, chrome on OS X.

Screen Shot 2014-05-15 at 16.36.50.png View (220 KB) John Spray, 05/15/2014 10:06 AM

Screen Shot 2014-05-15 at 18.46.33.png View (66.9 KB) John Spray, 05/15/2014 10:46 AM

Screen Shot 2014-05-15 at 18.49.00.png View (109 KB) John Spray, 05/15/2014 10:47 AM

Screen Shot 2014-05-15 at 19.12.38.png View (54.9 KB) John Spray, 05/15/2014 11:11 AM

Associated revisions

Revision da7d0986 (diff)
Added by John Spray over 7 years ago

calamari_rest: work around ceph's dodgy defaults

Ceph's default pool crush ruleset setting was giving us
grief: * It was quietly changed around in firefly such that
the dumpling setting is set to -1 by default. * The value can be invalid, there's no checking in ceph
that the ruleset ID actually exists, e.g. it's 0 by default
but you can delete the 0 rule.

This change adds a conditional to pick out the firefly
value or the dumpling value, whichever actually corresponds
to a valid ruleset id. If neither do, we pick the lowest
numbered ruleset.

Fixes: #8362

Signed-off-by: John Spray <>

History

#1 Updated by John Spray over 7 years ago

  • Description updated (diff)

#2 Updated by Yan-Fa Li over 7 years ago

I don't understand what I'm seeing. What is in the crush rule set that creates a -1? You can talk me through it during standup. The front end uses what it gets from the backend. If there's a -1 and that's a special case we need to handle it.

#3 Updated by John Spray over 7 years ago

The reason I've pasted the output of the API here is to illustrate that there is no "-1" rule coming from the backend -- neither ceph nor the backend have any concept of a -1 rule.

#4 Updated by Yan-Fa Li over 7 years ago

Then I'm doubly confused. The front end doesn't have a way to create crush rules...

#8 Updated by Yan-Fa Li over 7 years ago

  • Subject changed from UI: an invalid '-1' crush ruleset is offered during pool creation to an invalid '-1' crush ruleset is offered during pool creation
  • Category changed from UI to Backend (REST API)
  • Assignee changed from Yan-Fa Li to John Spray
  • Target version set to v1.2-dev10

John tracked it down to an undocumented change in the Ceph API. Reassigning.

#9 Updated by John Spray over 7 years ago

  • Status changed from New to Fix Under Review

#10 Updated by John Spray over 7 years ago

  • Tracker changed from Bug to Fix

#11 Updated by Christina Meno over 7 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF