> > The rule generalizes to N replicas, where N can be 2..10 (that's what the > > min/max size fields are for). And the chooseleaf line is correct. That > > chooses N leaves/devices that are nested beneath N distinct racks. Which > > is what you want! > > > > You could also do > > > > step take root > > step choose firstn 0 type rack > > step choose firstn 1 type device > > step emit > > Shouldn't that be: > > step take root > step choose firstn 0 type rack > step choose firstn 1 type host > step choose firstn 2 type device > step emit > > Or am I wrong here? The X in step choose firstn X type T is normally the number of items to choose. But the rule is run with an implicit N, e.g., "run this rule and get 5 replicas." If X <= 0, then we substitude in N+X, so for your case (N=3) it's really step take root step choose firstn 3 type rack Any subsequent choose steps step choose firstn 1 type device loop over the current result set. Once you have the 3 racks, it chooses 1 device under each one. Then step emit emits the final result. Your example > step take root > step choose firstn 0 type rack > step choose firstn 1 type host > step choose firstn 2 type device > step emit would choose N(=3) racks, pick 1 host in each rack, and then pick 2 devices on each host (for a total of 6 devices). Does that make sense? sage > > > > > That would choose N racks, and then for each rack, choose a nested device. > > The problem is when one of the racks it chooses has no (or few) online > > devices beneath it, we fail to find a usable device, and the result set > > will have <N devices. Chooseleaf doesn't have that problem. > > So chooseleaf rack should be safe enough in this case? > > > > > sage > > Wido > > -- > 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 > > -- 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