Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: tools: crushtool crash on Fedora 28 and newer #27986

Merged
merged 2 commits into from Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/crush/CrushCompiler.cc
Expand Up @@ -744,7 +744,7 @@ int CrushCompiler::parse_bucket(iter_t const& i)
assert(id != 0);
int idout;
int r = crush.add_bucket(id, alg, hash, type, size,
&items[0], &weights[0], &idout);
items.data(), weights.data(), &idout);
if (r < 0) {
if (r == -EEXIST)
err << "Duplicate bucket id " << id << std::endl;
Expand Down
42 changes: 42 additions & 0 deletions src/test/cli/crushtool/empty-default.cushmap.txt
@@ -0,0 +1,42 @@
# begin crush map
tunable choose_local_tries 0
tunable choose_local_fallback_tries 0
tunable choose_total_tries 50
tunable chooseleaf_descend_once 1
tunable chooseleaf_vary_r 1
tunable chooseleaf_stable 0
tunable straw_calc_version 1
tunable allowed_bucket_algs 22

# types
type 0 osd
type 1 host
type 2 chassis
type 3 rack
type 4 row
type 5 pdu
type 6 pod
type 7 room
type 8 datacenter
type 9 region
type 10 root

# default bucket
root default {
id -1 # do not change unnecessarily
alg straw
hash 0 # rjenkins1
}

# rules
rule replicated_ruleset {
ruleset 0
type replicated
min_size 1
max_size 10
step take default
step chooseleaf firstn 0 type host
step emit
}

# end crush map
2 changes: 2 additions & 0 deletions src/test/cli/crushtool/empty-default.t
@@ -0,0 +1,2 @@
$ crushtool -c "$TESTDIR/empty-default.cushmap.txt"
crushtool successfully built or modified map. Use '-o <file>' to write it out.