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@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to