From 5bc554ac5a7a4cd86b873bfc4f4313c91287b52c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 2 Dec 2014 14:10:49 -0800 Subject: [PATCH] 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) --- src/crush/CrushWrapper.h | 4 ++++ src/test/cli/crushtool/build.t | 2 +- src/test/cli/crushtool/set-choose.t | 9 ++++++--- src/test/cli/osdmaptool/create-print.t | 1 + src/test/cli/osdmaptool/create-racks.t | 1 + src/test/cli/osdmaptool/crush.t | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 4323773369be7..3ae8e2a124779 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 ca0804ded6073..f01673704f4c1 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 b7ef59af2bdcf..b40494d018faf 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 9ebd27470b8a0..b642cfbc929f5 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 33fa9eefa992c..11e322345dfde 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 5833da8a7e566..584da09f4c650 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 -- 2.39.5