How does crush selects different osds using hash(pg) in diferent iterations

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

 



Hi ,

I was going through this simplified crush algorithm given in ceph website.

def crush(pg):
   all_osds = ['osd.0', 'osd.1', 'osd.2', ...]
   result = []
   # size is the number of copies; primary+replicas
   while len(result) < size:
   --> r = hash(pg)
       chosen = all_osds[ r % len(all_osds) ]
       if chosen in result:
           # OSD can be picked only once
           continue
       result.append(chosen)
   return result
10:24 PM (51 minutes ago)
In the line where r = hash(pg) , will it gives the same hash value in every iteration ?
if that is the case we always endup choosing the same osd from the list
or will the pg number be used as seed for the hashing so that r value changes in the next iteration.

Am I missing something really basic ??
Can somebody please provide me some pointers ?



--
Thanks,
Shylesh Kumar M
 
_______________________________________________
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