Commit fdba2409 authored by Felix Seibert's avatar Felix Seibert
Browse files

fix two errors in lpt rebalancing

parent 9df9f975
...@@ -268,6 +268,7 @@ class DataDistribution(object): ...@@ -268,6 +268,7 @@ class DataDistribution(object):
processing time than the average processing time of this distribution multiplied by rebalance_factor. processing time than the average processing time of this distribution multiplied by rebalance_factor.
2. reassign the removed folders using the LPT strategy. 2. reassign the removed folders using the LPT strategy.
""" """
total_folder_size = self.get_total_folder_size()
movements = {} movements = {}
folders_to_be_reassigned = [] folders_to_be_reassigned = []
...@@ -276,7 +277,7 @@ class DataDistribution(object): ...@@ -276,7 +277,7 @@ class DataDistribution(object):
for osd in self.OSDs.values(): for osd in self.OSDs.values():
# self.get_total_folder_size / self.get_total_bandwidth() is the optimal processing time for each OSD: # self.get_total_folder_size / self.get_total_bandwidth() is the optimal processing time for each OSD:
# this value is a lower bound for the makespan # this value is a lower bound for the makespan
reassignment_limit = osd.bandwidth * (self.get_total_folder_size() / self.get_total_bandwidth()) reassignment_limit = self.get_rebalance_limit(rebalance_factor, total_folder_size)
while osd.get_processing_time() > reassignment_limit: while osd.get_processing_time() > reassignment_limit:
folder_id, folder_size = osd.get_smallest_folder() folder_id, folder_size = osd.get_smallest_folder()
folders_to_be_reassigned.append(folder.Folder(folder_id, folder_size, None)) folders_to_be_reassigned.append(folder.Folder(folder_id, folder_size, None))
...@@ -291,6 +292,9 @@ class DataDistribution(object): ...@@ -291,6 +292,9 @@ class DataDistribution(object):
return movements return movements
def get_rebalance_limit(self, factor, total_folder_size):
return factor * (total_folder_size / self.get_total_bandwidth())
def rebalance_one_folder(self): def rebalance_one_folder(self):
""" """
rebalance folders to OSDs by assigning folders to new OSDs using the following strategy: rebalance folders to OSDs by assigning folders to new OSDs using the following strategy:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment