Skip to content
Snippets Groups Projects
Commit c423ed48 authored by Justin Mammarella's avatar Justin Mammarella
Browse files

Merge branch 'bugfix_stuck_osds' into 'master'

Prevent pg movement on osds with no crushclasses

See merge request !2
parents 6c9f1272 fd5a30d1
Branches
No related tags found
1 merge request!2Prevent pg movement on osds with no crushclasses
......@@ -4668,6 +4668,24 @@ def balance(args, cluster):
if osd_from not in source_osds:
continue
## WX BUGFIX --- Only utilize the osds with the right crushclass
#Iterate through valid crushclasses
for crushclass_name in pg_mappings.get_enabled_crushclasses():
osds_in_crushclass = cluster.get_crushclass_osds(crushclass_name)
#Skip balancing the OSD if it does not have the right crushclass
if osd_from not in osds_in_crushclass:
logging.info(f"-BUGFIX: WE ARE ONLY USING CRUSHCLASS: {crushclass_name}")
logging.info(f"-BUGFIX: OSD: {osd_from} HAS INVALID CRUSHCLASS - SKIPPING")
skip_osd=True
continue
else:
skip_osd=False
#Comment/uncomment this if statement to see effects of bugfix
if skip_osd:
continue
source_attempts += 1
if source_attempts > args.max_move_attempts:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment