]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crush/mapper: apply chooseleaf_tries to firstn mode too
authorSage Weil <sage@inktank.com>
Tue, 3 Dec 2013 16:33:55 +0000 (08:33 -0800)
committerSage Weil <sage@inktank.com>
Fri, 6 Dec 2013 22:24:02 +0000 (14:24 -0800)
commit64aeded50d80942d66a5ec7b604ff2fcbf5d7b63
treecc3dc51558712387c37ae4fbea9f43dbf53b0c07
parentcb88763ccbe372e0520dc97c77f791cf8abae9ab
crush/mapper: apply chooseleaf_tries to firstn mode too

Parameterize the attempts for the _firstn choose method, and apply the
rule-specified tries count to firstn mode as well.  Note that we have
slightly different behavior here than with indep:

 If the firstn value is not specified for firstn, we pass through the
 normal attempt count.  This maintains compatibility with legacy behavior.
 Note that this is usually *not* actually N^2 work, though, because of the
 descend_once tunable.  However, descend_once is unfortunately *not* the
 same thing as 1 chooseleaf try because it is only checked on a reject but
 not on a collision.  Sigh.

 In contrast, for indep, if tries is not specified we default to 1
 recursive attempt, because that is simply more sane, and we have the
 option to do so.  The descend_once tunable has no effect for indep.

Signed-off-by: Sage Weil <sage@inktank.com>
src/crush/crush.h
src/crush/mapper.c