You may had some mis-understanding on crush choose algo.
see crush_do_rule https://github.com/ceph/ceph/blob/master/src/crush/mapper.c#L900

In a simple statement,
1-7 are basic crush rule DSL.
8-13 are tuning parameter for some particular step.

a minimal crush rule consists of
1. take, telling which crush bucket to start with
2. choose/chooseleaf, the repeated choose procedure
3. emit, output selected result

the default replication rule looks like:
take root  // from the root bucket
chooseleaf firstn 0 host // recursive to leaf of root, ensuring each selective bucket will not conflict on host level 
emit // as it words 

a more complex rule like, take one from bucket datecenter-1 and others from datacenter-2 bucket:
take datecenter-1
chooseleaf firstn 1 host
emit
take datacenter-2
chooseleaf firstn -1 host
emit

-EOF

On Tue, Jun 16, 2020 at 6:58 PM Bobby <italienisch1987@gmail.com> wrote:

Hi all,

I have a question regarding following rules in Ceph CRUSH map:

enum crush_opcodes {
        /*! do nothing
         */
CRUSH_RULE_NOOP = 0,
CRUSH_RULE_TAKE = 1,          /* arg1 = value to start with */
CRUSH_RULE_CHOOSE_FIRSTN = 2, /* arg1 = num items to pick */
                 /* arg2 = type */
CRUSH_RULE_CHOOSE_INDEP = 3,  /* same */
CRUSH_RULE_EMIT = 4,          /* no args */
CRUSH_RULE_CHOOSELEAF_FIRSTN = 6,
CRUSH_RULE_CHOOSELEAF_INDEP = 7,

CRUSH_RULE_SET_CHOOSE_TRIES = 8, /* override choose_total_tries */
CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */
CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10,
CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11,
CRUSH_RULE_SET_CHOOSELEAF_VARY_R = 12,
CRUSH_RULE_SET_CHOOSELEAF_STABLE = 13
};

Can we skip specific rules ? Or lets say, what are the minimum number of rules required by CRUSH?  

Because my understanding is, it all depends on map hierarchy. If we have a particular/given hierarchy, we can skip certain rules?
_______________________________________________
Dev mailing list -- dev@ceph.io
To unsubscribe send an email to dev-leave@ceph.io