On Wed, Dec 7, 2011 at 10:00, Tommi Virtanen <tommi.virtanen@xxxxxxxxxxxxx> wrote: > 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 = get_random_number() Err I mean pseudorandom, based on pg. So basically "r = pg" there. > chosen = all_osds[ r % len(all_osds) ] > if chosen in result: > # osd can be picked only once > continue > result.append(chosen) > return result -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html