From 7ea5d84fa3d0ed3db61eea7eb9fa8dbee53244b6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 11 Jan 2013 17:23:22 -0800 Subject: [PATCH] osdmap: spread replicas across hosts with default crush map This is more often the case than not, and we don't have a good way to magically know what size of cluster the user will be creating. Better to err on the side of doing the right thing for more people. Fixes: #3785 Signed-off-by: Sage Weil Reviewed-by: Greg Farnum --- src/osd/OSDMap.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 63a1fae809bc4..93ecb6055b6d8 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1680,8 +1680,8 @@ void OSDMap::build_simple_crush_map(CephContext *cct, CrushWrapper& crush, crush_rule *rule = crush_make_rule(3, ruleset, pg_pool_t::TYPE_REP, minrep, maxrep); assert(rule); crush_rule_set_step(rule, 0, CRUSH_RULE_TAKE, rootid, 0); - // just spread across osds - crush_rule_set_step(rule, 1, CRUSH_RULE_CHOOSE_FIRSTN, CRUSH_CHOOSE_N, 0); + // spread across hosts + crush_rule_set_step(rule, 1, CRUSH_RULE_CHOOSE_LEAF_FIRSTN, CRUSH_CHOOSE_N, 1); crush_rule_set_step(rule, 2, CRUSH_RULE_EMIT, 0, 0); int rno = crush_add_rule(crush.crush, rule, -1); crush.set_rule_name(rno, p->second); -- 2.39.5