Re: ceph osd reweight (doing -1 or actually -0.0001)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
Thanks Paul for the explanation, sounds very logical now.




-----Original Message-----
From: Paul Emmerich [mailto:paul.emmerich@xxxxxxxx] 
Sent: woensdag 25 april 2018 20:28
To: Marc Roos
Cc: ceph-users
Subject: Re:  ceph osd reweight (doing -1 or actually 
-0.0001)

Hi,



the reweight is internally a number between 0 and 0x10000 for the range 
0 to 1.
0.8 is not representable in this number system.

Having an actual floating point number in there would be annoying 
because CRUSH needs to be 100% deterministic on all clients (also, no 
floating point in the kernel).


osd reweight apparently just echoes whatever you entered here if it 
can't be mapped to a whole number:

(Or it rounds differently, not sure and doesn't matter.)


reweight 0.8 --> 0.8 * 0x10000 = 52428.8; is cut off to 52428 == 0xcccc.
So it just prints out 0.8 but stores 0xcccc.


The logic to read 0xcccc back and convert it back to the 0 - 1 range is:
0xcccc / 0x10000 = 0.79998779296 which is printed as 0.79999.


Anyways, the important value is what is actually stored and that's 
0xcccc. 

It could be argued that "osd reweight" should convert 0.8 to 0xcccd 
(0.80000305175), i.e. to round instead of cut off.



Paul


2018-04-25 12:33 GMT+02:00 Marc Roos <M.Roos@xxxxxxxxxxxxxxxxx>:


	 
	Makes me also wonder what is actually being used by ceph? And thus 
which 
	one is wrong 'ceph osd reweight' output or 'ceph osd df' output. 
	

	-----Original Message-----
	From: Marc Roos 
	Sent: woensdag 25 april 2018 11:58
	To: ceph-users
	Subject:  ceph osd reweight (doing -1 or actually 
-0.0001)
	
	
	Is there some logic behind why ceph is doing this -1, or is this 
some 
	coding error?
	
	0.80000 gives 0.79999, and 0.80001 gives 0.80000
	
	(ceph 12.2.4)
	
	
	[@~]# ceph osd reweight 11 0.80000
	reweighted osd.11 to 0.8 (cccc)
	
	[@~]# ceph osd df
	ID CLASS WEIGHT  REWEIGHT SIZE   USE    AVAIL  %USE  VAR  PGS
	11   hdd 3.00000  0.79999  2794G  2503G   290G 89.59 1.33  38
	
	
	
	[@~]# ceph osd reweight 11 0.80001
	reweighted osd.11 to 0.80001 (cccd)
	
	[@~]# ceph osd df
	ID CLASS WEIGHT  REWEIGHT SIZE   USE    AVAIL  %USE  VAR  PGS
	11   hdd 3.00000  0.80000  2794G  2503G   290G 89.59 1.33  38
	
	
	
	
	_______________________________________________
	ceph-users mailing list
	ceph-users@xxxxxxxxxxxxxx
	http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com 
<http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com> 
	
	
	_______________________________________________
	ceph-users mailing list
	ceph-users@xxxxxxxxxxxxxx
	http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com 
<http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com> 
	




-- 

--
Paul Emmerich

Looking for help with your Ceph cluster? Contact us at https://croit.io

croit GmbH
Freseniusstr. 31h
81247 München
www.croit.io
Tel: +49 89 1896585 90



_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com




[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux