Project

General

Profile

Actions

Bug #48508

closed

Donot roundoff the bucket weight while decompiling crush map to source

Added by Prashant D over 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
nautilus, octopus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

While decompiling a crush map to source we are rounding off the weight which makes end user to think there is inconsistency in rack/host/osd weight between what is defined in crush map and ceph osd (df) tree output.

for example :
ceph osd tree output

[root@2d541018e011 build]# ./bin/ceph osd tree
ID  CLASS  WEIGHT   TYPE NAME              STATUS  REWEIGHT  PRI-AFF
-1         0.29576  root default                                    
-3         0.29576      host 2d541018e011                           
 0    hdd  0.09859          osd.0              up   1.00000  1.00000
 1    hdd  0.09859          osd.1              up   1.00000  1.00000
 2    hdd  0.09859          osd.2              up   1.00000  1.00000

ceph osd df tree

[root@2d541018e011 build]# ./bin/ceph osd df tree
ID  CLASS  WEIGHT   REWEIGHT  SIZE     RAW USE  DATA     OMAP  META    AVAIL    %USE  VAR   PGS  STATUS  TYPE NAME            
-1         0.29576         -  303 GiB  3.0 GiB  792 KiB   0 B  42 MiB  300 GiB  0.99  1.00    -          root default         
-3         0.29576         -  303 GiB  3.0 GiB  792 KiB   0 B  42 MiB  300 GiB  0.99  1.00    -              host 2d541018e011
 0    hdd  0.09859   1.00000  101 GiB  1.0 GiB  264 KiB   0 B  14 MiB  100 GiB  0.99  1.00   65      up          osd.0        
 1    hdd  0.09859   1.00000  101 GiB  1.0 GiB  264 KiB   0 B  14 MiB  100 GiB  0.99  1.00   65      up          osd.1        
 2    hdd  0.09859   1.00000  101 GiB  1.0 GiB  264 KiB   0 B  14 MiB  100 GiB  0.99  1.00   65      up          osd.2        
                       TOTAL  303 GiB  3.0 GiB  792 KiB   0 B  42 MiB  300 GiB  0.99                                          
MIN/MAX VAR: 1.00/1.00  STDDEV: 0

map summary as a tree

[root@2d541018e011 build]# ./bin/crushtool -i crushmap.bin --tree
ID  CLASS  WEIGHT   TYPE NAME                
-2    hdd  0.29576  root default~hdd         
-4    hdd  0.29576      host 2d541018e011~hdd
 0    hdd  0.09859          osd.0            
 1    hdd  0.09859          osd.1            
 2    hdd  0.09859          osd.2            
-1         0.29576  root default             
-3         0.29576      host 2d541018e011    
 0    hdd  0.09859          osd.0            
 1    hdd  0.09859          osd.1            
 2    hdd  0.09859          osd.2            

decompiler crush map

[root@2d541018e011 build]# cat crushmap.txt
# begin crush map
tunable choose_local_tries 0
tunable choose_local_fallback_tries 0
tunable choose_total_tries 50
tunable chooseleaf_descend_once 1
tunable chooseleaf_vary_r 1
tunable chooseleaf_stable 1
tunable straw_calc_version 1
tunable allowed_bucket_algs 54

# devices
device 0 osd.0 class hdd
device 1 osd.1 class hdd
device 2 osd.2 class hdd

# types
type 0 osd
type 1 host
type 2 chassis
type 3 rack
type 4 row
type 5 pdu
type 6 pod
type 7 room
type 8 datacenter
type 9 zone
type 10 region
type 11 root

# buckets
host 2d541018e011 {
    id -3        # do not change unnecessarily
    id -4 class hdd        # do not change unnecessarily
    # weight 0.296
    alg straw2
    hash 0    # rjenkins1
    item osd.0 weight 0.099
    item osd.1 weight 0.099
    item osd.2 weight 0.099
}
root default {
    id -1        # do not change unnecessarily
    id -2 class hdd        # do not change unnecessarily
    # weight 0.296
    alg straw2
    hash 0    # rjenkins1
    item 2d541018e011 weight 0.296
}

# rules
rule replicated_rule {
    id 0
    type replicated
    min_size 1
    max_size 10
    step take default
    step choose firstn 0 type osd
    step emit
}

# end crush map

Actions #1

Updated by Prashant D over 3 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 38500
Actions #2

Updated by Prashant D over 2 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF