Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

Commit

Permalink
fix an issue that fail to add the removed server with more than one osd
Browse files Browse the repository at this point in the history
  • Loading branch information
zhubx007 committed Jul 27, 2016
1 parent 92a03aa commit 121a72c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions source/vsm/vsm/agent/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ def _add_osd(self,
# run_as_root=True)

all_osd_in_host = db.osd_state_get_by_service_id(context,osd_state['service_id'])
other_osd_in_host = [osd['osd_name'] for osd in all_osd_in_host if osd['device_id'] != osd_state['device_id'] and osd['state'] != 'Uninitialized']
# other_osd_in_host = [osd['osd_name'] for osd in all_osd_in_host if osd['device_id'] != osd_state['device_id'] and osd['state'] != 'Uninitialized']
crushmap = self.get_crushmap_json_format()
LOG.info("osd_location_direct=======%s"%osd_state.get('osd_location'))
osd_location_direct = osd_state.get('osd_location')
Expand All @@ -1461,9 +1461,9 @@ def _add_osd(self,
osd_location_str = osd_location_direct
else:
osd_location_str = "%s=%s"%(crushmap._types[1]['name'],osd_location_direct)
elif len(other_osd_in_host) > 0:
osd_location = crushmap._get_location_by_osd_name(other_osd_in_host[0])
osd_location_str = "%s=%s"%(osd_location['type_name'],osd_location['name'])
# elif len(other_osd_in_host) > 0:
# osd_location = crushmap._get_location_by_osd_name(other_osd_in_host[0])
# osd_location_str = "%s=%s"%(osd_location['type_name'],osd_location['name'])
else:
osd_location = crush_dict['host']
osd_location_str = "%s=%s"%(crushmap._types[1]['name'],osd_location)
Expand Down
2 changes: 1 addition & 1 deletion source/vsm/vsm/agent/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ def update_osds_status(self, context):
value= {}
value['id'] = osd_id
value['osd_name'] = 'osd.x'
value['state'] = 'Out-Down'
value['state'] = str(FLAGS.vsm_status_uninitialized)
value['operation_status'] = FLAGS.vsm_status_removed
db.osd_state_update(context, osd_id, value)

Expand Down
2 changes: 1 addition & 1 deletion source/vsm/vsm/scheduler/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ def remove_servers(self, context, body=None):
"osd_name": "osd.%s" % str(FLAGS.vsm_status_uninitialized),
"osd_location": "",
"deleted": False,
"operation_status": "Present",
# "operation_status": "Present",
"state": str(FLAGS.vsm_status_uninitialized)
}
LOG.info("update deleted osd to uninited")
Expand Down

0 comments on commit 121a72c

Please sign in to comment.