From: Sage Weil Date: Tue, 2 Dec 2014 22:10:49 +0000 (-0800) Subject: crush: default to straw_calc_version 1 X-Git-Tag: v0.80.9~11^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5bc554ac5a7a4cd86b873bfc4f4313c91287b52c;p=ceph.git crush: default to straw_calc_version 1 Stick with bobtail tunables where it affects compatibility. Use v1 of straw_calc, though, since that does not, and we want the best for new clusters. Signed-off-by: Sage Weil (cherry picked from commit 9565621d6007302fdd68ba27b6aef22e487f0985) --- diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 4323773369b..3ae8e2a1247 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -132,7 +132,11 @@ public: set_tunables_firefly(); } void set_tunables_default() { + // default to bobtail tunables for the bits that affect + // compatibility, but default to the latest straw_calc_version + // because that does not. set_tunables_bobtail(); + crush->straw_calc_version = 1; } int get_choose_local_tries() const { diff --git a/src/test/cli/crushtool/build.t b/src/test/cli/crushtool/build.t index ca0804ded60..f01673704f4 100644 --- a/src/test/cli/crushtool/build.t +++ b/src/test/cli/crushtool/build.t @@ -52,7 +52,7 @@ # # crush rulesets are generated using the OSDMap helpers # - $ CEPH_ARGS="--debug-crush 0" crushtool --outfn "$map" --build --num_osds 1 root straw 0 + $ CEPH_ARGS="--debug-crush 0" crushtool --outfn "$map" --set-straw-calc-version 0 --build --num_osds 1 root straw 0 $ crushtool -o "$map.txt" -d "$map" $ cat "$map.txt" # begin crush map diff --git a/src/test/cli/crushtool/set-choose.t b/src/test/cli/crushtool/set-choose.t index b7ef59af2bd..b40494d018f 100644 --- a/src/test/cli/crushtool/set-choose.t +++ b/src/test/cli/crushtool/set-choose.t @@ -1,5 +1,6 @@ $ crushtool -c "$TESTDIR/set-choose.crushmap.txt" -o set-choose.crushmap - $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics + $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics --set-straw-calc-version 0 + crushtool successfully built or modified map. Use '-o ' to write it out. rule 0 (choose), x = 0..1023, numrep = 2..3 CRUSH rule 0 x 0 [0,3] CRUSH rule 0 x 1 [0,8] @@ -12306,7 +12307,8 @@ CRUSH rule 5 x 1022 [1,6,4] CRUSH rule 5 x 1023 [3,2,8] rule 5 (chooseleaf-set) num_rep 3 result size == 3:\t1024/1024 (esc) - $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics --weight 0 0 --weight 1 0 --weight 3 0 --weight 4 0 + $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics --weight 0 0 --weight 1 0 --weight 3 0 --weight 4 0 --set-straw-calc-version 0 + crushtool successfully built or modified map. Use '-o ' to write it out. rule 0 (choose), x = 0..1023, numrep = 2..3 CRUSH rule 0 x 0 [2,5] CRUSH rule 0 x 1 [2,8] @@ -24618,7 +24620,8 @@ CRUSH rule 5 x 1022 [2,6,5] CRUSH rule 5 x 1023 [5,2,8] rule 5 (chooseleaf-set) num_rep 3 result size == 3:\t1024/1024 (esc) - $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics --weight 0 0 --weight 3 0 --weight 4 .5 --weight 5 0 --weight 6 .1 --weight 7 0 + $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics --weight 0 0 --weight 3 0 --weight 4 .5 --weight 5 0 --weight 6 .1 --weight 7 0 --set-straw-calc-version 0 + crushtool successfully built or modified map. Use '-o ' to write it out. rule 0 (choose), x = 0..1023, numrep = 2..3 CRUSH rule 0 x 0 [2,4] CRUSH rule 0 x 1 [2,8] diff --git a/src/test/cli/osdmaptool/create-print.t b/src/test/cli/osdmaptool/create-print.t index 9ebd27470b8..b642cfbc929 100644 --- a/src/test/cli/osdmaptool/create-print.t +++ b/src/test/cli/osdmaptool/create-print.t @@ -11,6 +11,7 @@ tunable choose_local_fallback_tries 0 tunable choose_total_tries 50 tunable chooseleaf_descend_once 1 + tunable straw_calc_version 1 # devices device 0 osd.0 diff --git a/src/test/cli/osdmaptool/create-racks.t b/src/test/cli/osdmaptool/create-racks.t index 33fa9eefa99..11e322345df 100644 --- a/src/test/cli/osdmaptool/create-racks.t +++ b/src/test/cli/osdmaptool/create-racks.t @@ -10,6 +10,7 @@ tunable choose_local_fallback_tries 0 tunable choose_total_tries 50 tunable chooseleaf_descend_once 1 + tunable straw_calc_version 1 # devices device 0 device0 diff --git a/src/test/cli/osdmaptool/crush.t b/src/test/cli/osdmaptool/crush.t index 5833da8a7e5..584da09f4c6 100644 --- a/src/test/cli/osdmaptool/crush.t +++ b/src/test/cli/osdmaptool/crush.t @@ -6,5 +6,5 @@ osdmaptool: exported crush map to oc $ osdmaptool --import-crush oc myosdmap osdmaptool: osdmap file 'myosdmap' - osdmaptool: imported 486 byte crush map from oc + osdmaptool: imported 487 byte crush map from oc osdmaptool: writing epoch 3 to myosdmap