RE: libcrush.so

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

 



Greg, Thanks a lot for the info! 
Yes current CRUSH code heavily relies on the internal data structures and it's a bit difficult to extract it out. 
For the APIs, do you have any ideas on this? Currently I see there should have:

map object to pg: give the object name, return the pg 	
map pg to osds: give the pg, return the osd lists 

We have done some tests here. Let me see if I can make it more clean for a PR. 

Thanks, -yuan

-----Original Message-----
From: Gregory Farnum [mailto:greg@xxxxxxxxxxx] 
Sent: Friday, May 8, 2015 12:37 PM
To: Zhou, Yuan
Cc: Ceph Development; Cohen, David E; Yu, Zhidong
Subject: Re: libcrush.so

On Thu, May 7, 2015 at 6:29 PM, Zhou, Yuan <yuan.zhou@xxxxxxxxx> wrote:
> Ceph use crush algorithm to provide the mapping of objects to OSD servers. This is great for clients so they could talk to with these OSDs directly. However there are some scenarios where the application needs to access the crush map, for load-balancing as an example.
>
> Currently Ceph doesn't provides any API to render the layout. If your application needs to access the crush map you'll going to rely on the command 'ceph osd map pool_name obj_name'. With this libcrush.so we could let the application to choose which nodes to access. The other advantage is we could provide some other bindings(python, go) based on this also.
>
> From the git log we find libcrush was there before but removed out since Argonaut. Can anyone kindly share us the background of this change?

I don't think there was ever a libcrush that was friendly for external use. There was a makefile-level "libcrush" but it got merged into libcommon, presumably for ease of maintenance. The interfaces we use around CRUSH are just not very clean, IIRC; the C interface is opaque and the C++ CrushWrapper bits are...well, C++, and not easy to change into something separable from the OSDMap, either. :/

That said, if somebody wanted to rework the code interfaces to be nicer, PRs are always welcome. ;)
��.n��������+%������w��{.n����z��u���ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux