Bug #22300
closedceph osd reweightn command seems to change weight value
0%
Description
Hi,
on 12.2.2, when using the ceph osd reweightn command it looks like the weight value gets changed to an unexpected value.
Here is the tree for my test cluster:
[root@luminous system]# ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 0.05800 root default
-3 0.05800 host luminous
0 hdd 0.01900 osd.0 up 1.00000 1.00000
1 hdd 0.01900 osd.1 up 1.00000 1.00000
2 hdd 0.01900 osd.2 up 1.00000 1.00000
If I attempt to change a weight for one or more OSDs, a value of 1.0 gets changed to 0.00002:
[root@luminous system]# ceph osd reweightn "{'0':'1.000000'}"
[root@luminous system]# ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 0.05800 root default
-3 0.05800 host luminous
0 hdd 0.01900 osd.0 up 0.00002 1.00000
1 hdd 0.01900 osd.1 up 1.00000 1.00000
2 hdd 0.01900 osd.2 up 1.00000 1.00000
If I attempt to change a weight for one or more OSDs, a value of 2.0 gets changed to 0.00003:
[root@luminous system]# ceph osd reweightn "{'0':'2.000000'}"
[root@luminous system]# ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 0.05800 root default
-3 0.05800 host luminous
0 hdd 0.01900 osd.0 up 0.00003 1.00000
1 hdd 0.01900 osd.1 up 1.00000 1.00000
2 hdd 0.01900 osd.2 up 1.00000 1.00000
To get out of this situation you have to resort to the old ceph osd reweight command that works OSd per PSD.
[root@luminous system]# ceph osd reweight 0 1
reweighted osd.0 to 1 (10000)
[root@luminous system]# ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 0.05800 root default
-3 0.05800 host luminous
0 hdd 0.01900 osd.0 up 1.00000 1.00000
1 hdd 0.01900 osd.1 up 1.00000 1.00000
2 hdd 0.01900 osd.2 up 1.00000 1.00000
I don't know if the problem comes from my syntax being wrong or if this is a real problem.
Thanks
JC