Git Product home page Git Product logo

Comments (6)

briend avatar briend commented on June 7, 2024

I suppose this is because "default~ssd" != "ssd" (but that seems too obvious)

from rook.

wanghui-devops avatar wanghui-devops commented on June 7, 2024

exec "ceph osd tree" to see the type of osd ; is have ssd ?

from rook.

briend avatar briend commented on June 7, 2024

exec "ceph osd tree" to see the type of osd ; is have ssd ?

Yes, they are all ssd in this test cluster

ceph osd tree | grep osd
ID   CLASS  WEIGHT   TYPE NAME                STATUS  REWEIGHT  PRI-AFF
  2    ssd  0.93149                  osd.2        up   1.00000  1.00000
  1    ssd  0.93149                  osd.1        up   1.00000  1.00000
  0    ssd  0.93149                  osd.0        up   1.00000  1.00000
  3    ssd  0.93149                  osd.3        up   1.00000  1.00000

from rook.

sp98 avatar sp98 commented on June 7, 2024

I suppose this is because "default~ssd" != "ssd" (but that seems too obvious)

This looks like the root cause.

With no deviceClass set in the Pool, I have following crush rule:

{
        "rule_id": 1,
        "rule_name": "replicapool",
        "type": 1,
        "steps": [
            {
                "op": "take",
                "item": -1,
                "item_name": "default"
            },
            {
                "op": "choose_firstn",
                "num": 0,
                "type": "osd"
            },
            {
                "op": "emit"
            }
        ]
    },

The rook operator is comparing "default" != "" over here for the deviceClass.

Thoughts @subhamkrai ?

from rook.

briend avatar briend commented on June 7, 2024

We do have deviceClass set on all of our pools, so maybe that is unusual. We had to do that to avoid overlapping roots with multiple device classes.

This probably ought to extract the deviceClass after the "~" character in ItemName ?

deviceClass = step.ItemName

Here are the decompiled crush rules in case that is helpful:

rule ceph-ops1-block-pool-1 {
        id 11
        type replicated
        step take default class ssd
        step chooseleaf firstn 0 type host
        step emit
}
rule ceph-ops1-block-pool-1_host_ssd {
        id 12
        type replicated
        step take default class ssd
        step chooseleaf firstn 0 type host
        step emit
}

from rook.

subhamkrai avatar subhamkrai commented on June 7, 2024

Thanks for all the clues.

I have not tested this but I guess below sample code will fix

func extractPoolDetails(rule ruleSpec) (string, string) {
	---
	for i, step := range rule.Steps {
		---
		if step.ItemName != "default" {
			deviceClass = step.ItemName
		}
	---
	}

	if strings.Contains(deviceClass, "default~") && len(strings.Split(deviceClass, "~")) == 2 {
		deviceClass = strings.Split(deviceClass, "~")[1]
	}
	return failureDomain, deviceClass
}

@sp98 @briend wdyt?

from rook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.