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

fix crash with custom crush buckets between host and osd #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions placementoptimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2212,11 +2212,16 @@ def preprocess(self):


# store osd host name
for node in self.state["osd_df_tree_dump"]["nodes"]:
if node['type'] == "host":
for osdid in node['children']:
self.osds[osdid]["host_name"] = node['name']

nodes = self.state["osd_df_tree_dump"]["nodes"]
def host_extend_osds(host, node):
for child_id in node['children']:
for child in [n for n in nodes if n['id'] == child_id]:
if child['type'] == 'osd' and child_id in self.osds:
self.osds[child_id]['host_name'] = host['name']
else:
host_extend_osds(host, child)
for host in [n for n in nodes if n['type'] == 'host']:
host_extend_osds(host, host)

# crush infos
for rule in self.state["crush_dump"]["rules"]:
Expand Down